If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Passing nulls or empty strings to SP

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-07-02, 11:08
xMANIGHTx xMANIGHTx is offline
Registered User
 
Join Date: Jul 2002
Location: Italy
Posts: 2
Passing nulls or empty strings to SP

Is there a simple way to pass a null value or empty string to a Stored Proc parameter?

Say I have:

sqlCmd.Parameters.Append sqlCmd.CreateParameter("@AN_EMAIL_1", adVarChar, adParamInput, Len(strAN_EMAIL_1), strAN_EMAIL_1)

The ASP code won't work if either strAN_EMAIL_1 is "" or null. And this even before of calling the SP. So it won't work to have @AN_EMAIL_1 varchar(50) = NULL defined in the SP

Thanx in advance...

I just had a nasty Idea... trying this: Len(strAN_EMAIL_1)+1 (since I use varchar shouldn't be a problem when I have not empty strings.. will it work?)
Reply With Quote
  #2 (permalink)  
Old 07-07-02, 11:13
xMANIGHTx xMANIGHTx is offline
Registered User
 
Join Date: Jul 2002
Location: Italy
Posts: 2
With Len(...) + 1 it won't work the same...

ADODB.Parameters errore "800a0e7c'

L'oggetto Parameter non è stato definito correttamente. Le informazioni fornite sono incoerenti o incomplete.

(Parameter object it's not defined correctly. Data submitted is incoherent or missing)
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On