Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Query for just presence of the row in the table

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
nightbuzzz

New User


Joined: 04 May 2007
Posts: 21
Location: kuala lumpur

PostPosted: Tue Aug 09, 2011 1:24 pm    Post subject: Query for just presence of the row in the table
Reply with quote

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
View user's profile Send private message

sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1013
Location: India

PostPosted: Tue Aug 09, 2011 1:50 pm    Post subject:
Reply with quote

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
View user's profile Send private message
nightbuzzz

New User


Joined: 04 May 2007
Posts: 21
Location: kuala lumpur

PostPosted: Tue Aug 09, 2011 2:02 pm    Post subject: Reply to: Query for just presence of the row in the table
Reply with quote

Thnx sushant...

Cheers
Mayank
Back to top
View user's profile Send private message
nightbuzzz

New User


Joined: 04 May 2007
Posts: 21
Location: kuala lumpur

PostPosted: Tue Aug 09, 2011 5:43 pm    Post subject: Query for just presence of the row in the table
Reply with quote

Is there any idea how to handle this query in Cobol program.

This works fine in Spufi.

Thanks
Mayank
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Tue Aug 09, 2011 6:05 pm    Post subject: Re: Query for just presence of the row in the table
Reply with quote

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
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Aug 09, 2011 10:20 pm    Post subject:
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Need Guidance regarding UPDATE query Poha Eater DB2 2 Mon Feb 12, 2018 11:35 pm
No new posts load and delete table through JCL wit... ram_vizag JCL & VSAM 9 Thu Feb 01, 2018 12:47 am
No new posts Unloading DB2 table in CSV format alo... grvtomar COBOL Programming 7 Sun Jan 28, 2018 2:05 am
No new posts Query to skip Max time-stamp and fetc... vickey_dw DB2 8 Sun Jan 28, 2018 1:09 am
No new posts reg query on DYNALLOC feature raghuraman123 SYNCSORT 12 Wed Jan 10, 2018 2:42 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us