Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6931813
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:37:33+00:00 2026-05-27T11:37:33+00:00

We have an old application that reads in SQL text files and sends them

  • 0

We have an old application that reads in SQL text files and sends them to Sybase ASE 12.51. Our legacy app was written in Delphi 5 and is using the BDE TQuery component for this process and accessing Sybase with the BDE SQLinks for Sybase.

Pseudo code:

SQLText=readSQLFile;
aTQuery.SQL.add(SQLText);
aTQuery.ExecSQL;

Recently we moved our DB access layer to the Delphi XE ADO implementation – TADOQuery, using the Sybase supplied ADO provider, still using same model:

SQLText=readSQLFile;
aTADOQuery.SQL.add(SQLText)
aTADOQuery.ExecSQL;

After migrating to ADO, we discovered that certain data was missing. We traced the failure to this SQL construct:

Select myColumn from myTable 
Where  tranID = null

Knowing that this construct is sematically questionable at best, I did a ‘double take’ when I saw this code, but Sybase 12.5 accepts it – however using ADO, this segment fails.

We decided to change:

Where  tranID = null

to

Where  tranID is null

Then the missing data was loaded – problem solved, for this segment and several others as well.

Does anyone have an explanation for this behavior? Where/why did ADO apparently intercept and reject this seqment whereas the BDE passed it thru?

TIA

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T11:37:34+00:00Added an answer on May 27, 2026 at 11:37 am

    “NULL” has a very special meaning, and SQL needs a special handling. You can’t compare a value to “NULL”, that’s why there is the special operator IS (NOT) NULL to check for it. An exhaustive explanation would take some space, here a simple explanation.

    From a “mathematical” point of view, NULL can be thought as “infinity”. You can’t compare two infinite values easily, for example think about the set of integer numbers and even numbers. Both are infinite, but it seems logical the former is larger than the latter. All you can say IS both sets are infinite.

    That’s also helps to explain for example why 1 + NULL returns NULL and so on (usually only aggregate functions like SUM() ecc. may ignore NULL values – ignore, not turn NULLs into zeroes).

    This metaphor may not hold true in sorting, because some databases choose to consider NULL less than any value (some kind of -infinity and thereby returning them first in ascending order), other the other way round. Some have an option to set where to return NULLs.

    Check your database documentation about NULL arithmetics and NULL comparisons. field = NULL should have never been used, don’t know if Sybase accepts it, but most SQL implementations don’t, and I guess it is not SQL standards compliant. It is far better to get used to the IS (NOT) NULL syntax.

    Update: Sybase has a “set ansinull” option, from the documentation (always RTFM!), in 12.5.1 it was expanded to disallow the ‘= NULL’ syntax (when set to ON to make it compliant with SQL standards). When set to OFF ‘= NULL’ works as ‘IS NULL’.

    Maybe the SQL Links or the ADO provider set it to one value or the other.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a bunch of *.TBC files from a very old application that runs
Imagine that I have a C# application that edits text files. The technique employed
I have a complex database conversion console app that reads from an old database,
I have a 3yr old application that has some controllers with some very unrestful
I have an old (around 5 years) enterprise application that I manage. Recently we
I have some old code (an old but still maintained VB6 application) that from
I have a rails application that about 3 years old, and I'm having a
I have an old function that is called many times in my application. I
I have recently written an application(vb.net) that stores and allows searching for old council
I have an old legacy application around for which I only have the installer.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.