ORA-00907: missing right parenthesis

Hello,

I have the following message calling an odbc stored procedure within an odbc sql general component : ORA-00907: missing right parenthesis

Context

connection: ODBC(PP)

driver: Oracle

version: 6.0

Connection string:

Samples

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

The store procedure has been validated on TOAD.

The store procedure has been validated with these call statement within PP component:

Begin

MOVIES.I_PCK_MOVIES_SEARCHER.demander(param1 => 4152, param2 => 4);

End;

OR

Begin

MOVIES.I_PCK_MOVIES_SEARCHER.demander(param1 => \\\$(globalProperties 1), param2 => \\\$(globalProperties 2));

End;

{call MOVIES.I_PCK_MOVIES_SEARCHER.Collecter_results()}

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

The following synthax didn't work with odbc(pp) but work fine with an ODBC(DSN) with Oracle driver.

Begin

MOVIES.I_PCK_MOVIES_SEARCHER.demander(param1 => ?, param2 => ?);

End;

Sql parameter mapping with properties or global properties

Thans for your help,

Samuel

Answers 9
HP
HP 2012-08-10

"missing right parenthesis" is most likely caused by the $(globalProperty 1) in your code.  The value for "@GlobalProperty 1" most likely has a ')' in it.

This is one reason why you need to use BIND variables.  The primary reason being "prevent SQL Injections - use binds".

EDIT **  try using a Global Property Name that doesn't have a space in it.  eg $(GlobalProperty_1) instead of $(GlobalProperty 1)

** but, I still insist that you use binds  (ie   ?, ? )

The underlying ODBC driver does not like named parameter syntax.

ie:  this code will always fail

MOVIES.I_PCK_MOVIES_SEARCHER.demander(param1 => 4152, param2 => 4);

(or any variation of the above)

You'll have to fill in every parameter for the procedure in the correct order.

eg:

MOVIES.I_PCK_MOVIES_SEARCHER.demander( 4152,  4);

or

MOVIES.I_PCK_MOVIES_SEARCHER.demander( ?, ?);

FYI - I've ran into some bugs with using the Oracle ODBC driver instead of the supplied version.  I forgot what those bugs were.

If you are on Pipeline Pilot 8.0 or above, try out the JDBC components.  You'll have to use the { call myprocedure( ?, ? ) } format, though.

MK

LH
LH 2012-08-13

By other problems, do you mean not being able to do SQL inserts? I find that turning on the EnableSQLDescribeParam causes inserts to fail. I used to create two ODBC configurations, one with the parameter on, the other with it off. Now I use the JDBC driver, which doesn't suffer from this problem, but is about half as slow.

HP
HP 2012-08-13

Lee,

what do you mean by "inserts to fail"?

There is a bug with the ODBC components that wasn't fixed until ~8.0.

rough description:

INSERT-ed values would work for a few rows but then repeat a value over and over again. (or... some columns are NULL values)

This is occurs mostly when going from a text/Excel reader straight into the DB.

If this is it, there is a work-around.

Samual,

I've been there and have attempted what you want to do. (or, at least, I have attempted what I perceive what you want to do)

Sorry, but it just doesn't work as us Oracle people would like it to.

From my experience:

  • DataDirect (PP drivers) does not support 'named parameters'. eg:   run_this( param_1 => ? )
  • The Pipelint Pilot 6.0 ODBC Components using Oracle Drivers (DSN) does not work very well.  I forgot under which contexts.
  • I forgot which version of Pipeline Pilot but:  support for anonymous SQL blocks (begin ... end;) stopped.  This may be for JDBC only.
  • If Lee's error is what I think it is, there is a work-around.

Suggested coding standards:

  • (as always) use BINDs.  (ie the question marks things)
  • call all your package in the { call ____ } format.
  • Do not use overloaded functions/procedures!  6.0 does not do a good job of "picking the right one" for these.
  • If needed, create "wrapper" PL/SQL packages that are specific for Pipeline Pilot.
    • if you have complex logic, you can hide that in here
    • if you have overloaded functions/procedures, you can use the named-parameters here.
  • upgrade your pilot server to at least 8.0.  Many of your problems may magically disapear.

(ps - was 6.0 the verison of Pipeline Pilot or of the DataDirect drivers?  I am assuming Pipeline Pilot 6.0)

MK

LH
LH 2012-08-13

MK

If I create an ODBC definition (i.e. Data Source) using the DataDirect drivers, I cannot create one that does everything I need (inserts, deletes, selects, calls to stored procedures). I'm blanking now on which operations fail with EnableSQLDescribeParam turned on or off (they're in the Accelrys support knowledge base), but I've experienced these problems since the adoption of the Data Direct drivers, and they continue with v8.5 (Ton could probably get you the details, if you're interested). Since I have a simple workaround I have not pushed the issue.

The problem I experienced happened on the very first record, and is not as you described (i.e. no repeated values. Just an error.).

HP
HP 2012-08-13

Lee,

Please have Ton forward me some information.

I can't promise anything but I'll see what I can do with it while I am running some tests with 9.0 beta.

Thanks,

MK

SG
SG 2012-08-13

Indeed,

Making search works with this ODBC driver configuration but it makes insert failed without giving explicit data type.

LM
LM 2012-08-13

Hello Lee,

I am guessing the issue you are thinking of is that when inserting the Data Direct drivers derive the type to be inserted by the property type of the first record being substituted for the ? in each batch.  When the first value is a NULL the drivers will fail for subsequent records in that batch since the type is incorrectly set.  There are several workarounds, abd it sounds like you have found ones that suit you.

As for JDBC, you might want to revisit performance in version 8.5 CU1 or higher, as it was in CU1 that we added support for batch inserts via JDBC.  Your experience with this might reflect using the JDBC implementation in an earlier version where this was not yet supported.

Best wishes,

Lynn

LH
LH 2012-08-13

Lynn

Indeed, if the JDBC performance is satisfactory then I would just as well use it all the time - no fooling around with settings. We actually haven't upgraded past 8.5, so this adds to the urgency.

MK

I tried to go back through my emails, but it's confusing. But in the end we have one ODBC definition with EnableSQLDescribeParam and Procedure Returns Results turned on (which we use for just about everything). We use the JDBC driver now to do Deletes and Updates, but in the past I believe we had a definition with the two flags off.

SG
SG 2012-08-13

Thank for your help.

I send only samples in my request. Actually, I haven't space in my global variables and my globals doesn't contains any parenthesis.

I use named parameters for others stored procedures putting this parameters within 'parameter mapping' without any issue, so I'm not that the problem is that.

I tried the same stored procedure with an ODBC(DSN) defined on my pipeline pilot server, using the scitegic 6.0 driver.

It seems that 'EnableSQLDescribeParam' is the key. The issue dissapeared desactivating this option (but other problem appears), and appears again activating this option.

Samuel