Authorisation scheme: poll from function from PL/SQL Boolean value
HelloI use with authorisation schemes on page 2 as function of PL/SQL to return a Boolean.
The value of P1_PREF is from page1 (search) report box, driven model type (< class td = "t12data" >#PREF # < table >)
--(lien hypertexte pref) to page 2 P2_PREF.
I tried passing the value (: P2_PREF or: P1_PREF) but it does not work. If I assign (where pref = "100") or any other value it works fine.
Is it to do with sessions or to store the value in a variable prior to authorization of the page. Please notify.
DECLARE
v_userrole VARCHAR2 (400) DEFAULT NULL;
v_staffaccess VARCHAR2 (400) DEFAULT NULL;
BEGIN
Select USER_ROLE IN v_userrole
to userrole
where (upper (USER_LOGIN) = upper(:APP_USER)
or (upper (:APP_USER)) = 'TEST');
Select staff_access in the v_staffaccess of sm
where pref = "P2_PREF";
IF INSTR (v_userrole, 'A') > 0
THEN
RETURN TRUE;
END IF;
IF (((v_userrole) = "SP" OR (v_userrole) = 'U') and nvl (upper (v_staffaccess), 'x') do not ("SUPER %')) THEN)
RETURN TRUE;
ELSE RETURN FALSE;
END IF;
END;
Please advise on the passage of the value.
Thank you very much
Harinder
Hi Harinder
There are many ways this can be achieved. It seems to me that your problem is that the value passed to page 2 is not be updated at each visit?
So how about this (as only one way to do it).
Page 1 to P1_PREF
You press a button or link to go to page 2, that SUPPORTS THE PAGE (important)
You have a hidden item P2_PREF on page2, who has...
Source used - always replace any existing value in session state
Source - point Type
And then refer to P1_PREF.
Or you can create a calculation that sets the value of P2_PREF to the value of P2_PREF on the laundry front header.
Or your button on page 1 could create a branch to page 2 using "defined these elements" "with these values" options in the industry...
See you soon
Ben
Tags: Database
Similar Questions
-
function to return a Boolean value with application of harvesters and validation
Ask yourself how you would combine a query and set condition...
At this moment I have a calculation that would make a simple sql query.
and in my posting, I would use a function returns boolean appeal the result of the calculation to do some if statements
ask yourself how you would combine both to validation? (I tried to paste in the validation, but it doesn't seem to work).
Select count(NAME_ID) FROM table WHERE to_char(NAME_ID) = :P1_NAME_ID; IF :P1_results = 1 THEN RETURN TRUE; END IF; RETURN FALSE;
OK, so does this work for you as your article validation; P1_NAME_ID ?
DECLARE l_rowcount PLS_INTEGER; BEGIN SELECT COUNT (name_id) INTO l_rowcount FROM my_table WHERE TO_CHAR (name_id) = :P1_NAME_ID; IF l_rowcount = 1 THEN RETURN TRUE; ELSE RETURN FALSE; END IF; END;
Jeff
-
Problem when calling a return function of SQL BOOLEAN in package type
Hi all
I'm having a problem when you try to call a SQL function in a package with the return BOOLEAN type
The SQL function signature is
####
CREATE OR REPLACE PACKAGE RMSOWNER. ORDER_ATTRIB_SQL *.
FUNCTION GET_PO_TYPE_DESC (O_error_message IN OUT VARCHAR2,
I_PO_TYPE IN VARCHAR2,
O_PO_TYPE_DESC IN OUT VARCHAR2)
RETURN A BOOLEAN VALUE;
####
Here is my java code
####
+ Cs3 CallableStatement = conn.prepareCall ("{?}") = call ORDER_ATTRIB_SQL. GET_PO_TYPE_DESC(?,?,?)} ");" +
+ CS3.registerOutParameter (1, java.sql.Types.BOOLEAN) +;
+ CS3.registerOutParameter (2, java.sql.Types.VARCHAR) +;
+ CS3.registerOutParameter (4, java.sql.Types.VARCHAR) +;
+ CS3. SetString (2, ""); +
+ CS3. SetString (3, "ST"); +
+ CS3. SetString (4, ""); +
+ ResultSet rs3 = cs3.executeQuery (); +
####
I get the following exception, I tried to change the (registerOutParameter) boolean sql type bit, but I've always found this exception.
But when I call all other functions with a return type other than boolean, they work perfectly well.
Please can someone help me solve this problem, I don't know if its something to do with classes of JDBC providers?
#####
+ java.sql.SQLException: ORA-06550: line 1, column 13: +.
+ PLS-00382: expression is of the wrong type.
+ ORA-06550: line 1, column 7: +.
+ PL/SQL: statement ignored +.
+ oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112) +.
+ oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331) +.
+ oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288) +.
+ oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:743) +.
+ oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableStatement.java:215) +.
+ oracle.jdbc.driver.T4CCallableStatement.executeForRows(T4CCallableStatement.java:954) +.
+ oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1168) +.
+ oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3316) +.
+ oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3422) +.
+ oracle.jdbc.driver.OracleCallableStatement.execute(OracleCallableStatement.java:4394) +.
#####Looks like it's a Limitation of the jdbc drivers. Please visit the following link:
http://www-Camden.Rutgers.edu/help/documentation/Oracle/Java.815/a64684/typesup1.htmHere is an excerpt from above:
==========================================================
PL/SQL BOOLEAN, RECORD and the Types of TABLES of packingOracle JDBC drivers support the argument of appeal or return values of PL/SQL TABLE types (now known as indexed arrays by), REGISTRATION or BOOLEAN.
To work around the problem, you can create wrapper procedures that manage data like types supported by JDBC. For example, to wrap a stored procedure that uses PL/SQL Boolean values, you can create a stored procedure that takes a character or a number of JDBC and passes to the original procedure as BOOLEAN or, for an output parameter, accepts a BOOLEAN of the original procedure argument and pass it as a TANK or a NUMBER to JDBC. Similarly, to wrap a stored procedure that uses PL/SQL records, you can create a stored procedure that maintains a record in its individual components (such as CHAR and NUMBER). To wrap a stored procedure that uses PL/SQL tables, you can divide the data into components or perhaps use Oracle collection types.
-
Go to a function that returns a Boolean
Short version of the question: Boolean values can be returned by a pl/sql function?
I've implemented a short function which returns a Boolean value; When I compile it I get an error:
Error report:
ORA-06550: line 5, column 32:
PLS-00382: expression is of the wrong type
ORA-06550: line 6, column 4:
PLS-00306: wrong number or types of arguments in the call to "PUT_LINE '.
ORA-06550: line 6, column 4:
PL/SQL: Statement ignored
06550 00000 - "line %s, column % s:\n%s".
* Cause: Usually a PL/SQL compilation error.
* Action:
The closest, I appealed
RETURN sys.diutil.bool_to_int (< foo >);
and then a caller script can call
sys.diutil .int_to_bool (< bar >);
at least this way there is no verification of the Boolean value of 'manual '. Is it really the only way to return / call a Boolean?
Thank you
Chris
EDIT
I was aware of the fact I had not provided examples of code - and was just one question fairly open. I hope that this example will show what does not work!
I have a function that returns a Boolean value:
create or replace
FUNCTION myFunc (s_in IN VARCHAR2) RETURN a Boolean value
IS
s_out BOOLEAN: = TRUE;
BEGIN
RETURN s_out;
END FUNCTION3;
I try and call the function in the following script:
DECLARE
s_in varchar2 (20): = "Hello";
s_out boolean;
BEGIN
SELECT myfunction (s_in) INTO s_out FROM DUAL;
END;
That's when I get the error. But sorry, I was looking for too many error messages! I have worked that the one I posted above is because put_line can accept only strings and numbers not Boolean, the mistake that this function returns is:
ORA-06550: line 5, column 32:
PLS-00382: expression is of the wrong type
ORA-06550: line 5, column 11:
PLS-00382: expression is of the wrong type
06550 00000 - "line %s, column % s:\n%s".
* Cause: Usually a PL/SQL compilation error.
* Action:
However, I suppose that the comment of Frank Kulash is perhaps the reason why I see this?
Post edited by: 2922851
Hi, Chris,.
2922851 wrote:
Short version of the question: Boolean values can be returned by a pl/sql function?
Sure. If you are having problems, post your code (both the function and some PL/SQL that calls it).
The BOOLEAN data type exists only in PL/SQL, not in SQL, so if the function returns a BOOLEAN value, then you can't call it in a SQL statement, even if this SQL statement is used within PL/SQL. For this reason, a lot of guys write functions that return a NUMBER (1 or 0) or a string (' t ' or 'F') rather than return a BOOLEAN value.
I've implemented a short function which returns a Boolean value; When I compile it I get an error:
Error report:
ORA-06550: line 5, column 32:
PLS-00382: expression is of the wrong type
ORA-06550: line 6, column 4:
PLS-00306: wrong number or types of arguments in the call to "PUT_LINE '.
ORA-06550: line 6, column 4:
PL/SQL: Statement ignored
06550 00000 - "line %s, column % s:\n%s".
* Cause: Usually a PL/SQL compilation error.
* Action:
This error indicates a problem calling put_line; It has nothing to do with what returns the function.
-
Function call that returns BOOLEAN
Hello
Could you suggest on below:
21 d
I call the existing function that returns a Boolean value (TRUE/FALSE), in my new code.
part of the new code should run only when the output more is true.
is logic below... right?
XX_TND_OUT is the existing function
=======================
IF (in_prod_id) XX_TND_OUT = TRUE
THEN
.. . Run my code
END IF;
Thank you.Be Boolean you can directly compare the function
IF XX_TND_OUT (in_prod_id) THEN ......execute my code END IF;
That is to say:
DECLARE FUNCTION iseven (num INTEGER) RETURN BOOLEAN IS BEGIN IF MOD (num, 2) = 0 THEN RETURN TRUE; ELSE RETURN FALSE; END IF; END iseven; BEGIN FOR i IN 1 .. 10 LOOP IF iseven (i) THEN DBMS_OUTPUT.put_line (i || ' is even'); ELSE DBMS_OUTPUT.put_line (i || ' is odd'); END IF; END LOOP; END; / 1 is odd 2 is even 3 is odd 4 is even 5 is odd 6 is even 7 is odd 8 is even 9 is odd 10 is even
Kind regards.
Al -
Hey guys,.
I'm using version 4.2.6 apex. The theme is 26.
IM also using Listener Oracle APEX.
I can print my classic report in PDF or CSV format.
But I need to export it as a .xls extension.
Report type: SQL (body of function from PL/SQL returning the SQL) query
I need is like this cause my 'where' clause type is dynamic.
Look at using this method: Tom's Blog: a non-standard export excel 2010 (.xlsx)
I do something similar for downloads to excel in my projects...
Thank you
Tony Miller
Software LuvMuffin
Ruckersville, WILL -
How to the return type of function from PL/SQL
Hello
I need to create a function that returns a list of ID, which is stored in a type T_IDs, something like:
search function (searchstring in varchar2) return to T_IDs
I have a little problem with the type within the body of the function using a select statement and filling
Select the id of the table where the text as searchstring.
which is to select a list of IDS corresponding to the where clause. Is it possible to use select in or should I go for another mechanism?
Thanks for all the ideas.Bulk Collect works for me...
SQL> create type t_ids as table of number; 2 / Type created. SQL> ed Wrote file afiedt.buf 1 create or replace function get_ids(deptno in number) return t_ids is 2 ids t_ids; 3 begin 4 select empno 5 bulk collect into ids 6 from emp 7 where deptno = get_ids.deptno; 8 return ids; 9* end; SQL> / Function created. SQL> select * from table(get_ids(10)); COLUMN_VALUE ------------ 7782 7839 7934
However, I would rarely use such a data collection, as it fills with PGA in memory and passing a lot of data between SQL and PL/SQL. I must have a just cause and justified in wanting to do things this way.
-
SQL (body of function from PL/SQL returning the SQL) query when you use to_char
We are trying to build a page of Type SQL Query report (body of function from PL/SQL returning SQL query).
our request is simple, to extract the month of the column recording_date.
declare
l_query varchar2 (1000);
Start
l_query: = 'select to_char (recording_date, 'MM') of re_productive;
Return l_query;
end;
but we would like the following for this query problem
Function returning SQL query: query cannot be parsed in the generator. If you believe that your query is syntactically correct, check the box of generic columns below the source of the region without analysis.
(ORA-06550: line 4, column 42: PLS-00103: encountered the symbol "MY" what awaits one of the following values:.) (* @ % & = - +; <>/ at is mod remains not rem <>or! = or ~ = > = < = <>and or as between | multiset Member SUBMULTISET_ the symbol ".") was inserted before 'MY' to continue.)
Notes:
1 - the request is correct and it has been tested under sqlplus and toad.
2. we tried option use generic name (analysis of query runtime only) column, but we get the same problem.
any quick help please.Hello
You have not escaped your quote in the string. Try this...
DECLARE l_query VARCHAR2(32767); BEGIN l_query:= 'select to_char(recording_date,''MM'') from re_productive'; RETURN l_query; END;
See you soon
Ben
-
convert the data in the Format of Date imported from MS SQL Server.
I imported data from MS SQL Server. The column 'Date' received in digital format as 41017.6361109954. How can I convert Date in Oracle SQL.
If I import the same data in Excel and you change the Type of column to this day. He passes. But in Oracle, I tried the To_Date function with different parameters, but it did not work.
Published by: XAVER 22 April 2012 02:31select timestamp '1970-01-01 00:00:00' + numtodsinterval(41017.6361109954,'day') from dual; TIMESTAMP'1970-01-0100:00:00'+NUMTODSINTERVAL(41017.6361109954,'DAY') --------------------------------------------------------------------------- 20-APR-82 03.15.59.990002560 PM SQL>
SY.
-
Metadata from MS SQL to Oracle table
Hi gurus!
Is it possible using ODI create a table target on Oracle using metadata from MS SQL?
I can reverse-engineer for MS SQL table and put it as a source in the interface and ODI will use this information and create the table on Oracle workflow.
Create the target table as an array of streams to 1:1 with the Oracle data types?
Thanks in advance!You mean that target tables are also Oracle.
Yes, this can be done. In integration KM (IKM), there is a CREATE_TARG_TABLE option. You can set this Yes. And your target table will be created from the data model if it does not exist.Following steps should be useful:
1.) reverse schema SQL Server in a model.
2.) duplicate this model and changes in Oracle technology. (This will map the data types of MSSQL to Oracle)
3.) use the Oracle based model/data store like target and use any IKM who has the CREATE_TARG_TABLE option. -
confusion on the stats from v$ sql
I'm trying to increase the performance of a quarter of the exadata machine rack and uses the table v$ sql to see what questions the front-end application is generating (done automatically) and sending it to oracle. I question the table v$ sql like this:
select sql_id, io_cell_offload_eligible_bytes qualifying, io_cell_offload_returned_bytes actual, round(((io_cell_offload_eligible_bytes - io_cell_offload_returned_bytes)/nullif(io_cell_offload_eligible_bytes,0))*100, 2) io_saved_pct, elapsed_time/1000000, first_load_time, application_wait_time/1000000, concurrency_wait_time/1000000, user_io_wait_time/1000000, plsql_exec_time/1000000, java_exec_time/1000000, cpu_time/1000000, rows_processed, sql_fulltext, sql_text from v$sql where io_cell_offload_returned_bytes > 0 and instr(sql_text, 'D1') > 0 and parsing_schema_name = 'DMSN' order by --(round(((io_cell_offload_eligible_bytes - io_cell_offload_returned_bytes)/nullif(io_cell_offload_eligible_bytes,0))*100, 2)) asc elapsed_time/1000000 DESC
Whats confusing for me, is that I see a row of the table like this:
SQL_ID QUALIFYING STAGE REAL IO_SAVED_PCT ELAPSED_TIME/1000000 FIRST_LOAD_TIME APPLICATION_WAIT_TIME/1000000 CONCURRENCY_WAIT_TIME/1000000 USER_IO_WAIT_TIME/1000000 PLSQL_EXEC_TIME/1000000 JAVA_EXEC_TIME/1000000 CPU_TIME/1000000 ROWS_PROCESSED SQL_FULLTEXT bvmtg9n1bss3r 181485174784 120788774976 33.44 5168.205681 2013-07-26/11: 42:53 5.481132 0.113112 3773.585818 0 0 1429.028 102401297 (HUGECLOB) 44y4dvhb12zc0 330356482048 110817408 99.97 3472.110958 2013-07-29/10: 11:35 2.359406 0.128388 3447.086174 0 0 21.973 275 (HUGECLOB) fssqzqq0tsffq 428624363520 7205116688 98,32 3099.086997 2013-07-20: 20: 51:28 0.058573 0.073064 2686.077653 0 0 361.081 40107806 (HUGECLOB) gyy3tk70t5h69 83012501504 70481653440 15.1 3050.021479 2013-08-01/10: 49:44 2.661973 0.000609 279.596557 0 0 2942.207 43649621 (HUGECLOB) fxazp767kzcan 3645325312 6389645208 -75.28 1477.232161 2013-08-05-09: 17:14 0.080002 0.000268 1374.649241 0 0 83.69 754293 (HUGECLOB) 0229k7cwq33aq 51346874368 3062262552 94.04 804.351766 2013-08-02/16: 01:34 1.880049 0,0019 693.156814 0 0 108.625 2005797 (HUGECLOB) the elapsed times are very long and my understanding is that it is the operating time from end to end for queries, is that correct.
But when I run these queries into a toad, the results come back in about a minute or two.
I have also noticed that most of the time is divided between USER_IO_WAIT_TIME and CPU_TIME, I think I understand what is CPU_TIME, but I wasn't quite able to understand what USER_IO_WAIT_TIME is the online documentation.
My question is, the elapsed time is really the end of the query execution time? If so, why do I see CBI? genetically different times when run the queries in Toad manually?
SELECT ELAPSED_TIME/EXECUTIONS AVG IN V$ SQL;
because elapsed_time is a cumulative value
-
Very CONFUSED about invalidation and last_load_time from v$ sql.
Hi all.
I'm very confused on the definitions of column of v$ sql.
The oracle is envirenment 10.2.0.4 RAC 3-node.
The following comes from gv$ sql.
--------------
INST_ID select sql_id, child_number out.
hash_value, plan_hash_value,
first_load_time, last_load_time, loads, invalidations
SGS $ t sql
where 1 = 1
and sql_id = "5hnvqby4tyvt9."
/
1 5hnvqby4tyvt9 0 2308927273 1898129466 2011-07-17/07: 45:00 2011-07-17/07: 45:00 1-0
2 5hnvqby4tyvt9 0 2308927273 1898129466 2011-07-17/07: 51:18 2011-07-25/06: 9 1 30:07
---------------
1. no changes are object-definition related to the tables in the query of '5hnvqby4tyvt9 '.
2. currently, the sql in the nodes 1 and 2 has the same PLAN_HASH_VALUE.
3. in nodes 1 and 2, the sql has been loaded in the library cache,
2011-07-17/07: 45:00 and 2011-07-17/07: 51:18 respectively.
4. However, last_load_time differs from the other.
-the node 1: last_load_time is ' 2011-07-17/07: 45:00 ' and invalidations is 0.
-node 2: last_load_time's ' 2011-07-25/06: 30:07 ' and invalidations is 9.
---------------
My question is:
1. What is the difference in last_load_time between node 1 and node 2?
2. What is the difference made in disqualifications between node 1 and node 2?
3 I know, that when it changed the definition of table, sql cursor becomes invalid.
However, there was no change in the definitions of the query table.
What could make a child cursor in the cache library not valid?
4. According to the manual of oracle
(http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/dynviews_2113.htm#REFRN30246),
LAST_LOAD_TIME means 'time in which the query plan (memory segment 6) has been loaded in the library cache'
However, the plan_hash_value 1-node and node-2 has the same value,
even if the child in node-2 sql cursor has been re-charge 9 times since the first loading in the library cache.
What it means?
------
Thanks in advance.
Best regards.869578 wrote:
parts of the cursor (mainly the lot 6, the execution plan) can age due to pressure of space
When 'PARTS' of a cursor has become aged because of the pressure of space,
It increases the number of invalidation count(v$sql)?Yes.
In addition, in the case above (parts of a cursor have become aged because of the pressure of space in the library cache),
the update of last_load_time(v$sql) does not always mean "sql plan of change."Is this good?
Hmmm, let me think for a moment. I think it's always true when we see invalidations, it's the SQL Plan, which has been invalidated. This is not to say that the plan changed, however. You could get a plan struck down for trivial reasons, say, a grant or revoke them on a table. After that, on reload, the plan that is generated can be identical to the regime that had just been invalidated.
Hope that helps,
-Mark
-
Formatting excel generated from PL/SQL
Hello
My requirement is to generate an excel from PL/SQL, which I was able to do in the code next Sanjeev. I was able to generate an excel, but the data in the cells were all in the format 'general' I want to date formatted as currency as "currency" and "date".
I have looked further and landed on the piece of code following
< cell > < data ss:Type = "DateTime" > 1928-06-25 T 00: 00:00.000 < / Data > < / cell >
But even this was not useful.
Can someone help me with this? Can this be achieved?
Thank you
MuraliHello Murali,
I don't know if the Sanjeevs package allows a custom cell formatting, but you can use others like
https://XML-spreadsheet.SampleCode.Oracle.com/ or
https://exceldocumenttype.SampleCode.Oracle.com/Concerning
Marcus -
Export data in Excel from pl/sql
can someone please give me some code examples on how to export data from pl/sql to excelNo, it's the problem. Oracle is unable to see the client directories (and it shouldn't). UTL_FILE works only in the directories of the server.
Concerning
Marcus -
Calling web services from PL/SQL
Hello
We have a requirement where we need to call a WebService from PL/SQL.
I believe that we have an API of PL/SQL, which allows you to use external web services.
I was looking for other possible options as to consume the web Service of PL/SQL.
The one you suggest other options, and what option is best to consume the web service.
Thank you
ABHello
I used the http of the utl package.
Apart from this you can also use java stored procedure. I haven't used this approach, but I found a blog for the same:http://technology.AMIS.nl/Blog/348/consuming-Web-services-from-PLSQL-part-i-using-Java-stored-procedures
Kind regards
Ketan
Maybe you are looking for
-
How to recover files after pressing Ctrl z
transfer pictures to a file from my sd card. then in the file a paste all the photos I press control z and they all went trying to search everywhere but I can't find them.
-
Where Thunderbird to save contacts and emails and can change somewhere else?
I am running Ubuntu LTS 14.04
-
I would like to know what SATA type is implemented in my PC ref: Pavilion Elite HPE-020fr. is it possible to improve it with a such SSD: Crucial M500 CT960M500SSD1 Flash SSD drive internal 2.5 "SATA III 960 GB Marvell controller? Thank you. TA26
-
No sound in my headphones on the Satellite A200 - 22 c
I have a toshiba Satellite A200 - 22 c with Realtek HD driver 5.10.00.5296, DirectX 9 .0c and ALC268 codec.I have nice sound in my speakers, but when I conect my headphones, the sound does not pass by them.The headset works OK in the other PC. Can yo
-
Update the hotline for windows 7
What a waste. Tried to get through to them since 02:00 this morning. Their phone 18884470150 for using windows 7 is worthless. Never buy a HP machine again. Operators shall not even you, they just push buttons to transfer and do not say a work, n