Page 1 of 1

stored procedure in ODBC Connector Before SQL

Posted: Wed Mar 20, 2013 10:29 am
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

Posted: Thu Mar 21, 2013 10:55 am
by synsog
The correct syntax is No Brackets for the parameter

Execute SPNAME 1;

It works fine after that!

Posted: Thu Mar 21, 2013 11:27 am
by chulett
Interesting, certainly needed for other databases. And (a minor correction) those are parenthesis not brackets. :wink: