MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

comp values select in sql query

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
tomehta
Beginner


Joined: 19 Dec 2003
Posts: 17
Topics: 5

PostPosted: Fri Jun 11, 2004 2:18 am    Post subject: comp values select in sql query Reply with quote

Hi
I have a doubt, there is a varchar in a table which is having some computational values along with the other values, some kind of greek is visible in that column . I want to see the actual values of those in SQL query itself, without using a cobol program.In the varchar we are moving some computional values and some characters. I am able to see the characters but not the computational values. How i can see both in the sql query? I do'nt want to use cobol program.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Fri Jun 11, 2004 5:31 am    Post subject: Reply with quote

Tomehata,

You can use the scalar function LENGTH to get the length of the varchar column

Code:


   SELECT LENGTH(YOUR VARCHAR COLUMN)
     FROM TABLE
        ;


Check this link which will explain in detail about the LENGTH function

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/DSNSQH11/3.2.43?SHELF=&DT=20010718164132&CASE=

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
psridhar
Beginner


Joined: 16 May 2004
Posts: 68
Topics: 26

PostPosted: Wed Jun 23, 2004 2:16 pm    Post subject: Reply with quote

Hi Kolusu,

I could not get your reply. Let me extend how I understand the question. I have a column of varchar(300) in a table T1 in which I store the DCLGEN of a row from another table T2. The varchar column looks as follows.

<DE0006288921...
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Wed Jun 23, 2004 2:48 pm    Post subject: Reply with quote

PSridhar,

You cannot see the data in Spufi. If you have QMF then you can view the data.

Log on to QMF
Press PF6
Type in your Select Query

Ex:
Code:


 SELECT VARCHAR_COLUMN
   FROM TABLE


Press PF2 to execuete the Query

now you will be presented with the results from your query

Press PF9

Now will see a FORM with NUM, COLUMN HEADING, USAGE, INDENT, WIDTH, EDIT and SEQ

Under the EDIT column it is defaulted to C . Now over type XW under the EDIT column and Press Enter

Now Press PF12

Now you can see the contents of the varchar column

Hope this helps...

cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
CZerfas
Intermediate


Joined: 31 Jan 2003
Posts: 211
Topics: 8

PostPosted: Thu Jun 24, 2004 6:12 am    Post subject: Reply with quote

What you can do is get a glimpse of the content of this dubious varchar column via the HEX function in the SELECT clause of your statement. Using that one you can look at the hex values of the column content.

By the way, it is always advisable to store information atomic, that is: one value in one column. Than you are able to use the proper data type definitions.

regards
Christian
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group