Re: Does Yucon support set ansi_nulls?

From: prabhakar (prabhakarnarvekar_at_msn.com)
Date: 01/27/05


Date: Thu, 27 Jan 2005 17:06:57 +0530

My requirement is such that I need to dynamically consider tables and
compare all fields. Each field has a dynamically generated alias which runs
into a large string. So if I have to compare fields for inequality then the
query select col1 , col2 from tablefornull where col1 <> col2 will become
select col1 , col2 from tablefornull where col1 <> col2 or (col1 is not null
and col2 is null) or (col1 is null and col2 is not null) This at some stage
may reach the maximun limit of query string allowed.

Can I Know the exact maximum limit of query string allowed? Is it
configurable?

Also Coalesse and nullif cannot be used as I don't know what could be a
proper invalid value for any specific field as I get it runtime and also
their datatypes are unknown.

"Louis Davidson" <dr_dontspamme_sql@hotmail.com> wrote in message
news:OHkV8SDBFHA.1564@TK2MSFTNGP09.phx.gbl...
> Then change your query to:
>
> select * from table1 where (field1 = field2 or (field1 is null and field2
> is null))
>
> It is easy, and far more correct. NULL <> NULL and this does not take
> that much more coding :)
>
> --
> ----------------------------------------------------------------------------
> Louis Davidson - drsql@hotmail.com
> SQL Server MVP
>
> Compass Technology Management - www.compass.net
> Pro SQL Server 2000 Database Design -
> http://www.apress.com/book/bookDisplay.html?bID=266
> Note: Please reply to the newsgroups only unless you are interested in
> consulting services. All other replies may be ignored :)
>
> "prabhakar" <prabhakarnarvekar@msn.com> wrote in message
> news:eQYQnCDBFHA.2568@TK2MSFTNGP11.phx.gbl...
>> Hi,
>> I want to compare 2 fields in a table considering the equality of the
>> fields
>> even if NULL.
>> eg:- table1 has fileds field1 and field2
>>
>> field1 field2
>> 1 abc abc
>> 2 pqr NULL
>> 3 NULL lmn
>> 4 NULL NULL
>>
>> query:-
>> select * from table1 where field1 = field2;
>>
>> I want this query to return 2 rows (1 and 4 )but it only returns row 1.
>> Is
>> there any setting or a method by which i get the correct results
>> considering
>> NULLs in comparison. (without handling the is NULL condition in the sql
>> query) ?
>>
>> Does yucon support SET ANSI_NULLS ? Or is there any other way which will
>> give the desired results without altering the query.
>>
>>
>
>



Relevant Pages

  • Re: Union query?
    ... I used that information to build the union query I proposed. ... FROM [qry Normal Lines Compare] as C LEFT JOIN ... Leslie Isaacs wrote: ... Compare] with any matching record data from [qry changed basics]. ...
    (microsoft.public.access.queries)
  • Re: Union query?
    ... Leslie Isaacs wrote: ... I will try your proposed query when I'm back in the office, and will post back here to let you know. ... FROM [qry Normal Lines Compare] as C LEFT JOIN ... The first section query returns all records from with any matching record data from [qry changed basics]. ...
    (microsoft.public.access.queries)
  • Re: Union query?
    ... I used that information to build the union query I proposed. ... FROM [qry Normal Lines Compare] as C LEFT JOIN ... Leslie Isaacs wrote: ... The first section query returns all records from with any matching record data from [qry changed basics]. ...
    (microsoft.public.access.queries)
  • Re: I should give up programming!
    ... I have a lot of code where I'm basically using code to compare two tables in ... " ORDER BY CompanyName" ... into a query for debugging. ... "FROM tblContacts;" ...
    (microsoft.public.access.modulesdaovba)
  • Re: cant think of the query...
    ... Text types compare alphabetically, not numerically, and will not ... might want to do so with a query. ... > ID Location Name Template NewType NewTemplate NewFWVersion ... >> query work like what you need here. ...
    (microsoft.public.access.queries)

Loading