stored procedure in ODBC Connector Before SQL

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
synsog
Premium Member
Premium Member
Posts: 232
Joined: Sun Aug 01, 2010 11:01 pm
Location: Pune

stored procedure in ODBC Connector Before SQL

Post by synsog »

Hi,

DS 8.7 on Windows

I am trying to call a SP (DB - SQL Server) with one Input Parameter (and it does not return anything) from the BeforeSQL part in the ODBC Connector stage but it throws this error

I tried all these but it still fails
Execute SPNAME(1)
Exec SPNAME(1)
Call SPNAME(1)

Con_ODBC_CampusStage: ODBC function "SQLExecDirect()" reported: SQLSTATE = 42000: Native Error Code = 102: Msg = [Microsoft][SQL Server Native Client 10.0][SQL Server]Incorrect syntax near '.'. (CC_OdbcAdapter::preRun, file CC_OdbcAdapter.cpp, line 434)

Is this supported in the ODBC Connector stage or I am using some incorrect syntax?

Thanks
synsog
Premium Member
Premium Member
Posts: 232
Joined: Sun Aug 01, 2010 11:01 pm
Location: Pune

Post by synsog »

The correct syntax is No Brackets for the parameter

Execute SPNAME 1;

It works fine after that!
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Interesting, certainly needed for other databases. And (a minor correction) those are parenthesis not brackets. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply