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
 
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 HEX value search in a DB2 query maxsubrat DB2 2 Wed Oct 04, 2017 3:04 pm
No new posts Create procedure issues -628 when add... chandraBE DB2 1 Mon Sep 18, 2017 12:16 pm
No new posts Can we limit length in concatenation ... balaji81_k DB2 7 Tue Aug 22, 2017 2:50 am
No new posts Need DB2 query to fetch previous row ! Chandan1993 DB2 10 Sat Jun 03, 2017 10:43 am
No new posts JCL to Set Return code based on DB2 S... vinu78 DB2 17 Mon Mar 13, 2017 9:47 pm

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