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

Doubt regarding DESCRIBE TABLE


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

Active User


Joined: 18 Jun 2007
Posts: 213
Location: Cochin/Kerala/India

PostPosted: Thu Jul 02, 2009 9:57 am
Reply with quote

Hi All,
I have a doubt in the DECRIBE which is used in SQL.
I am using DESCRIBE TABLE with BOTH option and output is populating to the SQLDA.
I want to know what will be the value in SQLNAME field.Is it will be the column name and i saw a statement that if we use BOTH the occurence will be double.What will be in the second occurence.
Can anone give the example.
I searched in the manuals but i am not able to understand what will be value in each field.If someone gives me the example it will be great.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Jul 02, 2009 10:16 am
Reply with quote

Hello,

Please post the exact syntax you are working with along with any diagnostic info or unexpected results. Once everyone is "on the same page", some suggestions may arrive.
Back to top
View user's profile Send private message
bipinpeter

Active User


Joined: 18 Jun 2007
Posts: 213
Location: Cochin/Kerala/India

PostPosted: Thu Jul 02, 2009 10:30 am
Reply with quote

Hi Dick,
Here is syntax which i am working.

Code:
EXEC SQL
DESCRIBE TABLE :XYZ
INTO :SQLDA
USING BOTH
END-EXEC
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Jul 02, 2009 10:42 am
Reply with quote

Hello,

What happens when you execute this? Do you get a syntax error, an abend, some unexpected result?

In addition to that bit of source, you need to post anything else that relates to this task.
Back to top
View user's profile Send private message
bipinpeter

Active User


Joined: 18 Jun 2007
Posts: 213
Location: Cochin/Kerala/India

PostPosted: Thu Jul 02, 2009 10:48 am
Reply with quote

Hi Dick,
I am analyzing one program and i saw this code in that.I cant execute that program.But i want to know the result of this.I want infor like below.
If i have a table EMP and columns as below

EMPNO CHAR(5)
EMPNAME CHAR(15)
EMPPH CHAR(10)

What will be the data in SQLDA if DECRIBE TABLE with BOTH option is applied on this table?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Jul 02, 2009 10:57 am
Reply with quote

Hello,

See if the info here will help:
publib.boulder.ibm.com/iseries/v5r2/ic2924/index.htm?info/db2/rbafzmstsqldda.htm
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Thu Jul 02, 2009 11:01 am
Reply with quote

Have a look here: DESCRIBE Command.
Back to top
View user's profile Send private message
bipinpeter

Active User


Joined: 18 Jun 2007
Posts: 213
Location: Cochin/Kerala/India

PostPosted: Thu Jul 02, 2009 11:11 am
Reply with quote

Hi Anuj,
I read the the doc which you provided.
My understanding is that if DESCRIBE executed on the above table i will get below result

SQL NAME SQLLEN
EMPNO 5
EMPNAME 7
EMPPH 5

Please conform that my understanding is correct or not
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Jul 02, 2009 7:16 pm
Reply with quote

Hello,

Quote:
I cant execute that program.But i want to know the result of this.
Suggest you put this in some test code and run that. . .
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Jul 02, 2009 8:13 pm
Reply with quote

or SPUFI...............
Back to top
View user's profile Send private message
bipinpeter

Active User


Joined: 18 Jun 2007
Posts: 213
Location: Cochin/Kerala/India

PostPosted: Fri Jul 03, 2009 8:48 am
Reply with quote

In SPUFI the describe is not working
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Jul 03, 2009 9:00 am
Reply with quote

Hello,

Do NOT post "it is not working". What have you provided for anyone to help. . .

If you won't post the problem, i suspect that no one can help. . .
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 Load new table with Old unload - DB2 DB2 6
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Multiple table unload using INZUTILB DB2 2
No new posts Check data with Exception Table DB2 0
No new posts Dynamically pass table name to a sele... DB2 2
Search our Forums:

Back to Top