Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: [Oracle] "CREATE JAVA SOURCE" via ODBC?
In article <3F75FE91.16A92D62_at_wp.pl>, Wojciech Maruszek
<wojciechmaruszek_at_wp.pl> wrote:
>Hello,
>
>I have an Oracle 9 database with ODBC drivers.
>I want to create a Java stored procedure.
>I have written the following statement:
>
> CREATE JAVA SOURCE NAMED SimpleClass AS
> public class SimpleClass
> {
> public static int is_positive(int number) {
> return (number >= 0) ? 1 : 0;
> }
> }
>
>The problem is that curly braces {} and question mark ?
>have special meaning for ODBC. My statement executes correctly
>when I switch to other drivers (like OCI). To make it work
>properly under ODBC, I have to modify Java source
>(e.g. replace ? : clauses with if's).
>
>Unfortunately, I have to stay with ODBC drivers.
>How to solve the problem?
ODBC allows for native SQL translations to be turned off. If you are using a tool, this option could be there somewhere. If you are doing hardcore ODBC programming you can do that using something like below:
SQLSetStmtAttr(hstmt,SQL_ATTR_NOSCAN,SQL_NOSCAN_ON,0);
Don't ask me why there are so many negations in there... :-)
-
Robert Sundström, Mimer SQL Development
Upright Database Technology AB, http://www.mimer.com
Validate your SQL statements at http://developer.mimer.com/parser
Received on Mon Sep 29 2003 - 08:12:39 CDT