Re: Invalid character???

From: Vladimir M. Zakharychev <vladimir.zakharychev_at_gmail.com>
Date: Tue, 19 Aug 2008 06:01:50 -0700 (PDT)
Message-ID: <c19a4dd3-2a18-4b8d-a1b3-7c1ad0101573@z72g2000hsb.googlegroups.com>


On Aug 19, 12:23 am, Tim Slattery <Slatter..._at_bls.gov> wrote:
> I'm at a total impasse. I have a stored function that returns a
> SYS_REFCURSOR. It works fine, I can call it in SQL*Plus and see the
> data that's been extracted. I'm trying to call it from Java:
>
>        String spName;
>        try
>        {
>            getDBConnection();        /* sets "dbConnection */
>
>            spName = "{ call ? := getReporterData(?) }";
>
>            sprocStmt = dbConnection.prepareCall(spName);
>            sprocStmt.registerOutParameter(1, OracleTypes.CURSOR);
> sprocStmt.setString(2, key);
>            sprocStmt.execute();
>
> And I get ORA-00911 Invalid character. What invalid character?
>
> --
> Tim Slattery
> Slatter...@bls.govhttp://members.cox.net/slatteryt

Shouldn't this be spName = "{ ?= call getReporterData(?) }"; ? At least if you're using JDBC escape syntax... Otherwise it can be spName = "BEGIN ? := getReporterData(?); END;", in this case it'll be Oraclespecific.

Hth,

   Vladimir M. Zakharychev
   N-Networks, makers of Dynamic PSP(tm)    http://www.dynamicpsp.com Received on Tue Aug 19 2008 - 08:01:50 CDT

Original text of this message