View previous topic :: View next topic
|
Author |
Message |
nightbuzzz
New User
Joined: 04 May 2007 Posts: 21 Location: kuala lumpur
|
|
|
|
Hi,
I am looking for a query which just returns the presence of a particular data in the table.
For eg:- i want to search a string 'DB2' in a table. The qury should return a value as YES or NO. Means whether a string is present in the table or not, just this info.
I don't want to fetch any data but just the presence of data in the table.
Thanks in advance.
Mayank |
|
Back to top |
|
|
sushanth bobby
Senior Member
Joined: 29 Jul 2008 Posts: 1020 Location: India
|
|
|
|
Mayan,
1 - Success
SQLCODE=-100 meaning, naaaa
Code: |
select 1 from creator.tablename
where column like '%DB2%'
fetch first 1 row only
|
Buzzing Out,
Sushanth |
|
Back to top |
|
|
nightbuzzz
New User
Joined: 04 May 2007 Posts: 21 Location: kuala lumpur
|
|
|
|
Thnx sushant...
Cheers
Mayank |
|
Back to top |
|
|
nightbuzzz
New User
Joined: 04 May 2007 Posts: 21 Location: kuala lumpur
|
|
|
|
Is there any idea how to handle this query in Cobol program.
This works fine in Spufi.
Thanks
Mayank |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
nightbuzzz wrote: |
Is there any idea how to handle this query in Cobol program.
This works fine in Spufi.
Thanks
Mayank |
For a Senior Software Engineer that should be very simple, it would take less time then posting the question here! |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
Is there any idea how to handle this query in Cobol program. |
Yes, imbed the query in a cobol program. . .
As mentioned, this should be trivial. . . Where/why are you stuck? Have you or no one else ever written a cobol/db2 program. I suspect there are many on your system you might use as an example. . . |
|
Back to top |
|
|
|