Passing NULL values through Data Environment Command

Passing NULL values through Data Environment Command

Post by Richard Campbel » Thu, 20 May 1999 04:00:00



I am trying to insert a record into a table on SQL server using a Data
Enviroment Command object whose source is a parameterized stored procedure.
The underlying table allows nulls in several fields. When I execute the
command with any of the parameters set to null I get a runtime error
"Invalid use of Null".
I have tried setting the required property of the affected parameters to
false but it made no difference.
I also ran SQL Trace and verified that SQL server is never contacted to
execute the stored procedure.

As a simple test I created the following stored procedure:

    Create Procedure NullTest
     (

     )
    AS
         return

And a command object with the following call syntax:
    {? = CALL dbo.NullTest( ?) }

When I execute the following line I get the "Invalid use of Null" error.

 lngRetVal = DE.dbo_NullTest(Null)

Does anyone know how I can pass null values through to the stored procedure?