Click here to Skip to main content
15,913,027 members
Home / Discussions / Database
   

Database

 
Generalcrystal reports Pin
Emporer29-Oct-02 11:09
Emporer29-Oct-02 11:09 
GeneralRe: crystal reports Pin
Anonymous1-Nov-02 7:41
Anonymous1-Nov-02 7:41 
GeneralRe: crystal reports Pin
Emporer2-Nov-02 1:20
Emporer2-Nov-02 1:20 
GeneralOracle and UUID Pin
Michael P Butler28-Oct-02 22:22
Michael P Butler28-Oct-02 22:22 
GeneralRe: Oracle and UUID Pin
ian mariano29-Oct-02 2:05
ian mariano29-Oct-02 2:05 
GeneralRe: Oracle and UUID Pin
Rashid Thadha31-Oct-02 6:06
Rashid Thadha31-Oct-02 6:06 
GeneralODBC and Sybase Pin
Big Trev28-Oct-02 0:37
Big Trev28-Oct-02 0:37 
GeneralRe: ODBC and Sybase Pin
Daniel Turini28-Oct-02 1:07
Daniel Turini28-Oct-02 1:07 
Sybase has the most unstable ODBC drivers I've seen so far. Be careful with them.

But what you're seeing is not an ODBC error, this is a common mistake.

This query leads to unpredictable results:

Select * from Table 
where ( (@ID = NULL) or (ID = @ID) )


Because of the expression WHERE field = NULL. The right way of doing a comparison with NULL is with the IS NULL expression.

This query always run as expected:

Select * from Table 
where ( (@ID IS NULL) or (ID = @ID) )


BTW, I think that maybe what you want is this:

Select * from Table 
where ( (ID IS NULL) or (ID = @ID) )


because when @ID is NULL, this condition is true for all rows, so the 1st query will really return all rows

lazy isn't my middle name.. its my first.. people just keep calling me Mel cause that's what they put on my drivers license. - Mel Feik
GeneralRe: ODBC and Sybase Pin
Big Trev28-Oct-02 1:18
Big Trev28-Oct-02 1:18 
Generalbarcode and datarepeater Pin
jld27-Oct-02 13:58
jld27-Oct-02 13:58 
Generalvalidation in windows forms datagrid Pin
jld27-Oct-02 13:55
jld27-Oct-02 13:55 
GeneralRe: validation in windows forms datagrid Pin
Mazdak27-Oct-02 19:19
Mazdak27-Oct-02 19:19 
GeneralRe: validation in windows forms datagrid Pin
jld28-Oct-02 2:44
jld28-Oct-02 2:44 
GeneralRe: validation in windows forms datagrid Pin
Mazdak28-Oct-02 7:50
Mazdak28-Oct-02 7:50 
GeneralSyntax error in my simple UPDATE query!!!! Pin
Rickard Andersson2026-Oct-02 12:50
Rickard Andersson2026-Oct-02 12:50 
GeneralRe: Syntax error in my simple UPDATE query!!!! Pin
Mazdak26-Oct-02 19:48
Mazdak26-Oct-02 19:48 
GeneralRe: Syntax error in my simple UPDATE query!!!! Pin
Rickard Andersson2027-Oct-02 7:30
Rickard Andersson2027-Oct-02 7:30 
GeneralRe: Syntax error in my simple UPDATE query!!!! Pin
Mazdak27-Oct-02 7:44
Mazdak27-Oct-02 7:44 
GeneralRe: Syntax error in my simple UPDATE query!!!! Pin
Rickard Andersson2027-Oct-02 7:49
Rickard Andersson2027-Oct-02 7:49 
GeneralRe: Syntax error in my simple UPDATE query!!!! Pin
Mazdak27-Oct-02 9:32
Mazdak27-Oct-02 9:32 
GeneralRe: Syntax error in my simple UPDATE query!!!! Pin
Rickard Andersson2027-Oct-02 12:04
Rickard Andersson2027-Oct-02 12:04 
GeneralRe: Syntax error in my simple UPDATE query!!!! Pin
Mazdak27-Oct-02 19:02
Mazdak27-Oct-02 19:02 
GeneralRe: Syntax error in my simple UPDATE query!!!! Pin
Rickard Andersson2028-Oct-02 2:08
Rickard Andersson2028-Oct-02 2:08 
GeneralRe: Syntax error in my simple UPDATE query!!!! Pin
David Stone27-Oct-02 19:56
sitebuilderDavid Stone27-Oct-02 19:56 
GeneralRe: Syntax error in my simple UPDATE query!!!! Pin
SimonS27-Oct-02 22:01
SimonS27-Oct-02 22:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.