Trying to pass array to stored procedure in a loop using bind variable
All,
I'm having trouble figuring out if I can do the following:
I have a stored procedure as follows:
create procedure enque_f826_utility_q (inpayload IN f826_utility_payload, msgid out RAW) is
enqopt dbms_aq.enqueue_options_t;
mprop dbms_aq.message_properties_t;
begin
dbms_aq.enqueue(queue_name=>'f826_utility_queue',
enqueue_options=>enqopt,
message_properties=>mprop,
payload=>inpayload,
msgid=>msgid);
end;
The above compiles cleanly.
The first parameter "inpayload" a database type something like the following:
create or replace type f826_utility_payload as object
2 (
3 YEAR NUMBER(4,0),
4 MONTH NUMBER(2,0),
83 MUSTHAVE CHAR(1)
84 );
I'd like to call the stored procedure enque_f826_utility_q in a loop passing to it
each time, new values in the inpayload parameter.
My questions are:
First, I'm not sure in php, how to construct the first parameter which is a database type.
Can I just make an associative array variable with the keys of the array the same as the columns of the database type shown above and then pass that array to the stored procedure?
Second, is it possible to parse a statement that calls the enque_f826_utility_q procedure using bind variables and then execute the call to the stored procedure in a loop passing new bind variables each time?
I've tried something like the following but it's not working:
$conn = oci_pconnect (....);
$stmt = "select * from f826_utility";
$stid = oci_parse($conn, $sqlstmt);
$r = oci_execute($stid, OCI_DEFAULT);
$row = array();
$msgid = "";
$enqstmt = "call enque_f826_utility_q(:RID,:MID)";
$enqstid = oci_parse($conn, $sqlstmt);
oci_bind_by_name($enqstid, ":RID", $row); /* line 57 */
oci_bind_by_name($enqstid, ":MID", $msgid);
while ($row = oci_fetch_array($stid, OCI_RETURN_NULLS+OCI_ASSOC))
++$rowcnt;
if (! oci_execute($enqstid)) /* line 65 */
echo "Error";
exit;
When I run this, I get the following:
PHP Notice: Array to string conversion in C:\Temp\enqueue_f826_utility.php on l
ine 57
Entering loop to process records from F826_UTIITY table
PHP Notice: Array to string conversion in C:\Temp\enqueue_f826_utility.php on l
ine 65
PHP Warning: oci_execute(): ORA-06553: PLS-306: wrong number or types of argume
nts in call to 'ENQUE_F826_UTILITY_Q' in C:\Temp\enqueue_f826_utility.php on lin
e 65
PHP Notice: Undefined variable: msgnum in C:\Temp\enqueue_f826_utility.php on l
ine 68
Error during oci_execute of statement select * from F826_UTILITY
Exiting!
Thanks for the reply.
I took a look at this article. What it appears to describe is
a calling a stored procedure that takes a collection type which is an array.
Does anyone from Oracle know if I can pass other database type definitions to a stored procedure from PHP?
I have a type defined in my database similar to the following which is not
an array but a record of various fields. This type corresponds to a payload
of an advanced queue payload type. I have a stored procedure which will take as it's input, a payload type of this structure and then enqueue it to a queue.
So I want to be able to pass a database type similar to the following type definition from within PHP. Can anyone from Oracle verify whether or not this is possible?
create or replace type f826_utility_payload as object
YEAR NUMBER(4,0),
MONTH NUMBER(2,0),
UTILITY_ID NUMBER(10,0),
SUBMIT_FAIL_BY VARCHAR2(30),
MUSTHAVE CHAR(1)
);
Similar Messages
-
ORA-00932 when trying to pass ARRAY from Java SP to PL/SQL
Hi all
I am trying to pass ARRAYs back and forth between PL/SQL and Java stored procedures. But I keep getting:
ORA-00932: inconsistent datatypes: expected a return value that is an instance of a user defined Java class convertible to an Oracle type got an object that could not be converted
Here's my PL/SQL:
create or replace type CONTENTP.sentences_array as VARRAY(1000) of CLOB
-- I've also tried .. as TABLE of CLOB and varray/table of VARCHAR2
declare
proc_clob CLOB;
arr SENTENCES_ARRAY;
begin
SELECT document_body
into proc_clob
from documents
where document_id = 618784;
arr := processdocument.sentencesplit (proc_clob);
end;
PROCESSDOCUMENT package definition:
CREATE OR REPLACE PACKAGE CONTENTP.PROCESSDOCUMENT AS
FUNCTION sentenceSplit(Param1 CLOB)
return SENTENCES_ARRAY
AS
LANGUAGE java
NAME 'com.contentp.documents.ProcessDocument.sentenceSplit(oracle.sql.CLOB) return oracle.sql.ARRAY';
FUNCTION removeHTML(Param1 CLOB)
return CLOB
AS
LANGUAGE java
NAME 'com.contentp.documents.ProcessDocument.removeHTML(oracle.sql.CLOB) return oracle.sql.CLOB';
end;
Java sentenceSplit code:
public static oracle.sql.ARRAY sentenceSplit ( CLOB text) throws IOException, SQLException
Connection conn = new OracleDriver().defaultConnection();
String[] arrSentences = sent.getsentences ( CLOBtoString (text) );
ArrayDescriptor arrayDesc =
ArrayDescriptor.createDescriptor ("SENTENCES_ARRAY", conn);
ARRAY ARRSentences = new ARRAY (arrayDesc, conn, arrSentences);
return ARRSentences;
I have confirmed that the String[] arrSentences contains a valid string array. So the problem seems to be the creation and passing of ARRSentences.
I have looked at pages and pages of documents and example code, and can't see anything wrong with my declaration of ARRSentences. I'm at a loss to explain what's wrong.
Thanks in advance - any help is much appreciated!I am trying to do something similar but seems like getting stuck at registerOutParameter for this.
Type definition:
CREATE OR REPLACE
type APL_CCAM9.VARCHARARRAY as table of VARCHAR2(100)
Java Stored Function code:
public static ARRAY fetchData (ARRAY originAreaCds, ARRAY serviceCds, ARRAY vvpcs) {
Connection connection = null;
ARRAY array = null;
try {
connection = new OracleDriver ().defaultConnection();
connection.setAutoCommit(false);
ArrayDescriptor adString = ArrayDescriptor.createDescriptor("VARCHARARRAY", connection);
String[] result = new String [2];
result[0] = "Foo";
result[1] = "Foo1";
array = new ARRAY (adString, connection, result);
connection.commit ();
return array;
} catch (SQLException sqlexp) {
try {
connection.rollback();
} catch (SQLException exp) {
return array;
Oracle Stored Function:
function FETCH_TRADE_DYN_DATA (AREA_CDS IN VARCHARARRAY, SERVICE_CDS IN VARCHARARRAY,VV_CDS IN VARCHARARRAY) return VARCHARARRAY AS LANGUAGE JAVA NAME 'com.apl.ccam.oracle.js.dalc.TDynAllocation.fetchData (oracle.sql.ARRAY, oracle.sql.ARRAY, oracle.sql.ARRAY) return oracle.sql.ARRAY';
Java Code calling Oracle Stored Procedure:
ocs = (OracleCallableStatement) oraconn.prepareCall(queryBuf.toString());
ArrayDescriptor adString = ArrayDescriptor.createDescriptor("VARCHARARRAY", oraconn);
String[] originAreaCds = sTDynAllocationVO.getGeogAreaCds();
ARRAY areaCdArray = new ARRAY (adString, oraconn, originAreaCds);
ocs.registerOutParameter(1, OracleTypes.ARRAY);
ocs.setArray (2, areaCdArray);
String[] serviceCds = sTDynAllocationVO.getServiceCds();
ARRAY serviceCdsArray = new ARRAY (adString, oraconn, serviceCds );
ocs.setArray (3, serviceCdsArray);
String[] vvpcs = sTDynAllocationVO.getVesselVoyagePortCdCallNbrs();
ARRAY vvpcsArray = new ARRAY (adString, oraconn, vvpcs);
ocs.setArray (4, vvpcsArray);
ocs.execute();
ARRAY results = ocs.getARRAY(1);
Error I get:
Parameter Type Conflict: sqlType=2003
Thanks for help in advance. -
Size limitation that can be passed to Java stored procedure
Hello!
I enjoy using Oracle8i these days. But I have some questions
about Java stored procedure. I want to pass the XML data to Java
stored procedure as IN parameter. But I got some errors when the
data size is long. Is there any limitation in the data size that
can be passed to Java stored procedure?
Would you please help me ?
This message is long, but would you please read my message?
Contents
1. Outline : I write what I want to do and the error message I
got
2. About the data size boundary: I write about the boundary
size. I found that it depend on which calling sequence I use.
3. The source code of the Java stored procedure
4. The source code of the Java code that call the Java stored
procedure
5. The call spec
6. Environment
1.Outline
I want to pass the XML data to Java stored procedure. But I got
some errors when the data size is long. The error message I got
is below.
[ Error messages and stack trace ]
java.sql.SQLException: ORA-01460: unimplemented or unreasonable
conversion reque
sted
java.sql.SQLException: ORA-01460: unimplemented or unreasonable
conversion reque
sted
at oracle.jdbc.ttc7.TTIoer.processError(Compiled Code)
at oracle.jdbc.ttc7.Oall7.receive(Compiled Code)
at oracle.jdbc.ttc7.TTC7Protocol.doOall7(Compiled Code)
at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch
(TTC7Protocol.java:721
at oracle.jdbc.driver.OracleStatement.doExecuteOther
(Compiled Code)
at oracle.jdbc.driver.OracleStatement.doExecuteWithBatch
(Compiled Code)
at oracle.jdbc.driver.OracleStatement.doExecute(Compiled
Code)
at
oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(Compiled
Code
at
oracle.jdbc.driver.OraclePreparedStatement.executeUpdate
(OraclePrepar
edStatement.java:256)
at oracle.jdbc.driver.OraclePreparedStatement.execute
(OraclePreparedStat
ement.java:273)
at javaSp.javaSpTestMain.sample_test
(javaSpTestMain.java:37)
at javaSp.javaSpTestMain.main(javaSpTestMain.java:72)
2. About the data size boundary
I don|ft know the boundary that I got errors exactly, but I
found that the boundary will be changed if I use |gprepareCall("
CALL insertData(?)");|h or |gprepareCall ("begin insertData
(?); end ;")|h.
When I use |gprepareCall(" CALL insertData(?)".
The data size 3931 byte --- No Error
The data size 4045 byte --- Error
Whne I use prepareCall ("begin insertData(?); end ;")
The data size 32612 byte --No Error
The data size 32692 byte --- Error
3. The source code of the Java stored procedure
public class javaSpBytesSample {
public javaSpBytesSample() {
public static int insertData( byte[] xmlDataBytes ) throws
SQLException{
int oraCode =0;
String xmlData = new String(xmlDataBytes);
try{
Connection l_connection; //Database Connection Object
//parse XML Data
dits_parser dp = new dits_parser(xmlData);
//Get data num
int datanum = dp.getElementNum("name");
//insesrt the data
PreparedStatement l_stmt;
for( int i = 0; i < datanum; i++ ){
l_stmt = l_connection.prepareStatement("INSERT INTO test
" +
"(LPID, NAME, SEX) " +
"values(?, ?, ?)");
l_stmt.setString(1,"LIPD_null");
l_stmt.setString(2,dp.getElemntValueByTagName("name",i));
l_stmt.setString(3,dp.getElemntValueByTagName("sex",i));
l_stmt.execute();
l_stmt.close(); //Close the Statement
l_stmt = l_connection.prepareStatement("COMMIT"); //
Commit the changes
l_stmt.execute();
l_stmt.close(); //Close the Statement l_stmt.execute
(); // Execute the Statement
catch(SQLException e ){
System.out.println(e.toString());
return(e.getErrorCode());
return(oraCode);
4. The source code of the Java code that call the Java stored
procedure
public static void sample_test(int num) {
//make data
Patient p = new Patient();
byte[] xmlData = p.generateXMLData(num);
try{
// Load the Oracle JDBC driver
DriverManager.registerDriver(new
oracle.jdbc.driver.OracleDriver());
Connection m_connection = DriverManager.getConnection
("jdbc:oracle:thin:@max:1521:test",
"testuser", "testuser");
CallableStatement l_stmt =
// m_connection.prepareCall(" CALL insertData(?)");
m_connection.prepareCall("begin insertData(?); end
l_stmt.setBytes(1,xmlData);
l_stmt.execute();
l_stmt.close();
System.out.println("SUCCESS to insert data");
catch(SQLException e ){
System.out.println( e.toString());
e.printStackTrace();
5. The call spec
CREATE OR REPLACE PROCEDURE insertData( xmlData IN LONG RAW)
AS
LANGUAGE JAVA NAME 'javaSp.javaSpBytesSample.insertData(byte[])';
6. Environment
OS: Windows NT 4.0 SP3
RDBMS: Oracle 8i Enterprise Edition Release 8.1.5.0.0 for
Windows NT
JDBC Driver: Oracle JDBC Drivers 8.1.5.0.0.
JVM: Java1.1.6_Borland ( The test program that call Java stored
procedure run on this Java VM)
nullIam passing an array of objects from Java to the C
file. The total size of data that Iam sending is
around 1GB. I have to load this data into the Shared
memory after getting it in my C file. Iam working on
HP-UX (64-bit). Everything works fine for around 400MB
of data. When I try to send around 500MB of data, the
disk utilization becomes 100%, so does my memory
utilization and I get a "Not enough space" when I try
to access shared memory. I have allocated nearly 2.5GB
in my SHMMAX variable. Also, I have around 45GB of
disk free. The JVM heap size is also at 2048MB. Where did you get the 400/500 number from? Is that the size of the file?
What do you do with the data? Are you doing nothing but copying it byte for byte into shared memory?
If yes then a simple test is to write a C application that does the same thing. If it has problems then it means you have an environment problem.
If no then you are probably increasing the size of the data by creating a structure to hold it. How much overhead does that add to the size of the data? -
How to pass arry in stored procedure
I want to pass an array thru a JDBC to a stored procedure
how can i pass a java variable string array to the store procedure using JDBC.
here is my package for array:
CREATE OR REPLACE PACKAGE TABLE_TYPES
AS
TYPE tString IS TABLE OF VARCHAR2(10) INDEX BY BINARY_INTEGER;
END;
here is my store procedure:
CREATE OR REPLACE PROCEDURE Declassification
(P_COMPANY_ID IN SECURITY.COMPANY_ID%TYPE,
P_SECURITY_NAME IN SECURITY.SECURITY_NAME%TYPE,
P_SECURITY_SYMBOL IN SECURITY.SECURITY_SYMBOL%TYPE,
P_CURRENCY IN SECURITY.CURRENCY%TYPE,
P_ISIN IN SECURITY.ISIN%TYPE,
P_LISTING_DATE IN VARCHAR2,
P_SECTOR IN SECURITY.SECTOR%TYPE,
P_INDUSTRY IN SECURITY.INDUSTRY%TYPE,
P_PAR_VALUE IN VARCHAR2,
P_PAR_VALUE_AS_OF IN VARCHAR2,
P_BOARDLOT IN VARCHAR2,
P_BOARDLOT_AS_OF IN VARCHAR2,
P_MARKET_PRICE IN VARCHAR2,
P_REQD_PUBLIC_OWN_PERC IN VARCHAR2,
P_STATUS IN SECURITY.STATUS%TYPE,
P_SECURITIES IN Table_Types.tString,
P_ID OUT SECURITY.SECURITY_ID%TYPE)
AS
P_SECURITY_ID SECURITY.SECURITY_ID%TYPE;
rec_count NUMBER;
BEGIN
SELECT COUNT(*)
INTO rec_count
FROM SECURITY;
IF rec_count > 0 THEN
SELECT MAX(TO_NUMBER(security_id)) + 1
INTO P_SECURITY_ID
FROM SECURITY;
ELSE
P_SECURITY_ID:=1;
END IF;
INSERT INTO SECURITY
VALUES(P_SECURITY_ID, P_COMPANY_ID, P_SECURITY_NAME, P_SECURITY_SYMBOL, 'COMMON',
P_CURRENCY, P_ISIN, TO_DATE(P_LISTING_DATE,'mm/dd/yyyy'), P_SECTOR, P_INDUSTRY, TO_NUMBER(P_PAR_VALUE),
TO_DATE(P_PAR_VALUE_AS_OF,'MM/DD/YYYY'), TO_NUMBER(P_BOARDLOT), TO_DATE(P_BOARDLOT_AS_OF,'MM/DD/YYYY'),
TO_NUMBER(P_MARKET_PRICE), TO_NUMBER(P_REQD_PUBLIC_OWN_PERC), P_STATUS);
INSERT INTO SECURITY_FINANCIAL(SECURITY_ID)
VALUES (P_SECURITY_ID);
INSERT INTO SECURITY_TOTAL(SECURITY_ID)
VALUES (P_SECURITY_ID);
COMMIT;
END Declassification;I want to pass an array thru a JDBC to a stored
procedure
how can i pass a java variable string array to the
store procedure using JDBC.
here is my package for array:
CREATE OR REPLACE PACKAGE TABLE_TYPES
AS
TYPE tString IS TABLE OF VARCHAR2(10) INDEX BY
Y BINARY_INTEGER;
END;
There are two ways to pass in Arrays to stored procedures in Oracle:
1. Define an Oracle TYPE outside a package and then use oracle.sql.ARRAY and oracle.sql.ArrayDescriptor to explain to the driver how the array is structured. This is what Avi has shown how to do.
2. You can also pass in INDEX BY arrays of VARCHAR2 or NUMBER, provided they are indexed by BINARY_INTEGER. This is what you appear to want. In order to do this you'll probably need the 10g JDBC driver and code that uses the 'setPlsqlIndexTable' method of 'OraclePreparedStatement' to bind your array.
Be careful about the values you pass into the 'setPlsqlIndexTable' method. You have to specify in advance how much data you expect to get back and how long each row is. The driver allocates memory based on these numbers. You code also needs to cope with arrays that have null elements.
I work for a company that makes a JDBC code generator. A list of common situations we've encountered when working with Index By tables can be found here:
http://www.orindasoft.com/public/PL-SQL%20Recordstwo.php4?siteloc=PL-SQL%20Recordstwo#probix
David Rolfe
Orinda Software
Dublin, Ireland
www.orindasoft.com
Orinda Software makes OrindaBuild, which writes JDBC calls for PL/SQL and SQL. -
ARRAYS in stored procedures?
is it possible to have an ARRAY be passed as an In and/or Out
Parameter in a stored procedure call? if so then can someone
please show me how? (ie what do i register as the Out, etc.) or
do i have to use a resultset to access it?
nullArtie (guest) wrote:
: is it possible to have an ARRAY be passed as an In and/or Out
: Parameter in a stored procedure call? if so then can someone
: please show me how? (ie what do i register as the Out, etc.)
or
: do i have to use a resultset to access it?
Yes u can pass array to a procedure.
I have created a package that stores the array
definition, and the procedure by name abc which takes an array as
out parameter (script proc1.sql)
and the second script proc2.sql calls the procedure abc and
prints some result
/*File proc1.sql*/
/*IT creates the package T with the definition of array
and passes to the procedure*/
CREATE OR REPLACE PACKAGE T as
TYPE arr_type is table of number index by binary_integer;
test_array arr_type;
END;
CREATE OR REPLACE PROCEDURE abc(t OUT T.arr_type ) IS
begin
for i in 1..10
loop
t(i) := i ;
end loop;
end abc;
/*End of Program proc1.sql*/
/*Program proc2.sql*/
/*This file calls the procedure abc and prints the result*/
declare
test_array T.arr_type;
begin
abc(test_array);
for i in 1..10 loop
dbms_output.put_line('Result ' -
Passing parameter in stored procedure
Hi, I am really new to using Oracle stored procedure. I have just tested a sample stored proc which should return multiple rows without passing any parameter.
here is the stored proc I wrote
create or replace procedure get_address
as
cur_table sys_refcursor;
begin
open cur_table for
select * from address_table order by addr_id;
end;
when I execute it, I get a message "Procedure Created"
then I executed the stored proc
exec get_address;
I again get a message "PL/SQL procedure successfully completed" and I do not see the records at all.
so I decide to rewrite to the stored proc as such
create or replace procedure get_address(cur_table out sys_refcursor)
as
begin
open cur_table for
select * from address_table order by addr_id;
end;
everthing is good so far.
now when execute it
exec get_address;
I am getting the following error:
"PLS-00306: wrong number or types of arguments in call to 'TESTCODEPROC'"
I have searched so many places, but there is no document talks about this issue. I hope someone can help me to over come this. I need to call this stored proc from .NET 2.0 reporting viewer which is embedded in asp.net page.
Thank you.so I decide to rewrite to the stored proc as such
create or replace procedure get_address(cur_table out
sys_refcursor)
as
begin
open cur_table for
select * from address_table order by addr_id;
end;
everthing is good so far.
now when execute it
exec get_address;
I am getting the following error:
"PLS-00306: wrong number or types of arguments in
call to 'TESTCODEPROC'"
From what you wrote I can assume that you have used SQL server before. Oracle does not automatically return the last opened cursor from a stored procedure like the query result, so you cannot just call exec get_address; (or just execute the procedure from .NET code). You will have to pass the cursor parameter and fetch it as an output parameter value in .NET, then use it to get the data reader etc.
On the other hand, you can just execute the statement directly. I see a lot of folks coming from SQL server world using stored procedures like crazy even for things that are naturally suited to queries and views. Oracle view allows you to apply the same security restrictions you can put onto a stored procedure, and if you use statement caching and bound variables, you get precompilation benefits as well with a view. Using a view instead of a procedure in this case will require less code both in the database and in .NET, and will give you a more flexible interface in terms of retrieved columns and ordering.
gojko adzic
http://gojko.net -
Calling stored procedures with output parameters using RDO and VB
I have a simple test procedure defined as follows:
CREATE OR REPLACE PROCEDURE test_sp (inval1 IN VARCHAR2,
inval2 IN NUMBER, inval3 OUT VARCHAR2, inval4 OUT NUMBER) IS
BEGIN
inval3 := 'RETURN TEST';
inval4 := 10;
END;
I am attempting to call this procedure from VB 5.0 using RDO and the Oracle ODBC Driver 8.01.06:
dim rdoQd as rdoQuery
dim grdoCn as rdoConnection
strSQL = "{ call test_sp('SOMETHING',?,?,?) }"
Set rdoQd = grdoCn.CreateQuery("", strSQL)
rdoQd(0).Direction = rdParamInput
' get error# 40041 at above line
' "Object Collection: Couldn't ' find item indicated by text."
rdoQd(0).Type = rdTypeINTEGER
rdoQd(0).Value = 5
rdoQd(1).Direction = rdParamOutput
rdoQd(1).Type = rdTypeVARCHAR
rdoQd(2).Direction = rdParamOutput
rdoQd(2).Type = rdTypeINTEGER
Set rdoApp = rdoQd.OpenResultset()
MsgBox (CStr(rdoQd(1)))
MsgBox (CStr(rdoQd(2)))
When I run this VB code, I get the above mentioned error. If I use placeholders for all parameters (like "{ call test_sp (?,?,?,?) }" ), no error occurs.
I really need to use the first type of syntax from above and not have to use placeholders for all parameters. Is there a way to accomplish this?
TIA,
EstherAre you getting any warning while importing the stored procedure?
Please check the below datatypes:
While creating the stored procedure, if you have used varchar(MAX), please ALTER it to varchar(255) and reimport to DS.
Also, the datatype of $message (global variable or local variable) used inside DS should also be varchar(255)
Try a print statement in between.
ADMIN.DBO.SPJOBSUMMARY(69,$message,$rtCode,$rtVal);
print('Message is '||$message);
smtp_to('leighattest.com.au', 'Results of ' || job_name(), $rtCode || '//' || $rtVal || '~~' || $message || '//', 0,0);
and see in the job log if DS is able to retrieve the output from DB.
Regards,
Suneer -
How to use bind variables in this procedure
Hi Experts,
How to use bind variables in this procedure for static queries.
PROCEDURE DELETE_MER_PROC (M_id IN NUMBER)
IS
BEGIN
V_date DATE;
SELECT PD_DATE INTO v_date FROM PD_MAINTAIN;
DELETE FROM MER_CLEAR
WHERE MER_DT < v_date
AND ID = M_ID;
COMMIT;
END;
How to use v_date and m_id as bind variables in this procedure to avoid hard parsing.
Please help me.
Thanks.976208 wrote:
How to use v_date and m_id as bind variables in this procedure to avoid hard parsing.
You cannot avoid hard parsing - as the 1st time a SQL statement (like the SELECT or DELETE statements in your code) is encountered, it does not reside in the server's Shared Pool, and needs to be added into the pool via a hard parse.
Bind variables does not prevent hard parsing. Hard parsing happens when the SQL statement (with or without bind variables) is a brand new statement encountered by the server.
Bind variables enables the same SQL cursor to be reused, by simply changing the bind variable value.
Not using bind variables means that each SQL statement is unique and not shareable - as the value is hardcoded into the statement and cannot be changed via a bind value. This typically means LOTS of different SQL statements (where the only difference is the changed value in the statement) are created - with each statement being a new statement not seen before in the Shared Pool and needing to be hard parsed.
One does not design one's code not to be hard parsed. There ALWAYS will be a hard parse in order to get a SQL statement into the Shared Pool. One designs one's code to REUSE cursors in the Shared Pool. -
Using Parameterized Arrays in Stored Procedure
I tried following code to pass array value to stored procedure but its giving error, as I am new to this procedure, please advise what am I missing ?
Best Regards,
Luqman
My code is as below.
CREATE TYPE num_array AS table of number;
create or replace procedure give_me_an_array
( p_array in num_array )
as
begin
for i in 1 .. p_array.count
loop
dbms_output.put_line( p_array(i) );
end loop;
end give_me_an_array;
declare
mdata num_array;
begin
mdata(1) := 1234;
mdata(2) := 10;
give_me_an_array(mdata);
end;Hi Satya,
Now I got it, thanks,
Can you please advise, if I use the same stored procedure for EMP Table and use my array values to retrieve the selected EMPNo
I tried following but I could not succeed.
When I compile the stored procedure, error occurs:
"inconsistent datatypes: expected NUMBER got NUM_ARRAY"
for example:
CREATE TYPE NUM_ARRAY AS TABLE OF NUMBER;
Create or Replace Package TB_Data
Is Type CV_Type Is REF CURSOR;
END TB_DATA;
Create or Replace Stored Procedure give_me_an_array
(CV IN OUT TB_DATA.CV_TYPE,
MEmpNo In Num_Array)
Is
Begin
Open CV for
Select * from EMP
Where Empno in MEmpNo;
End myProc;
declare
mdata num_array:=num_array(7839,7844);
begin
give_me_an_array(mdata);
end;
Best Regards,
Luqman -
Pass Array to Database Procedure
Hi,
I've a JSP in which I can collect the parameters as array. I, then, want to pass on this array to a database prodecure/function. How can I do that.
I already have tried Steve's ArrayOfStringDomain example. (ArrayOfStringDomain) and it didn't work.
Can someone please help me.
Thanks,
JatinderHi Jatinder,
For information on passing an array to a stored procedure refer here.
Hope this helps.
Sujatha. -
Passing Values to Stored Procedure for "IN" Clause
Hello All:
I am trying to pass values to a stored procedure to use in an IN clause, and getting an "ORA-01722: invalid number".
I believe this has something to do with how .Net handles strings and how I am trying to pass it to my stored procedure.
The values I know need to be IN (2, 1) for the stored procedure to work, and I built a routine that creates a string value to pass in the format "2, 1", but I believe because this value is defined as a string in the .Net code, the leading and trailing apostrophe characters are causing the problem in the stored procedure.
I have in my .Net code the following:
oCommand.Parameters.Add("groupID_", OracleDbType.Varchar2).Value = GroupID;
Where GroupID is defined as a string character, and has values of the following: 2, 1, but due to how .net handles it, it passes as "2, 1".
So of course, inside my stored procedure,
CREATE OR REPLACE PROCEDURE PAYSOL.sp_ProjectsManAppAndFundRpt(
p_Cursor1 OUT SYS_REFCURSOR,
p_Cursor2 OUT SYS_REFCURSOR,
p_Cursor3 OUT SYS_REFCURSOR,
p_Cursor4 OUT SYS_REFCURSOR,
p_Cursor5 OUT SYS_REFCURSOR,
groupID_ IN VARCHAR2)
where I am defining the groupID_ parameter as a VARCHAR2, it is keeping the apostrophes, causing problems when I use it in my IN clause:
AND S.GroupID IN (groupID_)
What do I need to do to pass this value correctly? Is there something I can do inside the stored procedure to strip those characters, or do I need to pass it differently, or completely alter how I am handling this? I don't know the right path to head down, so wanted to seek some help.
Thanks
AndyIN Clauses and parameterized queries can be tricky beasts; so while logically it makes sense to do what you want (it does not do so in databases!)
you can handle this problem in a few ways:
1) anonymous sql (don't recommend)
2) a user defined type and function as such
--see http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:210612357425
--create a table of numbers ,create a function to split the "where" into a table
--then return the data
CREATE OR REPLACE type numberTableType as table of number;
create or replace function in_number( p_string in varchar2 ) return numberTableType AS
l_string long default p_string || ',';
l_data numberTableType := numberTableType();
l_number number ;
N NUMBER;
BEGIN
loop
exit when l_string is null;
n := instr( l_string, ',' );
l_data.extend;
begin --is user inputs a non-numeric value skip the value
l_number := cast(ltrim( rtrim( substr( l_string, 1, n-1 ) ) ) as number);
l_data(l_data.count) := l_number ;
EXCEPTION
WHEN VALUE_ERROR THEN
l_number := 0;
WHEN OTHERS THEN
raise ;
end ;
l_string := substr( l_string, n+1 );
end loop;
RETURN L_DATA;
END in_number;
--then your code
AND S.GroupID IN (select column_value from table(in_number(groupID_))3) actually, just look at this blog posting! it does a better job at this than I am!
http://tkyte.blogspot.com/2006/06/varying-in-lists.html -
Passing array to the procedure in parameter
Hi
I tried the following code,
Where my aim is to split the comma separated values and insert into an array, and then pass that array to another procedure in a package
CREATE OR REPLACE PACKAGE PAK_SPLIT_TEST AS
PROCEDURE PROC_SPLIT(IN_LIST VARCHAR2) ;
END;
CREATE OR REPLACE PACKAGE PAK_SPLIT_TEST AS
PROCEDURE PROC_SPLIT(IN_LIST VARCHAR2) ;
END;
CREATE OR REPLACE PACKAGE PAK_SPLIT_TEST
AS
PROCEDURE PROC_SPLIT (IN_LIST VARCHAR2);
END;
CREATE OR REPLACE PACKAGE BODY PAK_SPLIT_TEST
AS
PROCEDURE PROC_REM_LIST (p_array l_data)
IS
BEGIN
FOR i IN 1 .. p_array.COUNT
LOOP
DBMS_OUTPUT.put_line (p_array (i));
END LOOP;
END;
PROCEDURE PROC_SPLIT (IN_LIST VARCHAR2)
IS
TYPE SPLIT_array IS TABLE OF VARCHAR2 (4000)
INDEX BY BINARY_INTEGER;
l_data SPLIT_array;
l_txt LONG := '100,200,300,400,500,600';
l_str LONG := IN_LIST || ',';
l_n NUMBER;
BEGIN
BEGIN
l_data.delete;
LOOP
l_n := INSTR (l_str, ',');
EXIT WHEN NVL (l_n, 0) = 0;
l_data (l_data.COUNT + 1) := SUBSTR (l_str, 1, l_n - 1);
l_str := SUBSTR (l_str, l_n + 1);
END LOOP;
PROC_REM_LIST (l_data);
END;
END;
SELECT *FROM USER_ERRORSI'm getting the following error at line no. 30
PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following:
begin end function package pragma procedure formCould you please help me in this
Thanks,
SmileGive this a shot:
CREATE OR REPLACE PACKAGE BODY PAK_SPLIT_TEST
AS
TYPE SPLIT_array IS TABLE OF VARCHAR2 (4000)
INDEX BY BINARY_INTEGER;
PROCEDURE PROC_REM_LIST (p_array SPLIT_array)
IS
BEGIN
FOR i IN 1 .. p_array.COUNT
LOOP
DBMS_OUTPUT.put_line (p_array (i));
END LOOP;
END;
PROCEDURE PROC_SPLIT (IN_LIST VARCHAR2)
IS
l_data SPLIT_array;
l_txt LONG := '100,200,300,400,500,600';
l_str LONG := IN_LIST || ',';
l_n NUMBER;
BEGIN
BEGIN
l_data.delete;
LOOP
l_n := INSTR (l_str, ',');
EXIT WHEN NVL (l_n, 0) = 0;
l_data (l_data.COUNT + 1) := SUBSTR (l_str, 1, l_n - 1);
l_str := SUBSTR (l_str, l_n + 1);
END LOOP;
PROC_REM_LIST (l_data);
END;
END;
END pak_split_test;
/PROC_REM_LIST was expecting a PL/SQL type of L_DATA. You have not defined that type anywhere (e.g. in your package spec, body, or in SQL). I move the declaration from PROC_SPLIT to your package body and it compiles.
Hope this helps! -
How to pass ARRAY to Oracle Procedure
Hi
We are using BC4J with JSP in our project. We need to send an Array to the procedure.
Could somebody provide some info as how this can be achieved.A while back, I used a SQLJ client to call a Java (also SQLJ) stored procedure and I needed to pass an array of strings to the procedure. I did something like this:
Java Class that was loaded in DB:
public class MyClass
// method that the stored procedure uses
public static void CALL_DOSTUFF(String a,
oracle.sql.ARRAY b,
oracle.sql.ARRAY c)
String[] bb = (String[])b.getArray();
String[] cc = (String[])c.getArray();
doStuff(a,bb,cc);
public static void doStuff(String a,
String[] b,
String[] c)
// process the input
In the database I added the type:
create or replace type STR_ARRAY as table of varchar2(20);
and the procedure:
create or replace procedure CALL_DOSTUFF(a varchar2,
b STR_ARRAY,
c STR_ARRAY)
as
language java
name 'MyClass.CALL_DOSTUFF(java.lang.String,
oracle.sql.ARRAY,
oracle.sql.ARRAY)';
I then used jpub to publish a STR_ARRAY.java file. I compiled this and used it with my SQLJ client to call to the stored procedure. The STR_ARRAY constructor takes a String[], so you do something like this in the SQLJ client:
String x = "X";
String y = {"y1","y2"};
String z = {"z1","z2"};
STR_ARRAY y1 = new STR_ARRAY(y);
STR_ARRAY z1 = new STR_ARRAY(z);
#sql {CALL CALL_DOSTUFF(:x,:y1,:z1)};
Hope this helps. -
HELP: Can't Pass Parameters w/Stored Procedure as Data Connection
I'm working on using an existing employment application in PDF format, and I want the form fields to be prepopulated with the user's specific data.
I'd like is so that when a user clicks a link (like www.mysite.com/empapp/empapp.pdf?UserID=5), a dynamic PDF document will open up and that user's data will be populated inside of the form fields by using that user's "UserID" variable/parameter that was passed in the querystring.
I've tried a stored procedure that contains the following select statement:
SELECT * FROM tblEmpApp WHERE UserID = @UserID
I've also tried entering this select statement manually into the box instead of using a stored procedure without success. When I try to use the stored procedure, I receive this error:
Stored procedure "spEmpApp" has non-optional parameters.
How can I set the PDF doc up to populate the form fields based on that passed parameter in the querystring???
******************PLEASE HELP!!!******************had this same issue. following works for me.
-create a dataconnection to the db with a random query to the table.
-just clone the dataconnection
oDConn = xfa.sourceSet.DataConnection.clone(1);
-change the query attribute to the stored procedure
oDConn.resolveNode("#command").query.select.value = "exec spEmpApp 'parameter'"
-open the cloned data connection
oDconn.open(); -
HOW TO PASS VALUE TO STORED PROCEDURE through page
Hi
I want to create generate next number on base of type. I have created stored procedure with passing three value input. If I am passing value manually through page then next number is generating. But I don't to pass value manually, I have to assign value internally as per database record.
Sameh Nassar: Create PL/SQL Function And Call It From Your ADF Application
I did same thing in my application,It is working,Output like that
Value = INV
Result= 26400080
Now I have to assign value TRANSCATION TYPE through bean class or assign another textbox value. I did in my program in the following ways
<af:inputText value="INV"
label="#{bindings.p_transaction_type.hints.label}"
required="#{bindings.p_transaction_type.hints.mandatory}"
columns="#{bindings.p_transaction_type.hints.displayWidth}"
maximumLength="#{bindings.p_transaction_type.hints.precision}"
shortDesc="#{bindings.p_transaction_type.hints.tooltip}"
id="it16" binding="#{InvoiceJobOrderBean.transacation_type}"
partialTriggers="it16">
<f:validator binding="#{bindings.p_transaction_type.validator}"/>
</af:inputText>
then I got the following error.
<MethodExpressionActionListener> <processAction> Received 'javax.faces.event.AbortProcessingException' when invoking action listener '#{bindings.generateNextNumber.execute}' for component 'cb2'
<MethodExpressionActionListener> <processAction> javax.faces.event.AbortProcessingException: ADFv: Abort processing exception.
at oracle.adfinternal.view.faces.model.binding.FacesCtrlActionBinding.execute(FacesCtrlActionBinding.java:199)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.el.parser.AstValue.invoke(Unknown Source)
at com.sun.el.MethodExpressionImpl.invoke(Unknown Source)
at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105)
at javax.faces.event.MethodExpressionActionListener.processAction(MethodExpressionActionListener.java:148)
at javax.faces.event.ActionEvent.processListener(ActionEvent.java:88)
at org.apache.myfaces.trinidad.component.UIXComponentBase.broadcast(UIXComponentBase.java:824)
at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:179)
at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.run(ContextSwitchingComponent.java:130)
at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:461)
at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:134)
at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:112)
at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.run(ContextSwitchingComponent.java:130)
at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:461)
at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:134)
at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:106)
at oracle.adf.view.rich.component.fragment.UIXRegion.broadcast(UIXRegion.java:159)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.broadcastEvents(LifecycleImpl.java:1137)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:361)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:202)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:508)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:173)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:125)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:468)
at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:468)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:293)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:199)
at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:180)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:119)
at java.security.AccessController.doPrivileged(Native Method)
at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:315)
at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:442)
at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:103)
at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:171)
at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:139)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
<Utils> <buildFacesMessage> ADF: Adding the following JSF error message: ORA-06502: PL/SQL: numeric or value error: character to number conversion error
ORA-06512: at "WSAEEAPP.PK_SEC", line 114
ORA-01403: no data found
ORA-06512: at line 1
java.sql.SQLException: ORA-06502: PL/SQL: numeric or value error: character to number conversion error
ORA-06512: at "WSAEEAPP.PK_SEC", line 114
ORA-01403: no data found
ORA-06512: at line 1
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:462)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:405)
at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:931)
at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:481)
at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:205)
at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:548)
at oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableStatement.java:213)
at oracle.jdbc.driver.T4CCallableStatement.executeForRows(T4CCallableStatement.java:1111)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1488)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3769)
at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3904)
at oracle.jdbc.driver.OracleCallableStatement.executeUpdate(OracleCallableStatement.java:9417)
at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeUpdate(OraclePreparedStatementWrapper.java:1512)
at weblogic.jdbc.wrapper.PreparedStatement.executeUpdate(PreparedStatement.java:172)
at model.AppModuleImpl.callStoredFunction(AppModuleImpl.java:150)
at model.AppModuleImpl.generateNextNumber(AppModuleImpl.java:176)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at oracle.adf.model.binding.DCInvokeMethod.invokeMethod(DCInvokeMethod.java:655)
at oracle.adf.model.binding.DCDataControl.invokeMethod(DCDataControl.java:2162)
at oracle.adf.model.bc4j.DCJboDataControl.invokeMethod(DCJboDataControl.java:3088)
at oracle.adf.model.binding.DCInvokeMethod.callMethod(DCInvokeMethod.java:266)
at oracle.jbo.uicli.binding.JUCtrlActionBinding.doIt(JUCtrlActionBinding.java:1626)
at oracle.adf.model.binding.DCDataControl.invokeOperation(DCDataControl.java:2169)
at oracle.jbo.uicli.binding.JUCtrlActionBinding.invoke(JUCtrlActionBinding.java:731)
at oracle.adf.controller.v2.lifecycle.PageLifecycleImpl.executeEvent(PageLifecycleImpl.java:402)
at oracle.adfinternal.view.faces.model.binding.FacesCtrlActionBinding._execute(FacesCtrlActionBinding.java:252)
at oracle.adfinternal.view.faces.model.binding.FacesCtrlActionBinding.execute(FacesCtrlActionBinding.java:185)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.el.parser.AstValue.invoke(Unknown Source)
at com.sun.el.MethodExpressionImpl.invoke(Unknown Source)
at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105)
at javax.faces.event.MethodExpressionActionListener.processAction(MethodExpressionActionListener.java:148)
at javax.faces.event.ActionEvent.processListener(ActionEvent.java:88)
at org.apache.myfaces.trinidad.component.UIXComponentBase.broadcast(UIXComponentBase.java:824)
at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:179)
at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.run(ContextSwitchingComponent.java:130)
at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:461)
at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:134)
at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:112)
at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.run(ContextSwitchingComponent.java:130)
at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:461)
at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:134)
at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:106)
at oracle.adf.view.rich.component.fragment.UIXRegion.broadcast(UIXRegion.java:159)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.broadcastEvents(LifecycleImpl.java:1137)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:361)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:202)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:508)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:173)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:125)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:468)
at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:468)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:293)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:199)
at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:180)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:119)
at java.security.AccessController.doPrivileged(Native Method)
at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:315)
at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:442)
at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:103)
at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:171)
at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:139)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
<Utils> <buildFacesMessage> ADF: Adding the following JSF error message: ORA-06502: PL/SQL: numeric or value error: character to number conversion error
ORA-06512: at "WSAEEAPP.PK_SEC", line 114
ORA-01403: no data found
ORA-06512: at line 1
java.sql.SQLException: ORA-06502: PL/SQL: numeric or value error: character to number conversion error
ORA-06512: at "WSAEEAPP.PK_SEC", line 114
ORA-01403: no data found
ORA-06512: at line 1
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:462)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:405)
at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:931)
at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:481)
at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:205)
at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:548)
at oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableStatement.java:213)
at oracle.jdbc.driver.T4CCallableStatement.executeForRows(T4CCallableStatement.java:1111)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1488)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3769)
at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3904)
at oracle.jdbc.driver.OracleCallableStatement.executeUpdate(OracleCallableStatement.java:9417)
at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeUpdate(OraclePreparedStatementWrapper.java:1512)
at weblogic.jdbc.wrapper.PreparedStatement.executeUpdate(PreparedStatement.java:172)
at model.AppModuleImpl.callStoredFunction(AppModuleImpl.java:150)
at model.AppModuleImpl.generateNextNumber(AppModuleImpl.java:176)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at oracle.adf.model.binding.DCInvokeMethod.invokeMethod(DCInvokeMethod.java:655)
at oracle.adf.model.binding.DCDataControl.invokeMethod(DCDataControl.java:2162)
at oracle.adf.model.bc4j.DCJboDataControl.invokeMethod(DCJboDataControl.java:3088)
at oracle.adf.model.binding.DCInvokeMethod.callMethod(DCInvokeMethod.java:266)
at oracle.jbo.uicli.binding.JUCtrlActionBinding.doIt(JUCtrlActionBinding.java:1626)
at oracle.adf.model.binding.DCDataControl.invokeOperation(DCDataControl.java:2169)
at oracle.jbo.uicli.binding.JUCtrlActionBinding.invoke(JUCtrlActionBinding.java:731)
at oracle.adf.controller.v2.lifecycle.PageLifecycleImpl.executeEvent(PageLifecycleImpl.java:402)
at oracle.adfinternal.view.faces.model.binding.FacesCtrlActionBinding._execute(FacesCtrlActionBinding.java:252)
at oracle.adfinternal.view.faces.model.binding.FacesCtrlActionBinding.execute(FacesCtrlActionBinding.java:185)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.el.parser.AstValue.invoke(Unknown Source)
at com.sun.el.MethodExpressionImpl.invoke(Unknown Source)
at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105)
at javax.faces.event.MethodExpressionActionListener.processAction(MethodExpressionActionListener.java:148)
at javax.faces.event.ActionEvent.processListener(ActionEvent.java:88)
at org.apache.myfaces.trinidad.component.UIXComponentBase.broadcast(UIXComponentBase.java:824)
at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:179)
at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.run(ContextSwitchingComponent.java:130)
at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:461)
at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:134)
at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:112)
at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.run(ContextSwitchingComponent.java:130)
at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:461)
at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:134)
at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:106)
at oracle.adf.view.rich.component.fragment.UIXRegion.broadcast(UIXRegion.java:159)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.broadcastEvents(LifecycleImpl.java:1137)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:361)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:202)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:508)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:173)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:125)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:468)
at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:468)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:293)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:199)
at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:180)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:119)
at java.security.AccessController.doPrivileged(Native Method)
at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:315)
at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:442)
at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:103)
at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:171)
at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:139)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)hi user,
please don't continue your discussion on others thread.
https://forums.oracle.com/thread/369112
it will be treated as hijacking. Admin will lock out the thread. and your problem is contrary to the thread.
coming to your problem,
did you ever get a chance to read the error it is self explanatory. or else goggle it out to understand.
It is not operation binding problem. while invoking the operation binding you are calling some db function from there you caught.
coming to your requirement,
create generate next number on base of type. please check will multi user environment it working properly or not.
Maybe you are looking for
-
Moving music to my media card in my BB pearl
SOMEONE PLEASE HELP ME! I just bought the new 8130 pearl... i can't get music on it! (I've bought 2 songs through iTunes) I tried using BB Media Sync and it won't work... I've tried draging and droping and it's not working... When I look at my BB car
-
Cant down load new itunes upgrade due to work pc lap top firewall
Hi i have a i phone. went to to load up new itunes software to phone and my PC will not down load file. I use a works PC and they have firewalls. it comes up " NOT VALID WIN 32 APPLICATION" so i cant use the new software. Any Help PLEASE!!!
-
Auto Create Outbound Delivery and Shipment from IDoc
Hi Ppl, Currently, we have a transport company which handles all our transportation of goods to our customer. We develop a project, phase 1 which we automatically sends sales order in form of IDocs to our transport company and they in turn we send us
-
Recovering files from your ipod
My computer got reconfigured, so is there a way ro recover files from your ipod to your computer? I have a windows XP not a mac,if that makes a difference.
-
I am trying to start the Weblogic Commerce Server 3.2 on NT after loading the webloic_classpath variables its suddenly dies saying --> Exception in thread "main" java.lang.NoClassDefFoundError: weblogic/Server I'm using weblogic server 6.0, and my WE