ODBiC Discussion Board


RE: How to insert/update NULL via stored procedure in SQL 2005 server, Gordon Hsu, 07-07-2006

Try this...

by Roger Harris, July 7, 2006 11:21

Text data in SQL statements needs to be enclosed in single-quotes (apostrophes), but the NULL keyword should not be. To get single-quotes in the output from the $if function, you need to enclose the value in double-quotes, which makes the single-quotes ordinary characters. (Character string values in ODBscript can be enclosed in either single- or double-quotes, as in HTML, and whichever is used, the other type of quote will be treated as an ordinary character in the string.)

So, I think this should work:

<!--SQL StoredProcName $IF($Var$,"'$Var$'",NULL) -->

Replies:


Post Your Reply:

Name   
E-mail  optional
Topic  
Message:

HTTP Link: 
Link text: 

          


Copyright ©1997-2003, Roger Harris. All rights reserved.