IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Regarding a SQL Query


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ashwinreddy

Active User


Joined: 16 Sep 2004
Posts: 106
Location: Hyderabad

PostPosted: Wed Apr 06, 2005 4:57 pm
Reply with quote

Hi

i have a problem with a query

my purpose is to
when a user enters both code no and group no the control should pass to another screen

let me clear u about my query their may be subgroups in a code no so i have to validate whether the correct subgroup has been entered to code no,
i need help regarding this query, i had written a query but it seems it doesn't work properly

SELECT CD

FROM table-name

WHERE cd = :WK-CD

and sub-cd like 'wk-sub-cd%' ;


please come up with a query

you can amil to ***Removed***

Thanks & Regards
Ashwin
Back to top
View user's profile Send private message
ovreddy

Active User


Joined: 06 Dec 2004
Posts: 211
Location: Keane Inc., Minneapolis USA.

PostPosted: Wed Apr 06, 2005 5:47 pm
Reply with quote

Hi Ashwin,

Quote:
Just clisk on Quick Register and fill the profile details to become a member. No conformation is required. The membership is free to all.


Coming to your query really to say its not clear. But as I understood you have a code lets take person MBNISS split into 3 parts. You want to validate each part before executing the query. If my thoughts are matching with your query please validate the parts of code seperately using COBOL code then only execute in query. Because DB2 resources are costly and if your code contains junk data then your program will get abend.

Eg:
IF WS-MBNIS1 IS NUMERIC AND WS-MBNIS2 IS NUMERIC AND WS-MBNIS3 IS NUMERIC
EXEC-SQL
-- query --
END-EXEC
ELSE
DISPLAY "ERROR IN MBNISS"
END-IF.

If your que is not same as above please send us your code so that we will understand it properly.

Thanks,
Reddy.
Back to top
View user's profile Send private message
ashwinreddy

Active User


Joined: 16 Sep 2004
Posts: 106
Location: Hyderabad

PostPosted: Thu Apr 07, 2005 10:17 am
Reply with quote

Hi

Thanks for the suggestion but my client needs in a query.

Let me explain u in detail

i have a 9digit unique numer which is assigned to stores and under that code number we have sub groups as like gws233,f3eesd1

so when a user enters the cobe number and sub group.i should check whether a subgroup entered is contained in code numer.if their is no valid subgroup in cde number i have to display a error message.

For this i have to write a query.

i feel this is clear to you all and i am expecting a quick reply.


Thanks
Ashwin
Back to top
View user's profile Send private message
rsm_deepak

New User


Joined: 06 Apr 2005
Posts: 30
Location: visakhapatnam

PostPosted: Thu Apr 07, 2005 5:18 pm
Reply with quote

Please give the details of ur db tables in brief.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts RC query -Time column CA Products 3
No new posts Dynamically pass table name to a sele... DB2 2
No new posts Query on edit primary command CLIST & REXX 5
No new posts Query on edit primary command CLIST & REXX 1
No new posts Issue with EXEC CICS QUERY SECURITY c... CICS 6
Search our Forums:

Back to Top