executing a stored procedure
Moderators: chulett, rschirm, roy
executing a stored procedure
I have searched and searched past posts for what I know will be a simple answer - but can't find the answer to my question. It's simple and here it is.... I'm trying to execute a stored procedure but can't quite figure out how to pass in the parameter needed by InsertErrorLog. Here's my osql command line:
[cmd ='osql -S ':SQL_Hostname: ' -d ':SQL_Database:' -U ':SQL_User:' -P ':SQL_Password: ' -Q "InsertErrorLog"]
and I've tried every variation I can think of to pass a parameter here - but nothing I've tried is working.
any suggestions?
thanks a bunch
[cmd ='osql -S ':SQL_Hostname: ' -d ':SQL_Database:' -U ':SQL_User:' -P ':SQL_Password: ' -Q "InsertErrorLog"]
and I've tried every variation I can think of to pass a parameter here - but nothing I've tried is working.
any suggestions?
thanks a bunch
Not sure if its safe. Why ?
Read kcbland's reply here
You can even do this using an odbc stage in a job. It supports IN and IN/OUT parameters?
Any particular reservation why you want to do it via job control? You can even use STP stage if you have 7.5.2
Read kcbland's reply here
You can even do this using an odbc stage in a job. It supports IN and IN/OUT parameters?
Any particular reservation why you want to do it via job control? You can even use STP stage if you have 7.5.2
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Hi -
Unfortunately I am not a premium member - so I can't read the bulk of your response.
As for why I'm not just calling this stored procedure utilizing one of the provided stages - it again goes back to the processing takeing place before this job and the constraints on whether or not this procedure will even be called. I have written a fair amount of code in the job control section - and whether or not this procedure is executed is determined by a simple IfThenElse statement in my code.
I guess it would be of some interest to note that I am running on the server edition of 7.5
thanks
Unfortunately I am not a premium member - so I can't read the bulk of your response.
As for why I'm not just calling this stored procedure utilizing one of the provided stages - it again goes back to the processing takeing place before this job and the constraints on whether or not this procedure will even be called. I have written a fair amount of code in the job control section - and whether or not this procedure is executed is determined by a simple IfThenElse statement in my code.
I guess it would be of some interest to note that I am running on the server edition of 7.5
thanks
Nevermind my previous post. I did not pay attention that you were using a third party tool. Did you try running the osql utility from command line? Does it work? If it does then post the part of the code that executes the stored procedure for debugging help.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Sorry for the delay in making this final post. I finally figured out how to pass the necessary input parameter in the command line - and it works beautifully. It was a matter of getting all the right quotes in the right places ....
[cmd ='osql -S ':SQL_Hostname: ' -d ':SQL_Database:' -U ':SQL_User:' -P ':SQL_Password: ' -Q "exec InsertErrorLog ':"'":expectedparameter:"'":'"']
where the following are all variables defined earlier in the code:
SQL_Hostname, SQL_Database, SQL_User, SQL_Password and expectedparameter
Thanks for your help everyone!
[cmd ='osql -S ':SQL_Hostname: ' -d ':SQL_Database:' -U ':SQL_User:' -P ':SQL_Password: ' -Q "exec InsertErrorLog ':"'":expectedparameter:"'":'"']
where the following are all variables defined earlier in the code:
SQL_Hostname, SQL_Database, SQL_User, SQL_Password and expectedparameter
Thanks for your help everyone!