jQuery in Action, 2nd edition*
The moose likes JDBC and the fly likes java.sql.SQLException: ORA-06576: not a valid function or procedure name Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "java.sql.SQLException: ORA-06576: not a valid function or procedure name" Watch "java.sql.SQLException: ORA-06576: not a valid function or procedure name" New topic
Author

java.sql.SQLException: ORA-06576: not a valid function or procedure name

Ajju Chawla
Greenhorn

Joined: Oct 21, 2005
Posts: 21
Hi,

Iam getting the following error when I try to call an oracle procedure through CallableStatement--

java.sql.SQLException: ORA-06576: not a valid function or procedure name

The code for calling the functio is --
-----------------------------------------------------------------------------
CallableStatement objCallStmt = null;

objCallStmt = conn.prepareCall("CALL LBSL.PKDSTVERSION.FNSETPRIORITY(?,?,?,?)");
objCallStmt.setLong(1,objDistributionSetDTO.getDeviceId());
objCallStmt.setLong(2,new Long(strSeqId).longValue());
objCallStmt.setLong(3,_lUserId);
objCallStmt.registerOutParameter(4,Types.INTEGER);
objCallStmt.execute();
long lReleaseFlag = objCallStmt.getLong(4);
----------------------------------------------------------------------
The db procedure is as follows --

------------------------------------------------------------------

PACKAGE BODY PKDSTVERSION AS


PROCEDURE PRSETPRIORITY(pDevId IN NUMBER, pVerid IN NUMBER, pUserId IN NUMBER, pOut OUT NUMBER)
IS

l_shortname VARCHAR2(3);

l_priority NUMBER(2);
l_flag NUMBER(1) := 0;


CURSOR C1 (PDevId NUMBER, PVerId NUMBER) IS
SELECT
DSM_N_DVRID,
DIR_N_PRIORITY,
DTP_C_SHRTNAME
FROM
DD_DATATYPE,DD_DSTMEMBER, DD_DEVDIRECTORY
WHERE
DTP_N_ID = DIR_N_DTPID AND
DTP_N_ID = DSM_N_DTPID AND
DIR_N_DEVID = PDevId AND
DSM_N_DVRID = pVerId
ORDER BY DIR_N_PRIORITY DESC;


BEGIN

g_UserId := pUserId;


FOR REC IN C1(pDevId, pVerId) LOOP

l_priority := REC.DIR_N_PRIORITY;

If (l_flag = 0) Then
l_shortname := REC.DTP_C_SHRTNAME;
l_flag := 1;
End If;


If (l_shortname != REC.DTP_C_SHRTNAME) Then
l_shortname := 'dst';
End if;

END LOOP;

DBMS_OUTPUT.PUT_LINE(l_priority);
DBMS_OUTPUT.PUT_LINE(l_shortname);

UPDATE DD_DSTVERSION SET
DVR_N_ABSPRIORITY = l_priority,
DVR_C_DTPSHRTNAME = l_shortname
WHERE
DVR_N_ID = pVerId;

pOut := g_Success;

EXCEPTION
WHEN OTHERS THEN
g_logString :='@#@#'||g_Error||'@#'||'FNSETPRIORITY:-'||SQLERRM||'@#'||g_UserId;
DBMS_OUTPUT.PUT_LINE(g_logString);

g_errorCode := PKINTERFACE.FNINSIFERRORLOG(g_logString);

pOut := g_Fatal;

END PRSETPRIORITY;


END PKDSTVERSION;
------------------------------------------------------------------------

Any help would be greatly appreciated

Thanks
-Aj
Shailesh Chandra
Ranch Hand

Joined: Aug 13, 2004
Posts: 1081

Are you sure that you are connected to schema which has your procedure.

The difference I have found in your post is
  • You are calling procedure FNSETPRIORITY from Java
  • But code you posted has a procedure name is PRSETPRIORITY


  • I guess you sould call procedure as



    Shailesh


    Gravitation cannot be held responsible for people falling in love ~ Albert Einstein
    Ajju Chawla
    Greenhorn

    Joined: Oct 21, 2005
    Posts: 21
    Yeh I got that,
    That was a silly mistake...

    thanx
     
    With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
     
    subject: java.sql.SQLException: ORA-06576: not a valid function or procedure name
     
    Similar Threads
    Handling cursor declared in oracle in java program
    calling oracle procedures in java
    Callable Statement
    plssssss Help me!!
    Calling stored procedure problems