By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,537 Members | 1,471 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,537 IT Pros & Developers. It's quick & easy.

Creating Global Temp Table in UDB DB2 v8

P: n/a
I was unable to run the statement "CREATE GLOBAL TEMPORARY TABLE" on
unix version of DB2, it gave the follwing error

db2 => create global temporary table temp ( OGI_SYS_NR char(8) )
DB21034E The command was processed as an SQL statement because it was
not a
valid Command Line Processor command. During SQL processing it
returned:
SQL0104N An unexpected token "create global temporary table temp (
OGI_S" was
found following "BEGIN-OF-STATEMENT". Expected tokens may include:
"<values>". SQLSTATE=42601

Can we create "Create Global Temporary Table" n unix version of DB2. I
donot want to create "Declared Global Temporary Table".

Any pointers on this would be of great help
Thanks,
Ranga
Nov 12 '05 #1
Share this Question
Share on Google+
10 Replies


P: n/a
Try DECLARE ... see the SQL Reference Manual.

Larry Edelstein

Ranga wrote:
I was unable to run the statement "CREATE GLOBAL TEMPORARY TABLE" on
unix version of DB2, it gave the follwing error

db2 => create global temporary table temp ( OGI_SYS_NR char(8) )
DB21034E The command was processed as an SQL statement because it was
not a
valid Command Line Processor command. During SQL processing it
returned:
SQL0104N An unexpected token "create global temporary table temp (
OGI_S" was
found following "BEGIN-OF-STATEMENT". Expected tokens may include:
"<values>". SQLSTATE=42601

Can we create "Create Global Temporary Table" n unix version of DB2. I
donot want to create "Declared Global Temporary Table".

Any pointers on this would be of great help
Thanks,
Ranga


Nov 12 '05 #2

P: n/a
Ranga,

No can do. Why can't you use a declared global temp?

Cheers
Serge
--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab
Nov 12 '05 #3

P: n/a
Reference links only...

http://www.craigsmullins.com/zjdp_004.htm

Declared temporary tables, new to V7, complement the capability to create
global temporary tables (introduced in DB2 V5).

Quick doc link to compare both
http://publib.boulder.ibm.com/cgi-bi...RCHINDEX=INDEX

PM
"Serge Rielau" <sr*****@ca.eye-be-em.com> a écrit dans le message de
news:c2**********@hanover.torolab.ibm.com...
Ranga,

No can do. Why can't you use a declared global temp?

Cheers
Serge
--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab

Nov 12 '05 #4

P: n/a
PM (pm3iinc-nospam) <PM(pm3iinc-nospam)@sympatico.ca> wrote:
Reference links only...

http://www.craigsmullins.com/zjdp_004.htm

Declared temporary tables, new to V7, complement the capability to create
global temporary tables (introduced in DB2 V5).

Quick doc link to compare both

http://publib.boulder.ibm.com/cgi-bi...RCHINDEX=INDEX

CREATE is not (yet) supported on DB2 for workstations and it seems that
working on such a platform. You would have to use DB2 for zOS to have this
feature available.

--
Knut Stolze
Information Integration
IBM Germany / University of Jena
Nov 12 '05 #5

P: n/a
I'm well aware of the differences :-) I'm asking for two reasons:
1. Is there a viable alternative for the OP
2. How big is the need to get support for this feature for the OP (and
others for that matter)

Cheers
Serge

--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab
Nov 12 '05 #6

P: n/a

I only dumped related links for those interested in the thread.
I was replying to the thread and not necessarely to individuals.
My mistake, i should have replied to the main thread and not under Serge's
post.

Knut >>
I know it's a mainframe feature, the link i provided gives
Ranked Search Results for Book: dsnsqh13 "DB2 UDB for OS/390 and z/OS V7 SQL
Reference"
in the header. (maybe i should have included it in my post.)

serge >> I'm well aware of the differences :-)
Shame on me if i ever think you don't know something... or can't learn it in
5 mins. ;-)

PM
Nov 12 '05 #7

P: n/a
PM (pm3iinc-nospam) <PM(pm3iinc-nospam)@sympatico.ca> wrote:
Knut >>
I know it's a mainframe feature, the link i provided gives
Ranked Search Results for Book: dsnsqh13 "DB2 UDB for OS/390 and z/OS V7
SQL Reference"
in the header. (maybe i should have included it in my post.)


PM, and I know that you know. But I got the impression that the OP didn't
know so I wanted to clarify things. ;-)

--
Knut Stolze
Information Integration
IBM Germany / University of Jena
Nov 12 '05 #8

P: n/a
Knut Stolze <st****@de.ibm.com> wrote in message news:<c2**********@fsuj29.rz.uni-jena.de>...
PM (pm3iinc-nospam) <PM(pm3iinc-nospam)@sympatico.ca> wrote:
Reference links only...

http://www.craigsmullins.com/zjdp_004.htm

Declared temporary tables, new to V7, complement the capability to create
global temporary tables (introduced in DB2 V5).

Quick doc link to compare both

http://publib.boulder.ibm.com/cgi-bi...RCHINDEX=INDEX

CREATE is not (yet) supported on DB2 for workstations and it seems that
working on such a platform. You would have to use DB2 for zOS to have this
feature available.


Hi,
We are developing on Unix UDB DB2 and deploying it on z/OS DB2. Could
you please let me know if create global temporary table feature is not
available in Unix UDB DB2. We have to use Create global temporary
table in our project and i know that it is supported in z/OS.
Thanks,
Ranga
Nov 12 '05 #9

P: n/a
Ranga <ra*******@infosys.com> wrote:
We are developing on Unix UDB DB2 and deploying it on z/OS DB2. Could
you please let me know if create global temporary table feature is not
available in Unix UDB DB2. We have to use Create global temporary
table in our project and i know that it is supported in z/OS.


That's what I tried to say: CREATE GLOBAL TEMPORARY TABLE is available on
DB2 for z/OS but it is not (yet) available for DB2 for Linux, Unix,
Windows.

--
Knut Stolze
Information Integration
IBM Germany / University of Jena
Nov 12 '05 #10

P: n/a
Ranga wrote:
We are developing on Unix UDB DB2 and deploying it on z/OS DB2. Could
you please let me know if create global temporary table feature is not
available in Unix UDB DB2. We have to use Create global temporary
table in our project and i know that it is supported in z/OS.
Thanks,
Ranga

Good answer I can work with that as a requirement :-)
Knut is correct. What customer do is to encapsulate teh DECLARED global
temp DDL inside of a stored procedure.
When you move to DB2 z/Series all you need to do is remove the CALL.
(or you can do the call and tolerate the syntax error from DB2 z)

Cheers
Serge
--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab
Nov 12 '05 #11

This discussion thread is closed

Replies have been disabled for this discussion.