[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Beginning SQL statements with a parenthesis in JDBC
I would try to remove the parethesis. I've done that and it worked.
George
----- Original Message -----
From: "Mose, Lisle" <Lisle@mediaocean.com>
To: <ajug-members@ajug.org>
Sent: Tuesday, February 18, 2003 3:43 PM
Subject: Beginning SQL statements with a parenthesis in JDBC
> Hello all,
>
> I'm running into a problem beginning a JDBC SQL statement with a
parenthesis. I need to do something similar to the following:
> "(SELECT ...) UNION (SELECT ...)" - the parenthesis are necessary for
grouping purposes.
>
> For the sake of testing, I tried the following and get the same error:
> "(SELECT SYSDATE FROM DUAL)" - of course this works fine without the
parenthesis. Also, it works fine with the parenthesis when using sqlplus
instead of JDBC.
>
>
> Here is the exception and stacktrace:
>
> Exception in thread "main" java.sql.SQLException: ORA-01009: missing
mandatory parameter
>
> 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.OracleResultSetImpl.next(OracleResultSetImpl.java:242)
> at JDBCTest.main(JDBCTest.java:17)
>
>
> I'm running against Oracle 8.1.7 using Weblogic 6.1's JDBC thin driver.
>
> Has anyone encountered this problem before? Is there a workaround?
>
> Thanks!
> Lisle Mose
>