Page 1 of 1

Stored procedure when executed in before sql does not work

Posted: Thu Oct 31, 2019 6:26 am
by xch2005
Hi,

Hope all are doing great. We migrated 8.5 version of jobs (Unix env.) to 11.5 version (Linux env.) recently. We are having trouble with a job that is executing a SQL Server stored procedure from ODBC connector. The same job runs fine in 8.5 but in 11.5 job completes but does perform the required activity, it completes in 0.02 sec in 11.5 version and takes 3 mins in 8.5.

Code: Select all

ODBC connector -> peek 
The design is simple and straight forward, ODBC connector and peek, just kicks off the SQL Server stored procedure in the "Before SQL" section.

Used this in the Before SQL section:

Code: Select all

Begin
exec dbname.dbo.sp_name
End;
Please note this code is working fine in 8.5 version.

Could you please let me know if anything is missing or needs correction for having it run in 11.5 version?

Thanks in advance.

Posted: Fri Nov 01, 2019 6:43 am
by chulett
Assuming you meant to say "but does not perform the required activity", yes? The new timing would certainly indicate it is doing nothing mighty fast but a bit surprised no error is generated if there's a problem. Have you checked to see if you are missing any fixpacks for your version?

Posted: Mon Nov 04, 2019 1:55 pm
by xch2005
Yes, that is correct, it was a typo. I meant that "does NOT perform the required activity".

The version that I have is 11.5.0.2.

Unfortunately not getting a clue on why the job behaves like this.

Thanks.

Posted: Tue Nov 05, 2019 5:42 am
by qt_ky
Once upon a time with the Oracle Connector stage, I found that I had to CALL the SP instead of EXEC the SP. Hope that helps. The end.

Posted: Tue Nov 05, 2019 2:18 pm
by xch2005
I tried to use CALL instead of EXEC to run the stored procedure (in ODBC connector) and unfortunately that did not work either.

Posted: Wed Nov 06, 2019 5:51 am
by qt_ky
Have you compared the ODBC driver being used and the driver settings?

Have you tried an ODBC trace?

Have you opened a support case?

Posted: Wed Nov 06, 2019 6:09 am
by chulett
You never answered the fixpack question and definitely need to open a support case if you haven't done so already.

Posted: Sun Dec 01, 2019 12:56 am
by jerome_rajan
xch2005 wrote:I tried to use CALL instead of EXEC to run the stored procedure (in ODBC connector) and unfortunately that did not work either.
Try wrapping your SP with a BEGIN ... END. The workaround worked for me

Posted: Mon Dec 02, 2019 5:07 am
by chulett
Also known as an "anonymous block".

Posted: Mon Dec 02, 2019 5:08 am
by chulett
Also known as an "anonymous block".