473,395 Members | 2,798 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

coalesce?

Hi,

I m trying to use coalesce but i m getting this error below, btw i m using db2 8.2.
what i m doing is;
...
where eh.toblm = coalesce(NULL,eh.toblm)

SQL0206N "NULL " is not valid in the context where it is used.

Actually what i want to do is, get the result of this select statement either @id is NOT NULL or NULL! if @id is NULL then all results should be displayed!
...
where eh.toblm = coalesce(@id,eh.toblm)
Jan 21 '07 #1
0 1342

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Bob Bedford | last post by:
I've a query like this: select coealesce(table1.code1, table2.code1) as mycode from... where mycode = 'XXX' But this query fails. Unknow column mycode in where clause. why ??? "coalesce()...
2
by: Jeff Roughgarden | last post by:
I am using a clever product called SQL Expert Pro to optimize problematic SQL statements. It works by generating syntactically identical variations of the original SQL, finding all unique execution...
3
by: Steffen Vulpius | last post by:
Hi everybody, VARCHAR has a higher precedence than CHAR. If you have a query SELECT COALESCE(c1,c2) FROM T1 where c1 is CHAR(5) and c2 is VARCHAR(10), I would expect the return type to be...
5
by: John Greve | last post by:
Any ideas on why my the result 'green' row column DELTA does not yield -1 for? That is not how I expected COALESCE( ... ) to work. Every other row for DELTA (including 'black') comes out the...
3
by: darrel | last post by:
I have three tables making a many-to-many relationship: Companies CoID | CoName Link CoID | InsID Insurers InsID | InsName
4
by: Don | last post by:
If I have an SQL query which returns an aggregate of several decimal fields like so: (sum(COALESCE(myDecimal1, 0)+ sum(COALESCE(myDecimal2, 0)+ sum(COALESCE(myDecimal3, 0)) as MyTotal I get...
10
by: db2group88 | last post by:
hi, we are using db2 v8.2 EE on windows, with jcc driver. try to create a join view, after that i check the syscat.columns table, for those decimal field use COALESCE method, all the length become...
2
by: raysefo | last post by:
Hi, I m trying to use coalesce but i m getting this error below, btw i m using db2 8.2. what i m doing is; .... where eh.toblm = coalesce(NULL,eh.toblm) SQL0206N "NULL " is not valid in the...
1
by: r035198x | last post by:
This is a short tip describing the sql coalesce function. Description COALESCE accepts a comma separated list of parameters and returns the first value that is not null in that list or null...
1
by: =?Utf-8?B?R1ROMTcwNzc3?= | last post by:
Hi All, is this the correct way to Coalesce a session var - <%Session("EMPLOYETOKENS") = tokens.Fields.Item(COALESCE(SUM("JBCLTokens"),0)).Value%? Thank you
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.