|
-
Aug 28th, 2001, 10:37 AM
#1
Thread Starter
Lively Member
optional parameter command object
Using the ADO DataEnvironment... How do I get the optional parameters for a command object to work? I went to the Properties of the command object and named my parameters.. then set required to false and put a value there (basically, the default... this is what MSDN says to do).. but in code, if i dont pass one of the optional parameters, i get an error stating that the required paremeters have not been passed. Is there maybe a placeholder that I need to be using here in my call to the command object..
Help please
-gb
-
Aug 28th, 2001, 10:41 AM
#2
Optional parameters exist in the Stored Procedure where you can set it up:
Code:
CREATE PROCEDURE TestProc (@IDCol varchar(11) = NULL) AS
--If you don't pass the parameter it will be considered as NULL
IF @IDCol = NULL
select count(au_id) from authors
ELSE
select count(au_id) from authors where au_id = @IDCol
-
Aug 28th, 2001, 10:43 AM
#3
Thread Starter
Lively Member
this holds true for stored procedures, but what about command objects in the dataenvironment?
In addition to being null if it is not passed to the procedure, can you set a default value other than null.. say a wildcard like %?
Thanks for your response
-gb
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|