File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Ajju Chawla
Greenhorn
Posts: 21
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1082
Java Oracle Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
     
    Ajju Chawla
    Greenhorn
    Posts: 21
    • 0
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Yeh I got that,
    That was a silly mistake...

    thanx
     
    I agree. Here's the link: http://aspose.com/file-tools
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic