Exec Stored Function in EXEC_SQL?
Hi!
How to execute a function in EXEC_SQL? I need a sample. Thanks!
Steenie
Please follow the following Example to implement EXEC_SQL.
PROCEDURE Test IS
connection_id EXEC_SQL.CONNTYPE;
cursorID EXEC_SQL.CURSTYPE;
sql_string VARCHAR2(1000);
lv_ename VARCHAR2(30);
lv_eno NUMBER;
lv_hiredate DATE;
exec_id PLS_INTEGER;
BEGIN
connection_id := EXEC_SQL.OPEN_CONNECTION(connect_str);
cursorID := EXEC_SQL.OPEN_CURSOR(connection_id);
sql_string := 'select ename, empno, hiredate from emp ';
EXEC_SQL.PARSE(connection_id, cursorID, sql_string, exec_sql.V7);
EXEC_SQL.BIND_VARIABLE(connection_id, cursorID, ':bn', input_empno);
EXEC_SQL.DEFINE_COLUMN(connection_id, cursorID, 1, lv_ename, 30);
EXEC_SQL.DEFINE_COLUMN(connection_id, cursorID, 2, lv_eno);
EXEC_SQL.DEFINE_COLUMN(connection_id, cursorID, 3, lv_hiredate);
-- after parsing, and calling BIND_VARIABLE and DEFINE_COLUMN, if necessary, you are ready to execute the statement. Note that all information
-- about the statement and its result set is encapsulated in the cursor referenced as cursorID.
exec_id := EXEC_SQL.EXECUTE(connection_id, cursorID);
END;
If you still get error after following the above example please send me your code to [email protected]
Similar Messages
-
Cannot call ANY stored functions from my Java program
My problem is that I cannot call ANY stored procedure from my Java
program. Here is the code for one of my stored procedures which runs
very well in PL/SQL:
PL/SQL code:
CREATE OR REPLACE PACKAGE types AS
TYPE cursorType IS REF CURSOR;
END;
CREATE OR REPLACE FUNCTION list_recs (id IN NUMBER)
RETURN types.cursorType IS tracks_cursor types.cursorType;
BEGIN
OPEN tracks_cursor FOR
SELECT * FROM accounts1
WHERE id = row_number;
RETURN tracks_cursor;
END;
variable c refcursor
exec :c := list_recs(11)
SQL> print c
COLUMN1 A1 ROW_NUMBER
rec_11 jacob 11
rec_12 jacob 11
rec_13 jacob 11
rec_14 jacob 11
rec_15 jacob 11
Here is my Java code:
import java.sql.*;
import java.io.*;
import oracle.jdbc.driver.*;
class list_recs
public static void main(String args[]) throws SQLException,
IOException
String query;
CallableStatement cstmt = null;
ResultSet cursor;
// input parameters for the stored function
String user_name = "jacob";
// user name and password
String user = "jnikom";
String pass = "jnikom";
DriverManager.registerDriver(new oracle.jdbc.OracleDriver());
try { Class.forName ("oracle.jdbc.driver.OracleDriver"); }
catch (ClassNotFoundException e)
{ System.out.println("Could not load driver"); }
Connection conn =
DriverManager.getConnection (
"jdbc:oracle:thin:@10.52.0.25:1521:bosdev",user,pass);
try
String sql = "{ ? = call list_recs(?) }";
cstmt = conn.prepareCall(sql);
// Use OracleTypes.CURSOR as the OUT parameter type
cstmt.registerOutParameter(1, OracleTypes.CURSOR);
String id = "11";
cstmt.setInt(2, Integer.parseInt(id));
// Execute the function and get the return object from the call
cstmt.executeQuery();
ResultSet rset = (ResultSet) cstmt.getObject(1);
while (rset.next())
System.out.print(rset.getString(1) + " ");
System.out.print(rset.getString(2) + " ");
System.out.println(rset.getString(3) + " ");
catch (SQLException e)
System.out.println("Could not call stored function");
e.printStackTrace();
return;
finally
cstmt.close();
conn.close();
System.out.println("Stored function was called");
Here is how I run it, using Win2K and Oracle9 on Solaris:
C:\Jacob\Work\Java\Test\Vaultus\Oracle9i\FunctionReturnsResultset>java
list_recs
Could not call stored function
java.sql.SQLException: ORA-00600: internal error code, arguments:
[ttcgcshnd-1], [0], [], [], [], [], [], []
at
oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208)
at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:543)
at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1405)
at oracle.jdbc.ttc7.TTC7Protocol.fetch(TTC7Protocol.java:889)
at
oracle.jdbc.driver.OracleStatement.<init>(OracleStatement.java:490)
at
oracle.jdbc.driver.OracleStatement.getCursorValue(OracleStatement.java:2661)
at
oracle.jdbc.driver.OracleStatement.getObjectValue(OracleStatement.java:4189)
at
oracle.jdbc.driver.OracleStatement.getObjectValue(OracleStatement.java:4123)
at
oracle.jdbc.driver.OracleCallableStatement.getObject(OracleCallableStatement.java:541)
at list_recs.main(list_recs.java:42)
C:\Jacob\Work\Java\Test\Vaultus\Oracle9i\FunctionReturnsResultset>
Any help is greatly appreciated,
Jacob NikomThank you for your suggestion.
I tried it, but got the same result. I think the difference in the syntax is due to the Oracle versus SQL92 standard
conformance. Your statament is the Oracle version and mine is the SQL92. I think both statements are acceptable
by the Oracle.
Regards,
Jacob Nikom -
Executing stored function using Native SQL
In SAP documentation, I can see how to execute an Oracle stored procedure in an external database using:
EXEC SQL.
EXECUTE PROCEDURE procname
ENDEXEC.
I want to execute a stored FUNCTION within a package. I have tried executing it using the syntax for PROCEDURE above and get a "ORA-06550 wrong type or number of arguments" error. Since the function has one argument in and one argument out, I think I am counting the number of arguments correctly. Has anyone executed from within ABAP an Oracle function stored in an external database?
Thanks
Janice IsheeJanice - from help.sap.com:
Stored Procedures
The command EXECUTE PROCEDURE proc allows you to call a procedure stored in the database. When you call it, you can pass a list of host variables as parameters. When yuo call a procedure, you must specify for each parameter whether it is an input parameter ( IN), output parameter (OUT) or changing parameter (INOUT).
Example
Calling a Procedure:
DATA Y TYPE I VALUE 300.
DATA Z TYPE I.
EXEC SQL.
INSERT INTO AVERI_CLNT (CLIENT, ARG1, ARG2, ARG3)
VALUES ('000', 9, 2, 47)
ENDEXEC.
EXEC SQL.
CREATE OR REPLACE PROCEDURE PROC1 (X IN NUMBER) IS
BEGIN
UPDATE AVERI_CLNT SET ARG3 = ARG3 + X;
END;
ENDEXEC.
EXEC SQL.
CREATE OR REPLACE PROCEDURE PROC2 (X IN NUMBER, Y OUT NUMBER) IS
BEGIN
SELECT ARG3 INTO Y
FROM AVERI_CLNT
WHERE CLIENT = '000' AND ARG1 = 9 AND ARG2 = 2;
UPDATE AVERI_CLNT SET ARG3 = ARG3 - X;
END;
ENDEXEC.
EXEC SQL.
EXECUTE PROCEDURE PROC1 ( IN :Y )
ENDEXEC.
EXEC SQL.
EXECUTE PROCEDURE PROC2 ( IN :Y, OUT :Z )
ENDEXEC.
IF SY-SUBRC <> 0 OR Z <> 347.
WRITE: / 'Wrong result for EXECUTE PROCEDURE:', Z.
ENDIF.
EXEC SQL.
DROP PROCEDURE PROC1
ENDEXEC.
EXEC SQL.
DROP PROCEDURE PROC2
ENDEXEC.
Rob -
Execute a stored function from command line
Hello,
I have a db stored function and I need to execute it from command line. I've tried by this way:
(I need to connect with sys credentials)
sqlplus sys/mypwd@mydb AS SYSDBA @myfile.sql
and myfile.sql is:
exec myschema.sf_test;
but I get this error:
ERROR at line 1:
ORA-06550: line 1, column 7:
PLS-00221: 'sf_test' is not a procedure or is undefined
ORA-06550: line 1, column 7:
PL/SQL: Statement ignoredYou can use exec command for the execution of a procedure with out bind variable, but for a function always use bind variable.
Function should return a value, so you must have to assign the function return value to a variable.
like given below(or simply query the function using select statement)
Method 1
======
variable v1 number;
exec :v1 := t_func;
Method 2
======
declare
x1 NUMBER;
begin
x1 := t_func;
end;
SQL> create function t_func return number
2 as
3 begin
4 return 0;
5 end;
6 /
Function created.
SQL> exec t_func;
BEGIN t_func; END;
ERROR at line 1:
ORA-06550: line 1, column 7:
PLS-00221: 'T_FUNC' is not a procedure or is undefined
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
Method 3
======
SQL> select t_func from dual;
T_FUNC
0
Regards
JJ -
Problem with return value of stored function
Hi,
I've made a stored function that insert a new row in a table and return the primary key (see at the end of the message the function script).
In VS 2005 with Visual basic, using the designer, I've created a dataset containing a tableAdapter to be able to use the Pl/SQL function.
My problem is I can't get the proper return value. The VB code below works without error except that I get 0 as value.
What's wrong?
Cheers,
Sebastien
VB code
Dim myAddSession As New ICISDataSetTableAdapters.AddSessionTableAdapter
Dim intSessionId As Integer
intSessionId = myAddSession.ADD_SESSION(tbxUsername.Text, _
tempFolder.Substring(tempFolder.LastIndexOf("\") + 1), _
"toto", Environment.GetEnvironmentVariable("COMPUTERNAME"), _
myLevelAccess.icisUserId, myLevelAccess.levelId)
The debugger tells me that the ADD_SESSION function return value is Object.
add_session PL/SQL script:
CREATE OR REPLACE FUNCTION ICISSEC.add_session (
orausername IN icis_session.ora_user_name%TYPE,
ctxsessionid IN icis_session.ctx_session_id%TYPE,
ctxsessionname IN icis_session.ctx_session_name%TYPE,
ctxservername IN icis_session.ctx_server_name%TYPE,
icisuserid IN icis_session.icis_user_id%TYPE,
startlevelid IN icis_session.start_lvl_id%TYPE
RETURN icis_session.ICIS_SESSION_ID%TYPE
IS
tmpvar icis_session.ICIS_SESSION_ID%TYPE;
BEGIN
INSERT INTO icis_session
(ora_user_name, ctx_session_id, ctx_server_name,
icis_user_id, start_lvl_id, ctx_session_name
VALUES (orausername, ctxsessionid, ctxservername,
icisuserid, startlevelid, ctxsessionname
RETURNING icis_session_id
INTO tmpvar;
COMMIT;
RETURN tmpvar;
EXCEPTION
WHEN OTHERS
THEN
RAISE;
END add_session;naama wrote:
that if a value is null to convert it to 0 ? . i mean in the part of the declaration of parameter
Nope, can't do that in the signature. You'll need to handle that by validating the passed parameters at the start of the function.
It's simple enough. In your case you might just as well test for NULL and fail the function like this:
FUNCTION date_post_message(
user_lock_in IN NUMBER,
form_type_in IN NUMBER DEFAULT 0 ,
date_in IN DATE)
RETURN BOOLEAN
IS
v_num NUMBER(1);
BEGIN
dbms_output.put_line('Value of parameters : user_lock_in : '||user_lock_in || ' : form_type_in : '||form_type_in||' : date_in : '||date_in );
IF user_lock_in = 1 THEN
RETURN FALSE;
END IF;
IF form_type_in IS NULL THEN
RETURN FALSE;
ELSIF form_type_in NOT IN (1,2) THEN
RETURN FALSE;
END IF;
RETURN TRUE;
EXCEPTION
WHEN NO_DATA_FOUND THEN
RETURN FALSE;
END;In other use cases I would declare a local variable and process it like this:
IF form_type_in IS NULL THEN
l_form_type := 0;
ELSE
l_form_type := form_type_in;
END IF;Obviously the code should use the local variable rather than the parameter.
Validating the values passed in parameters at the start of a function is good practice. If you really want to go to town, read about Design By Contract.
Cheers, APC
Edited by: APC on Nov 9, 2011 1:36 PM
Added example, as requested by OP -
Using Stored Function with a datagridview
Hi All,
I have a problem using a stored function in a datagridview control. My problem is, when the user adds a new row to the grid, the stored function is called to insert the next item number in a grid column. For some reason I cannot figure out why this isn’t just working. The stored function is working alright, as I can call it from SQL Plus or PL/SQL and get the return value back but my problem is inserting it into the grid as the user creates a new row. Can some please help.
Function NextItemNum RETURN NUMBER
IS
varItemNum NUMBER(8);
Begin
SELECT MAX(ITEM_NUM) + 1
INTO varItemNum
FROM ORDERITEMS;
IF varItemNum IS NULL THEN
varItemNum = 1
END IF;
RETURN varItemNum;
END NextItemNum;
/* Code to insert into datagridview */
ig = myOrdersInsertCommand.Parameters.Add(New OracleParameter("pVal", Client.OracleDbType.Int32, 8, ParameterDirection.ReturnValue))
myOrdersInsertCommand.ExecuteNonQuery()
ItemNum = (myOrdersInsertCommand.Parameters("pVal").Value.ToString())
For Each r As DataGridViewRow In OrderItemsDataGridView.Rows
ORDER_ITEMSTableAdapter.InsertOrderItems(r.Cells(0).Value, r.Cells(1).Value, r.Cells(2).Value, r.Cells(3).Value, r.Cells(4).Value, r.Cells(5).Value, r.Cells(6).Value)
NextFirstly, thank you for the help. I have attempted to code the advice you gave but it still does not seem to compile properly. Can you suggest what is wrong with my code please?
Here is the code I am trying to configure:
forceDriver.h
static int32 CVICALLBACK static_callback(TaskHandle taskHandle, int32 everyNsamplesEventType, uInt32 nSamples, void* callbackData);
int32 EveryNCallback(TaskHandle taskHandle, int32 everyNsamplesEventType, uInt32 nSamples);
int32 DoneCallback(TaskHandle taskHandle, int32 status, void *callbackData);
forceDriver.cpp
DAQmxErrChk (DAQmxRegisterEveryNSamplesEvent(taskHandle,DAQmx_Val_Acquired_Into_Buffer,2500,0,&forceDriver::static_callback,panel));
**START TASK**
int32 forceDriver::EveryNCallback(TaskHandle taskHandle, int32 everyNsamplesEventType, uInt32 nSamples)
panel->(member_function);
int32 CVICALLBACK forceDriver::static_callback(TaskHandle taskHandle, int32 everyNsamplesEventType, uInt32 nSamples, void* callbackData)
forceDriver* static_object = static_cast<forceDriver*>(callbackData);
return static_object->EveryNCallback(taskHandle, everyNsamplesEventType, nSamples);
where panel is the object I have created. -
SQL LOADER: how to load CLOB column using stored function
Hi,
I am a newbie of sql loader. Everything seems to be fine until I hit a
road block - the CLOB column type. I want to load data into the clob
column using a stored function. I need to do some manipulation on the
data before it gets saved to that column. But I got this error when I
run the sql loader.
SQL*Loader-309: No SQL string allowed as part of "DATA" field
specification
DATA is my CLOB type column.
here is the content of the control file:
LOAD DATA
INFILE 'test.csv'
BADFILE 'test.bad'
DISCARDFILE 'test.dsc'
REPLACE
INTO TABLE test_table
FIELDS TERMINATED BY ','
OPTIONALLY ENCLOSED BY '"'
TRAILING NULLCOLS
codeid BOUNDFILLER,
reason BOUNDFILLER,
Checkstamp "to_date(:CHECKSTAMP, 'mm/dd/yyyy')",
"DATA" "GetContent(:codeid, :reason)"
All references are suggesting to use a file to load data on
CLOB column but I want to use a function in which it generates
the content to be saved into the column.
Any help is greatly appreciated.
Thanks,
Baldwin
MISICompany*** Duplicate Post ... Please Ignore ***
-
How can i return a SDO_GEOMETRY value in a Java-Stored-Function?
For a example, Ive got a java-function witch returns a
oracle.sdoapi.geom.Geometry like:
public static Geometry GetQPoint(String sF_TABLE_NAME, long lFID)
And now, Ill try to deploy this function as a PL-SQL stored-function like:
GET_Q_POINT(
F_TABLE_NAME IN VARCHAR2,
FID IN NUMBER
) RETURN MDSYS.SDO_GEOMETRY;
I can't deploy this above mentioned java-function with Oracle9i JDeveloper because oracle.sdoapi.geom.Geometry can not mapped in any PL-SQL data type.
Is there any possibility to do it in a other way?
Please help me.a quick example that takes as input a longitude and latitude,
and return a point geometry in wgs 84:
CREATE OR REPLACE FUNCTION get_geom (
longitude IN NUMBER,
latitude IN NUMBER )
RETURN mdsys.sdo_geometry
DETERMINISTIC IS
BEGIN
RETURN mdsys.sdo_geometry (2001,8307,
mdsys.sdo_point_type (longitude, latitude, NULL), NULL, NULL );
END;
other pl/sql examples:
REM
REM This function doesn't really do anything, but demonstrates some simple
REM mechanisms on how to manipulate the array portion of the geometry object, and
REM also how to write a function that returns a geometry object.
REM
REM The function demonstrates:
REM 1) .EXTEND (there is also .DELETE)
REM 2) .COUNT
REM 3) Any function that returns an object (including the SDO_GEOMETRY object)
REM should be declared as DETERMINSTIC (see below).
REM
create or replace function create_geometry return mdsys.sdo_geometry deterministic as
temp_geom mdsys.sdo_geometry := mdsys.sdo_geometry (2002, 8307, null,
mdsys.sdo_elem_info_array (1,2,1),
mdsys.sdo_ordinate_array ());
begin
for i in 1 .. 10 loop
temp_geom.sdo_ordinates.extend (2);
temp_geom.sdo_ordinates(temp_geom.sdo_ordinates.count-1) := i;
temp_geom.sdo_ordinates(temp_geom.sdo_ordinates.count) := i+1;
end loop;
return temp_geom;
end;
select create_geometry from dual;
set linesize 80
set pages 1000
drop table TEST_MODIFY;
create table TEST_MODIFY (geom mdsys.sdo_geometry);
insert into TEST_MODIFY values
(mdsys.sdo_geometry (2002, 8307, null,
mdsys.sdo_elem_info_array (1,2,1),
mdsys.sdo_ordinate_array (1,1, 2,2, 3,3, 4,4)));
insert into TEST_MODIFY values
(mdsys.sdo_geometry (2002, 8307, null,
mdsys.sdo_elem_info_array (1,2,1),
mdsys.sdo_ordinate_array (21,21, 22,22, 23,23, 24,24)));
REM
REM Select values before update.
REM
select geom from TEST_MODIFY;
REM
REM This PL*SQL block updates all the ordinates of a geometry by adding 10 to each x value
REM and 20 to each y value.
REM
declare
i NUMBER;
cursor c1 is select geom, rowid
from TEST_MODIFY;
begin
for r in c1 loop
i := 1;
while (i < r.geom.sdo_ordinates.count) loop
r.geom.sdo_ordinates(i) := r.geom.sdo_ordinates(i) + 10;
r.geom.sdo_ordinates(i+1) := r.geom.sdo_ordinates(i+1) + 20;
i := i + 2;
end loop;
update TEST_MODIFY set geom = r.geom where rowid = r.rowid;
end loop;
end;
REM
REM Select values after update.
REM
select geom from TEST_MODIFY; -
Hi guys!
I have a stored function which searches if a product exists in the DB and
return the appropriate value, something like a bool variable (here there is a
problem too, because if it returns a bool value, I can't find this tipe in ODP
and I must use number and decimal types).
Anyway, the function works perfectly but I have I problem with mapping the
response value in ODP.I put it the first in ParamCollection, I have assigned
it the correct type, so I can't figure out why I get this message
ORA-22060: argument [{0}] is an invalid or uninitialized number
CREATE OR REPLACE PROCEDURE "ADMIN"."PRODUCTEXISTS"
Iname in varchar2,
Imanufacturer in varchar2
return number is
b number(1);
nr number(4);
cursor c is
SELECT product FROM products
WHERE name=Iname AND manufacturer=Imanufacturer;
begin
b:=0;
OPEN c;
LOOP
FETCH c INTO nr;
IF c%FOUND THEN
b:=1;
END IF;
EXIT WHEN b=1 OR c%NOTFOUND;
END LOOP;
CLOSE c;
RETURN b;
end;
This is the cs procedure:
public bool PRODUCTS_CheckProduct(string name, string manufacturer)
OracleCommand cmd = new OracleCommand("PRODUCTEXISTS", dbConn);
cmd.CommandType = CommandType.StoredProcedure;
OracleParameter [] prm = new OracleParameter[3];
prm[1] = cmd.Parameters.Add("name", OracleDbType.Varchar2, name, ParameterDirection.Input);
prm[2] = cmd.Parameters.Add("manufacturer", OracleDbType.Varchar2, manufacturer, ParameterDirection.Input);
prm[0] = cmd.Parameters.Add("RetVal", OracleDbType.Decimal, ParameterDirection.ReturnValue);
prm[0].Size=1;
dbConn.Open();
cmd.ExecuteNonQuery();
dbConn.Close();
if (prm[2].Value.ToString())
return true;
else
return false;When binding function parameters by position, the
function return value comes first.
And you want a stored function, not a stored procedure.
Your c# code should be something like:
public static OracleConnection connect()
OracleConnection con = new OracleConnection(...);
con.open();
return con;
using (OracleConnection con = connect())
OracleCommand cmd = new OracleCommand("PRODUCTEXISTS", con);
cmd.CommandType = CommandType.StoredProcedure;
OracleParameter rv = cmd.Parameters.Add("RetVal", OracleDbType.Decimal, ParameterDirection.ReturnValue);
rv.Size=1;
cmd.Parameters.Add("name", OracleDbType.Varchar2, name, ParameterDirection.Input);
cmd.Parameters.Add("manufacturer", OracleDbType.Varchar2, manufacturer, ParameterDirection.Input);
cmd.ExecuteNonQuery();
OracleDecimal d = (OracleDecimal)rv.Value;
if (d == 1)
return true;
else
return false;
}David -
Calling Stored Function from Excel
Folks,
Can someone help me with an Excel Macro that will call an Oracle stored function taking in parameter from one of the Excel Cell and return the value from the function into a different cell in the spreadsheet?
ThanksThis is not the right Forum for this query still here is something for you to start with
The oracle function to add 1 to the input parameter
create or replace function AddOne(ID Number) return number is
Numout Number:=0;
begin
numout:=id+1;
return numout;
end;
The Macro in Excel file to run the above function(Please add necessary references for ado connectivity)
Option Explicit
Dim Objconn As ADODB.Connection
Sub Macro1()
Dim StrSql As String
Dim ObjRs As New ADODB.Recordset
Dim I As Long
StrSql = "Provider=OraOLEDB.Oracle.1;Password=swallocation;Persist Security Info=True;User ID=swallocation;Data Source=dumpdb"
Set Objconn = New ADODB.Connection
Objconn.Open StrSql
For I = 2 To Sheet1.Rows.Count
If Not CStr(Sheet1.Cells(I, 1)) = "" Then
ObjRs.Open "select AddOne(" + CStr(Sheet1.Cells(I, 1)) + ") from dual", Objconn
If Not ObjRs.EOF And Not ObjRs.BOF Then
ObjRs.MoveFirst
Sheet1.Cells(I, 2) = ObjRs(0).Value
End If
ObjRs.Close
Else
Exit For
End If
Next
Set ObjRs = Nothing
Objconn.Close
Set Objconn = Nothing
End Sub
Hope you get something to start with
Prakash... -
Calling Stored Function from DOT NET
Hi,
I am trying to call a stored function "PKG_MIS_USER_MASTER.ADD_USER(userid varchar2, password varchar2) return NUMBER" from my DOT NET application.
Everything works fine within TOAD. Can anyone please help me in writing the C# code for calling a stored function along with its return value.
Thanks in Advance.You can (as of 15-JUL-2005) get chapter 5 and chapter 7 of my book from the ODP.NET homepage, which is located here:
http://www.oracle.com/technology/tech/windows/odpnet/index.html
The link is at the bottom of the page.
The direct link is:
http://www.oracle.com/technology/books/pdfs/dotnet_ch5_7.pdf
Chapter 5 covers using PL/SQL from .NET.
- Mark -
Calling Stored Function from TopLink
I have a simple Stored Function that I'm trying to call using TopLink API:
TopLink Version: 10.1.3.3.
Oracle JDBC Driver: ojdbc5.jar (Oracle JDBC Driver version - "11.1.0.6.0-Production+")
Stored Procedure:
Function Get_Email_Address_Id(P_EMAIL_ADDRESS IN varchar2) return number;
TopLink Code:
public String executeStoredFunction() {
TopLinkTemplate tlTemplate = getTopLinkTemplate();
StoredFunctionCall call = new StoredFunctionCall();
call.setProcedureName("EMAIL_ADDRESS_PKG.Get_Email_Address_Id");
call.setResult("FUNCTION_RESULT", String.class);
call.addNamedArgument("P_EMAIL_ADDRESS");
ValueReadQuery query = new ValueReadQuery();
query.setCall(call);
query.addArgument("P_EMAIL_ADDRESS");
Vector parameters = new Vector();
parameters.addElement("1009");
String result = (String)tlTemplate.executeQuery(query, parameters.toArray());
return result;
Error I'm getting:
Exception [TOPLINK-7121] (Oracle TopLink - 10g Release 3 (10.1.3.3.0) (Build 070428)): oracle.toplink.exceptions.ValidationException
Exception Description: DatabasePlatform does not support stored functions
at oracle.toplink.exceptions.ValidationException.platformDoesNotSupportStoredFunctions(ValidationException.java:1299)
at oracle.toplink.queryframework.StoredFunctionCall.prepareInternal(StoredFunctionCall.java:52)
at oracle.toplink.internal.databaseaccess.DatabaseCall.prepare(DatabaseCall.java:494)
at oracle.toplink.internal.queryframework.CallQueryMechanism.prepareCall(CallQueryMechanism.java:102)
at oracle.toplink.internal.queryframework.CallQueryMechanism.prepareExecuteSelect(CallQueryMechanism.java:203)
at oracle.toplink.queryframework.DataReadQuery.prepare(DataReadQuery.java:150)
at oracle.toplink.queryframework.DatabaseQuery.checkPrepare(DatabaseQuery.java:405)
at oracle.toplink.queryframework.DatabaseQuery.checkPrepare(DatabaseQuery.java:375)
at oracle.toplink.queryframework.DatabaseQuery.execute(DatabaseQuery.java:598)
at oracle.toplink.queryframework.DataReadQuery.execute(DataReadQuery.java:96)
at oracle.toplink.publicinterface.Session.internalExecuteQuery(Session.java:2089)
at oracle.toplink.publicinterface.Session.executeQuery(Session.java:993)
at oracle.toplink.publicinterface.Session.executeQuery(Session.java:965)
Observations:
Why is TopLink complaining about DatabasePlatform?
I'm using Oracle 10g as my database platform. Did anyone encounter this problem?
I have tried various combinations but it always have same complaint.
Thanks in advance for help.Hello,
It is complaining because the DatabasePlatform being used doesn't support functions. So the problem is that it is using the DatabasePlatform instead of the Oracle10Platform that you are expecting. How have you defined it? Could you have multiple sessions.xml files, and the one that is being picked not define the Oracle10Platform? Or could you be overriding the login somehow (prelogin event etc) and setting it to use the default DatabasePlatform by accident?
Best Regards,
Chris -
DBMS_XMLQuery behavior when using stored function within cursor select
Consider the following SQL Statement
select t1.id
, t1.name
, cursor ( select t2.id
from tab t2
where t2.t1_id
= t1.id
and validate(t2.xyz,:bd1)
= 1
from tab t1
where t1.id = :bd2
DBMS_XMLQuery is used to create a context and to bind the appropriate values. In this case 'validate' is a stored function. I get the following error message upon execution:
ORA-29532: Java call terminated by uncaught Java exception:
java.sql.SQLException: Missing IN or OUT parameter at index:: 1
Issuing a similar statement in SQL*Plus works fine. I was wondering whether this is a known issue when using a stored function in the cursor select statement in the context of DBMS_XMLQuery or whether I'm doing something wrong.Hi Jan,
This problem has been identified and fixed. The fix should be available in the next release. Thank you for bringing this up to our attention.
visar -
Read item from Java class and call to stored function/procedure of database
Hi,
I am looking solution that I was trying to find becasue of I am not expert and novice of ADF so I am getting problem to do. I am trying migrating from oracle forms to JDeveloper[ADF].
I want to call database stored function from JSF pages by java bean class of a button press event (manually created) and after button event I have called java class which I created manually. But I can not read that values what I given into jsp page.
question1: How can I read jsp pages items value to java class ?
question2: How can I call to database stored function/procedure with that parameter?
question3: How can I use return value of that stored function/procedure ?
Please reply me .
Thanks,
zakir
===
Edited by: Zakir Hossain on Mar 29, 2009 10:22 AM---
-
Stored function not returning result set unless recompiled
Hi,
I have a strange situation going on with a basic Java (1.6.0.17) application talking to an Oracle 11g (11.2.0.1.0) database. Basically what is happening is that sometimes a stored function's return value (a result set) is not making it as far as JDBC/Java, unless I recompile the stored function (with absolutely no changes to the application or function's code). I am always able to successfully see the result set if I call the function directly from within SQL Developer, just not on the Java app/JDBC side.
I've tried running with 3 different physical Oracle 11g servers and tried running the app on a couple of machines. I'm wondering if this is either some kind of caching issue or perhaps a JDBC bug/misconfiguration.
Any help would be greatly appreciated. Attached to this message:
1. stored function code
2. snippet of Java app code
3. ODBC trace output when returned a empty result set (ie failure scenario)
4. ODBC trace out when returned the correct result set (ie success scenario)
* it's helpful if you compare the texts of 3 & 4 with Vim diff or WinMerge etc.
** as they're large I've just extracted the sections that had differences. Leave a message here and I can send you the full ones if necessary.
1. stored function code
===============
FUNCTION getRecordSet (
ActionId Number
RETURN CallingList.ref_cursor
IS
myDataCursor CallingList.ref_cursor;
ActionId_ Number;
BEGIN
ActionId_ := ActionId;
IF isActionExpired(ActionId) <= 0 THEN
ActionId_ := 0;
END IF;
OPEN myDataCursor FOR
SELECT
C.ID,
C.CUSTOMER_ID,
C.CAMPAIGN_ID,
c.phone,
C.TRANSFERDN,
(SELECT
TTS_MESSAGE
FROM CAMPAIGN CMP
WHERE CMP.CAMPAIGN_ID = C.CAMPAIGN_ID) "TTS"
FROM
CALLING_LIST C
WHERE
C.ACTION_ID = ActionId_
AND
C.CALL_STATUS = 1
AND
C.CALLCOUNT > 0
And rownum <=5;
RETURN myDataCursor;
EXCEPTION
WHEN CURSOR_ALREADY_OPEN THEN
RETURN NULL;
WHEN INVALID_CURSOR THEN
RETURN NULL;
WHEN NO_DATA_FOUND THEN
RETURN NULL;
END getRecordSet;
....and the isActionExpired function that is called from within getResultSet is (but for all my testing it's been returning 1 with no problems)
FUNCTION isActionExpired (
ActionId number
) RETURN number
AS
Today varchar2(12);
myCount number(6);
BEGIN
myCount := 0;
today := to_char(sysdate, 'dd.mm.yyyy');
SELECT
count(*)
INTO
myCount
FROM
ACTION A
where
ACTION_ID = ActionId
AND
SYSDATE BETWEEN ACTION_STARTDATETIME
AND
ACTION_STOPDATETIME
and
SYSDATE BETWEEN to_date(today || ' ' || A.STARTTIME, 'dd.mm.yyyy HH24:MI:SS') and to_date(today || ' ' || A.ENDTIME, 'dd.mm.yyyy HH24:MI:SS')
AND
ACTION_STATUS = 1;
return myCount;
END isActionExpired;
2. snippet of Java app code
=================
... db connect logic...
javax.management.MBeanServer mbs = null;
javax.management.ObjectName name = null;
try {
String loader = Thread.currentThread().getContextClassLoader().toString().replaceAll("[,=:\"]+", "");
name = new javax.management.ObjectName("com.oracle.jdbc:type=diagnosability,name="+loader);
mbs = java.lang.management.ManagementFactory.getPlatformMBeanServer();
mbs.setAttribute(name, new javax.management.Attribute("LoggingEnabled", true));
} catch (Exception e) {
System.out.println("ORACLE TRACE ERROR: " + e.getStackTrace());
try {
String query = "begin ? := CALLINGLIST.getRecordSet(?); end;";
CallableStatement stmt = conn.prepareCall(query);
stmt.registerOutParameter(1, OracleTypes.CURSOR);
stmt.setInt(2, actionId);
stmt.execute();
ResultSet rs = (ResultSet) stmt.getObject(1); // So, here it works.
// print the results
int count=0;
while (rs.next()) {
count++;
stmt.close();
System.out.println("rs count was: " + count);
} catch (SQLException e) {
System.out.println("Exception occurred: " + e.getMessage());
3. ODBC trace output when returned a empty result set (ie failure scenario)
===============================================
Jul 1, 2010 3:30:47 PM oracle.net.ns.Packet receive
TRACE_16: Enter:
Jul 1, 2010 3:30:47 PM oracle.net.ns.Packet receive
TRACE_20: Debug: type=6, length=121, flags=0
00 79 00 00 06 00 00 00 |.y......|
00 00 06 22 01 06 00 01 |..."....|
0A 00 00 00 07 03 C2 04 |........|
0E 04 C3 5E 22 03 02 C1 |...^"...|
2A 04 33 30 30 32 03 37 |*.3002.7|
37 37 05 48 65 6C 6C 6F |77.Hello|
08 01 06 00 00 01 02 00 |........|
00 00 00 00 00 04 01 05 |........|
01 01 02 05 7B 00 00 01 |....{...|
02 00 03 00 00 00 00 00 |........|
00 00 00 00 00 00 00 00 |........|
00 01 01 00 00 00 00 19 |........|
4F 52 41 2D 30 31 34 30 |ORA-0140|
33 3A 20 6E 6F 20 64 61 |3:.no.da|
74 61 20 66 6F 75 6E 64 |ta.found|
0A |. |
Jul 1, 2010 3:30:47 PM oracle.net.ns.Packet receive
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.DBConversion CHARBytesToJavaChars
TRACE_16: Enter: [B@1fa1bb6, 0, [C@1b000e7, 1, [I@1315d34, 20
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.DBConversion _CHARBytesToJavaChars
TRACE_16: Enter: [B@1fa1bb6, 0, [C@1b000e7, 1, 871, [I@1315d34, 20, oracle-character-set-830, oracle-character-set-2000, oracle-character-set-871, false
Jul 1, 2010 3:30:47 PM oracle.sql.CharacterSet convertUTFBytesToJavaChars
TRACE_16: Enter: [B@1fa1bb6, 0, [C@1b000e7, 1, [I@1315d34, true, 20
Jul 1, 2010 3:30:47 PM oracle.sql.CharacterSet convertUTFBytesToJavaChars
TRACE_16: return: 4
Jul 1, 2010 3:30:47 PM oracle.sql.CharacterSet convertUTFBytesToJavaChars
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.DBConversion _CHARBytesToJavaChars
TRACE_16: return: 4
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.DBConversion _CHARBytesToJavaChars
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.DBConversion CHARBytesToJavaChars
TRACE_16: return: 4
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.DBConversion CHARBytesToJavaChars
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.DBConversion CHARBytesToJavaChars
TRACE_16: Enter: [B@1fa1bb6, 0, [C@1b000e7, 211, [I@1de256f, 10
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.DBConversion _CHARBytesToJavaChars
TRACE_16: Enter: [B@1fa1bb6, 0, [C@1b000e7, 211, 871, [I@1de256f, 10, oracle-character-set-830, oracle-character-set-2000, oracle-character-set-871, false
Jul 1, 2010 3:30:47 PM oracle.sql.CharacterSet convertUTFBytesToJavaChars
TRACE_16: Enter: [B@1fa1bb6, 0, [C@1b000e7, 211, [I@1de256f, true, 10
Jul 1, 2010 3:30:47 PM oracle.sql.CharacterSet convertUTFBytesToJavaChars
TRACE_16: return: 3
Jul 1, 2010 3:30:47 PM oracle.sql.CharacterSet convertUTFBytesToJavaChars
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.DBConversion _CHARBytesToJavaChars
TRACE_16: return: 3
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.DBConversion _CHARBytesToJavaChars
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.DBConversion CHARBytesToJavaChars
TRACE_16: return: 3
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.DBConversion CHARBytesToJavaChars
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.DBConversion CHARBytesToJavaChars
TRACE_16: Enter: [B@1fa1bb6, 0, [C@1b000e7, 321, [I@16bd8ea, 2000
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.DBConversion _CHARBytesToJavaChars
TRACE_16: Enter: [B@1fa1bb6, 0, [C@1b000e7, 321, 871, [I@16bd8ea, 2000, oracle-character-set-830, oracle-character-set-2000, oracle-character-set-871, false
Jul 1, 2010 3:30:47 PM oracle.sql.CharacterSet convertUTFBytesToJavaChars
TRACE_16: Enter: [B@1fa1bb6, 0, [C@1b000e7, 321, [I@16bd8ea, true, 2000
Jul 1, 2010 3:30:47 PM oracle.sql.CharacterSet convertUTFBytesToJavaChars
TRACE_16: return: 5
Jul 1, 2010 3:30:47 PM oracle.sql.CharacterSet convertUTFBytesToJavaChars
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.DBConversion _CHARBytesToJavaChars
TRACE_16: return: 5
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.DBConversion _CHARBytesToJavaChars
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.DBConversion CHARBytesToJavaChars
TRACE_16: return: 5
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.DBConversion CHARBytesToJavaChars
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.T4CConnection updateSessionProperties
TRACE_16: Enter: [Loracle.jdbc.internal.KeywordValue;@16e1fb1
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.T4CConnection updateSessionProperties
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.T4CStatement fetch
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleStatement checkValidRowsStatus
TRACE_16: Enter:
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleStatement checkValidRowsStatus
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleResultSetImpl <init>
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.T4CResultSetAccessor getCursor
TRACE_16: return: oracle.jdbc.driver.OracleResultSetImpl@e2cb55
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.T4CResultSetAccessor getCursor
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.ResultSetAccessor getObject
TRACE_16: return: oracle.jdbc.driver.OracleResultSetImpl@e2cb55
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.ResultSetAccessor getObject
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleCallableStatement getObject
TRACE_1: return: oracle.jdbc.driver.OracleResultSetImpl@e2cb55
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleCallableStatement getObject
TRACE_1: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleCallableStatementWrapper getObject
TRACE_30: return: oracle.jdbc.driver.OracleResultSetImpl@e2cb55
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleCallableStatementWrapper getObject
TRACE_30: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleResultSetImpl next
TRACE_1: Public Enter:
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleResultSetImpl next
TRACE_20: Debug: closed=false, statement.currentRow=-1, statement.totalRowsVisited=0, statement.maxRows=0, statement.validRows=1, statement.gotLastBatch=true
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleResultSetImpl next
TRACE_1: return: true
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleResultSetImpl next
TRACE_1: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleResultSetImpl next
TRACE_1: Public Enter:
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleResultSetImpl next
TRACE_20: Debug: closed=false, statement.currentRow=0, statement.totalRowsVisited=1, statement.maxRows=0, statement.validRows=1, statement.gotLastBatch=true
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleResultSetImpl internal_close
TRACE_16: Enter: false
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.BaseResultSet close
TRACE_16: Public Enter:
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.BaseResultSet close
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.PhysicalConnection registerHeartbeat
TRACE_16: Enter:
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.PhysicalConnection registerHeartbeat
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.PhysicalConnection needLine
TRACE_16: Enter:
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.PhysicalConnection needLineUnchecked
TRACE_16: Enter:
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.PhysicalConnection needLineUnchecked
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.PhysicalConnection needLine
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.T4CStatement closeQuery
TRACE_16: Enter:
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.T4CConnection assertLoggedOn
TRACE_16: Enter: "oracle.jdbc.driver.T4CStatement.closeQuery"
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.T4CConnection assertLoggedOn
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.T4CStatement closeQuery
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleStatement endOfResultSet
TRACE_16: Enter: false
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleStatement prepareForNewResults
TRACE_16: Enter: false, false
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleStatement clearWarnings
TRACE_16: Public Enter:
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleStatement clearWarnings
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleResultSetImpl internal_close
TRACE_16: Enter: true
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleResultSetImpl internal_close
TRACE_16: return:
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleResultSetImpl internal_close
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleStatement prepareForNewResults
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.T4CStatement clearDefines
TRACE_16: Enter:
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleStatement clearDefines
TRACE_16: Public Enter:
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleStatement freeLine
TRACE_16: Enter:
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleStatement freeLine
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleStatement cleanupDefines
TRACE_16: Enter:
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.PhysicalConnection cacheBuffer
TRACE_16: Enter: [B@8e32e7
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.BufferCache put
TRACE_16: Enter: [B@8e32e7
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.BufferCache put
TRACE_30: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.PhysicalConnection cacheBuffer
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.PhysicalConnection cacheBuffer
TRACE_16: Enter: [C@1b000e7
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.BufferCache put
TRACE_16: Enter: [C@1b000e7
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.BufferCache put
TRACE_30: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.PhysicalConnection cacheBuffer
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleStatement cleanupDefines
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleStatement clearDefines
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.T4CStatement clearDefines
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleStatement endOfResultSet
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleResultSetImpl internal_close
TRACE_16: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleResultSetImpl next
TRACE_1: return: false
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleResultSetImpl next
TRACE_1: Exit
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleCallableStatementWrapper close
TRACE_16: Enter:
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OraclePreparedStatementWrapper close
TRACE_16: Enter:
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleStatementWrapper close
TRACE_16: Enter:
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleStatement close
TRACE_1: Public Enter:
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.OracleStatement closeOrCache
TRACE_16: Enter: null
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.PhysicalConnection isStatementCacheInitialized
TRACE_16: Enter:
Jul 1, 2010 3:30:47 PM oracle.jdbc.driver.PhysicalConnection isStatementCacheInitialized
4. ODBC trace out when returned the correct result set (ie success scenario)
===============================================
TRACE_16: Enter:
Jul 1, 2010 3:30:07 PM oracle.net.ns.Packet receive
TRACE_20: Debug: type=6, length=82, flags=0
00 52 00 00 06 00 00 00 |.R......|
00 00 08 01 06 00 00 01 |........|
02 00 00 00 00 00 00 04 |........|
01 05 00 02 05 7B 00 00 |.....{..|
01 02 00 03 00 00 00 00 |........|
00 00 00 00 00 00 00 00 |........|
00 00 01 01 00 00 00 00 |........|
19 4F 52 41 2D 30 31 34 |.ORA-014|
30 33 3A 20 6E 6F 20 64 |03:.no.d|
61 74 61 20 66 6F 75 6E |ata.foun|
64 0A |d. |
Jul 1, 2010 3:30:07 PM oracle.net.ns.Packet receive
TRACE_16: Exit
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.T4CConnection updateSessionProperties
TRACE_16: Enter: [Loracle.jdbc.internal.KeywordValue;@1fa1bb6
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.T4CConnection updateSessionProperties
TRACE_16: Exit
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.T4CStatement fetch
TRACE_16: Exit
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleResultSetImpl internal_close
TRACE_16: Enter: false
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.BaseResultSet close
TRACE_16: Public Enter:
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.BaseResultSet close
TRACE_16: Exit
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.PhysicalConnection registerHeartbeat
TRACE_16: Enter:
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.PhysicalConnection registerHeartbeat
TRACE_16: Exit
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.PhysicalConnection needLine
TRACE_16: Enter:
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.PhysicalConnection needLineUnchecked
TRACE_16: Enter:
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.PhysicalConnection needLineUnchecked
TRACE_16: Exit
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.PhysicalConnection needLine
TRACE_16: Exit
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.T4CStatement closeQuery
TRACE_16: Enter:
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.T4CConnection assertLoggedOn
TRACE_16: Enter: "oracle.jdbc.driver.T4CStatement.closeQuery"
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.T4CConnection assertLoggedOn
TRACE_16: Exit
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.T4CStatement closeQuery
TRACE_16: Exit
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleStatement endOfResultSet
TRACE_16: Enter: false
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleStatement prepareForNewResults
TRACE_16: Enter: false, false
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleStatement clearWarnings
TRACE_16: Public Enter:
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleStatement clearWarnings
TRACE_16: Exit
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleStatement prepareForNewResults
TRACE_16: Exit
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.T4CStatement clearDefines
TRACE_16: Enter:
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleStatement clearDefines
TRACE_16: Public Enter:
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleStatement freeLine
TRACE_16: Enter:
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleStatement freeLine
TRACE_16: Exit
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleStatement cleanupDefines
TRACE_16: Enter:
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.PhysicalConnection cacheBuffer
TRACE_16: Enter: [B@8e32e7
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.BufferCache put
TRACE_16: Enter: [B@8e32e7
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.BufferCache put
TRACE_30: Exit
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.PhysicalConnection cacheBuffer
TRACE_16: Exit
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.PhysicalConnection cacheBuffer
TRACE_16: Enter: [C@1b000e7
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.BufferCache put
TRACE_16: Enter: [C@1b000e7
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.BufferCache put
TRACE_30: Exit
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.PhysicalConnection cacheBuffer
TRACE_16: Exit
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleStatement cleanupDefines
TRACE_16: Exit
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleStatement clearDefines
TRACE_16: Exit
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.T4CStatement clearDefines
TRACE_16: Exit
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleStatement endOfResultSet
TRACE_16: Exit
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleResultSetImpl internal_close
TRACE_16: Exit
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleResultSetImpl <init>
TRACE_16: Exit
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.T4CResultSetAccessor getCursor
TRACE_16: return: oracle.jdbc.driver.OracleResultSetImpl@1315d34
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.T4CResultSetAccessor getCursor
TRACE_16: Exit
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.ResultSetAccessor getObject
TRACE_16: return: oracle.jdbc.driver.OracleResultSetImpl@1315d34
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.ResultSetAccessor getObject
TRACE_16: Exit
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleCallableStatement getObject
TRACE_1: return: oracle.jdbc.driver.OracleResultSetImpl@1315d34
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleCallableStatement getObject
TRACE_1: Exit
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleCallableStatementWrapper getObject
TRACE_30: return: oracle.jdbc.driver.OracleResultSetImpl@1315d34
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleCallableStatementWrapper getObject
TRACE_30: Exit
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleResultSetImpl next
TRACE_1: Public Enter:
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleResultSetImpl next
TRACE_20: Debug: closed=true, statement.currentRow=-1, statement.totalRowsVisited=0, statement.maxRows=0, statement.validRows=0, statement.gotLastBatch=false
Jul 1, 2010 3:30:07 PM oracle.jdbc.driver.OracleResultSetImpl next
Edited by: user9376621 on Jul 1, 2010 1:07 AM
Edited by: user9376621 on Jul 1, 2010 1:13 AMPlease ignore this, it was a non-issue in the end.
Maybe you are looking for
-
How to Change Crystal Report database name from visual basic code?
Hi all, I have created a Crystal Report (CR) with .NET VB. I also have developd some UDTs for that pusrpose and everything is OK. However I cannot use the same CR in another Company which has the same UDTs. I have not found how Connect to Company (i
-
Battery indicator @ 0%, but still runs
I've had my macbook for about 2-3 years now. I have noticed the battery performance getting worse with time, but lately it has gone way down! after fully charging, the batter will show only about 20-30minutes of time, within about 3 minutes will drop
-
Classloader issue? (what's a $Proxy598?)
I have a session bean which looks up 3 other session beans. All are located in the same JAR, one copy of which is deployed to the war and another to the ear. It is a Struts Action class which is attempting to obtain references to these SSBs. Referenc
-
When attempting synch iTunes photos tab yields spinning ball.
When synching my iPhone or iPad a spinning wheel appears when on the photos tab in iTunes. In other words, I cannot select photos to transfer from my iMac to my iPad or iPhone. The spinning wheel never goes away while on the photos tab. Other tabs
-
Hi! Well, i'm really happy with the card overall but i have the same issue as priyajeet(he posted it in the crackle/pop thread. Here's the thing, i can't play any directX based game. I do play OpenGL based games without any issue. Tried few DX games