Board index » delphi » Delphi 4 and MS-SQL 6.5 ODBC Null Values

Delphi 4 and MS-SQL 6.5 ODBC Null Values

We have run up against a problem with null values over an ODBC
connection to MS SQL Server 6.5. It really has more to do with how a
null is translated or interpreted when being passed off to the server by
ODBC.

We have a stored proc on the server that looks for null value in one the
parameters for decision-making logic. When we run the stored proc in
ISQL it runs fine if the parameter has a null in it. However, if we link
to the stored proc from a Delphi TStoredProc and load the same
parameters, with a null value for the appropriate parameter, it won't
work. It will return column headings, etc, but no dataset. The
interesting thing is that if we use MSQuery, the same thing that occurs
in Delphi happens again.

We traced the calls from the server end to see what was happening with
the call, and the call appears to be coming through correctly. The same
parameters appear in the call to the stored proc, whether from ISQL or
Delphi or MSQuery. The only difference detectable was the appearance of
the 'null' parameter in uppercase in the ISQL call and lower case in the
others.

From all of this, we have been led to think that it may have something
to do with the way ODBC passes parameters. Does anyone have any
experience or information with this issue they could share with us? TIA!

 

Re:Delphi 4 and MS-SQL 6.5 ODBC Null Values


I faced something similar once. I had installed the bate SQL 7 on a machine
along with SQL 6.5. Doing that updated my ODBC driver to a 3.blah blah blah
version. Then I encountered the kind of error you have.
The NULL values were handled wrongly.
I solved it by using the ODBC driver that comes with SQL Server 6.5
(2.65....).

--
Remove ".net" from my email address to contact me.

Quote
Craig Woodard wrote in message <3785F687.D03B5...@atlasvanlines.com>...
>We have run up against a problem with null values over an ODBC
>connection to MS SQL Server 6.5. It really has more to do with how a
>null is translated or interpreted when being passed off to the server by
>ODBC.

>We have a stored proc on the server that looks for null value in one the
>parameters for decision-making logic. When we run the stored proc in
>ISQL it runs fine if the parameter has a null in it. However, if we link
>to the stored proc from a Delphi TStoredProc and load the same
>parameters, with a null value for the appropriate parameter, it won't
>work. It will return column headings, etc, but no dataset. The
>interesting thing is that if we use MSQuery, the same thing that occurs
>in Delphi happens again.

>We traced the calls from the server end to see what was happening with
>the call, and the call appears to be coming through correctly. The same
>parameters appear in the call to the stored proc, whether from ISQL or
>Delphi or MSQuery. The only difference detectable was the appearance of
>the 'null' parameter in uppercase in the ISQL call and lower case in the
>others.

>From all of this, we have been led to think that it may have something
>to do with the way ODBC passes parameters. Does anyone have any
>experience or information with this issue they could share with us? TIA!

Other Threads