Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Regarding a SQL Query

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: Regarding a SQL Query
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    Post subject:
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    Post subject: Re:SQL Query
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: 31
Location: visakhapatnam

PostPosted: Thu Apr 07, 2005 5:18 pm    Post subject: Re: Regarding a SQL Query
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    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 Join in SQL Query vickey_dw DB2 2 Tue Jan 17, 2017 12:15 am
This topic is locked: you cannot edit posts or make replies. MQ setup query mohitsaini Java & MQSeries 4 Sun Jan 08, 2017 1:53 am
No new posts DB2 query Using Recursion, Converting... smilewithashu2 DB2 1 Tue Jan 03, 2017 12:50 pm
No new posts SQL query to run through list of valu... Ni3-db2 DB2 14 Wed Dec 14, 2016 9:52 am
This topic is locked: you cannot edit posts or make replies. Db2 SQL query to convert rows into co... subratarec DB2 5 Thu Nov 17, 2016 4:51 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us