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
 
Concern related to SQL Result and access path

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

New User


Joined: 22 May 2005
Posts: 8

PostPosted: Wed May 02, 2007 12:41 pm    Post subject: Concern related to SQL Result and access path
Reply with quote

Hello all,
Please see the scenario below. If i write a query like

SELECT * FROM POPR.VHIS WHERE COMPANY_NO = 4
AND TERMINAL = 1 ;
The result of this query doesn't fetch any rows.

But if i write a SQL like this
SELECT * FROM POPR.VHIS WHERE COMPANY_NO = 4;
will fetch quite a number of records of which some is having a value
TERMINAL = 1.

TERMINAL is a S9(2)V COMP-3 field. Inother words DECIMAL 2.

Does this have anything to do with the access path. If yes, how do i know what went wrong ?
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: Wed May 02, 2007 9:24 pm    Post subject:
Reply with quote

Hello,

How are you displaying the "one" after the select for "COMPANY_NO = 4"?

Might it be that the "one" is stored differently than it displays? What is the definition of the TERMINAL field in various places?

Have you tried to change yor query to "TERMINAL < 2"? This would be for testing and not necessarily for long-term use.
Back to top
View user's profile Send private message
mithun123

New User


Joined: 13 Apr 2006
Posts: 11

PostPosted: Thu May 03, 2007 8:51 am    Post subject: Re: Concern related to SQL Result and access path
Reply with quote

Hi tetrion,
Can u define a working storage variable as
01 HOST-TERMINAL PIC S9(2)V COMP-3.
pass the value 1 to this variable and use this in the SQL. I believe this would work. Can you please try this and let me know whether this works or not. U can also use the DCLGEN variable for the same . I believe when you are checking with fileaid for the rows that retrieved by the second query the terminal value is shown as '1.' not '1'.


Thanks and Regards,
Mithun
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 User access certification In Mainfram... Virendra Shambharkar All Other Mainframe Topics 4 Tue Oct 03, 2017 12:32 pm
No new posts how to see when the last read access ... Mike 1304 DB2 1 Tue Sep 12, 2017 7:52 pm
No new posts Question related to Data dictionary f... rexx77 SYNCSORT 3 Thu Aug 31, 2017 7:23 am
This topic is locked: you cannot edit posts or make replies. Limit access to certain RACF group cvnlynn CLIST & REXX 5 Wed Aug 23, 2017 2:28 am
No new posts find RACF group for access to spooled... jzhardy JCL & VSAM 1 Mon May 08, 2017 11:46 am

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