dbTalk Databases Forums  

SP and parameters

comp.databases.sybase comp.databases.sybase


Discuss SP and parameters in the comp.databases.sybase forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
tom
 
Posts: n/a

Default SP and parameters - 02-18-2004 , 06:46 AM






folks,

is there any way of determining the number of parameters passed to a
stored procedure, and if more than expected are passed what they are?


Thanks in advance.

Tom...

Reply With Quote
  #2  
Old   
Bret Halford
 
Posts: n/a

Default Re: SP and parameters - 02-18-2004 , 02:16 PM






tom (AT) themurphyhouse (DOT) fsnet.co.uk (tom) wrote in message news:<2bcb0752.0402180446.4b62a6bb (AT) posting (DOT) google.com>...
Quote:
folks,

is there any way of determining the number of parameters passed to a
stored procedure, and if more than expected are passed what they are?


Thanks in advance.

Tom...

Not in ASE. Additional parameters are simply ignored.

One can create one additional parameter with a default value.
If the proc is called with any other value raise
a "too many parameters passed" error in that case.

-bret


Reply With Quote
  #3  
Old   
Bret Halford
 
Posts: n/a

Default Re: SP and parameters - 02-18-2004 , 10:47 PM



bret (AT) sybase (DOT) com (Bret Halford) wrote in message news:<34c88f2b.0402181216.13ea7541 (AT) posting (DOT) google.com>...
Quote:
tom (AT) themurphyhouse (DOT) fsnet.co.uk (tom) wrote in message news:<2bcb0752.0402180446.4b62a6bb (AT) posting (DOT) google.com>...
folks,

is there any way of determining the number of parameters passed to a
stored procedure, and if more than expected are passed what they are?


Thanks in advance.

Tom...


Not in ASE. Additional parameters are simply ignored.

One can create one additional parameter with a default value.
If the proc is called with any other value raise
a "too many parameters passed" error in that case.

-bret
Actually, thinking about it, I find I need to amend my answer.
If you write the procedure so it takes up to the maximum number
of parameters, and all the parameters in excess of what is "expected"
have a default value, then you can indeed determine what was passed
in for all the extra parameters, simply by examining them. I doubt
this is really a desirable approach, though, except perhaps for
some very unusual troubleshooting occasions.

-bret


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.