473,398 Members | 2,125 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

How to get structure of temporary table ?

Hi
Db2UDB version 8.2
Is possible difrent way than this

DECLARE TT
as select * from session.TT
definition only;

Nov 12 '05 #1
4 4749
zbychu wrote:
Hi
Db2UDB version 8.2
Is possible difrent way than this

DECLARE TT
as select * from session.TT
definition only;

db2 => connect to test;

Database Connection Information

Database server = DB2/NT 8.2.0
SQL authorization ID = SRIELAU
Local database alias = TEST

db2 => declare global temporary table t(c1 int);
DB20000I The SQL command completed successfully.
db2 => describe select * from session.t;

SQLDA Information

sqldaid : SQLDA sqldabc: 896 sqln: 20 sqld: 1

Column Information

sqltype sqllen sqlname.data
sqlname.length
-------------------- ------ ------------------------------
--------------
497 INTEGER 4 C1
2

Will that do?

Cheers
Serge
Nov 12 '05 #2
Thanks ,bat
"
SQL-statement
All executable SQL statements can be contained within the body of
an SQL procedure, with the exception of the following:

* ALTER
* CONNECT
* CREATE any object other than indexes, tables, or views
* DESCRIBE
...
"

Serge Rielau wrote:
zbychu wrote:
Hi
Db2UDB version 8.2
Is possible difrent way than this

DECLARE TT
as select * from session.TT
definition only;

db2 => connect to test;

Database Connection Information

Database server = DB2/NT 8.2.0
SQL authorization ID = SRIELAU
Local database alias = TEST

db2 => declare global temporary table t(c1 int);
DB20000I The SQL command completed successfully.
db2 => describe select * from session.t;

SQLDA Information

sqldaid : SQLDA sqldabc: 896 sqln: 20 sqld: 1

Column Information

sqltype sqllen sqlname.data sqlname.length
-------------------- ------ ------------------------------
--------------
497 INTEGER 4 C1 2

Will that do?

Cheers
Serge


Nov 12 '05 #3
Touche`.
take a look at samples/cli/tbread.C
search for SQLDescribeCol()
Should be easy to masage to what you need.
And then you can post the solution here :-)

Cheers
Serge
Nov 12 '05 #4
Serge Rielau wrote:
Touche`.

Arghh... I misspell even in French :-(
Nov 12 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Corrine | last post by:
Hi, I am creating a global temporary table that is session-specific. I insert a BLOB into this table, and then select the BLOB from this table into a ResultSet. The ResultSet sees this BLOB...
5
by: Jim Garrison | last post by:
Scenario: 1) Create a GLOBAL TEMPORARY table and populate it with one (1) row. 2) Join that table to another with about 1 million rows. The join condition selects a few hundred rows. ...
0
by: Jim Moseby | last post by:
I stumbled across this while trying to update a table with a timestamp type column. At the time, I didn't know that the timstamp column would update itself when a row was changed. A kind gentleman...
4
by: gonzal | last post by:
Hi Dose any body know why a temporary table gets deleted after querying it the first time (using SELECT INTO)? When I run the code bellow I'm getting an error message when open the temp table...
4
by: D Witherspoon | last post by:
I have a Structure I have created and am using it as a Public Property of a class. Here is the property. ------------------------------------------------------ Dim _MyID As SInteger Public...
14
by: | last post by:
When we have a structure in the following form typedef struct { int I1; int I2; int I3; int I4; float F1; float F2; float F3;
11
by: randi_clausen | last post by:
Using SQL against a DB2 table the 'with' key word is used to dynamically create a temporary table with an SQL statement that is retained for the duration of that SQL statement. What is the...
7
by: Larry | last post by:
Hi, I have unbelievable problems just to save a record! I make an input to a record in a subform, which has a temporary table as its recordsource. When I am done, and want to save the...
5
by: Adam W. Saxton | last post by:
We have a few existing stored procedures which create a Global Temporary Table (##), do some work on the table and then delete the table. The issue we have is that if our Server application is...
1
by: Caspian | last post by:
Dear All, I'm attempting to create a query that will transpose repeated fields into a single table structure. Can anyone think of how this can be done as I'm stumped at the minute? I'd like to...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.