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
 

 

Doubt regarding DESCRIBE TABLE

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: Doubt regarding DESCRIBE TABLE
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

Site Director


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

PostPosted: Thu Jul 02, 2009 10:16 am    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Thu Jul 02, 2009 10:42 am    Post subject:
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    Post subject:
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

Site Director


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

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

Hello,

See if the info here will help:
http://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

Senior Member


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

PostPosted: Thu Jul 02, 2009 11:01 am    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Thu Jul 02, 2009 7:16 pm    Post subject:
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: 6968
Location: porcelain throne

PostPosted: Thu Jul 02, 2009 8:13 pm    Post subject:
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    Post subject:
Reply with quote

In SPUFI the describe is not working
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: Fri Jul 03, 2009 9:00 am    Post subject:
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    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 Loading data to table gives wrong for... Raghu navaikulam DB2 18 Thu Jul 13, 2017 2:11 pm
No new posts unload data from table with lob columns farhad_evan DB2 1 Sat Apr 22, 2017 1:32 pm
No new posts Data replication from multiple Db2 ta... kishpra DB2 9 Mon Mar 27, 2017 9:58 pm
No new posts how to send just 10 rows in a CICS sc... Megha Gupta CICS 5 Thu Feb 23, 2017 6:57 pm
No new posts Join of more than one table dibyendumandal11111 DB2 6 Mon Feb 13, 2017 11:36 pm


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