DB2 beginner help

This is a discussion on DB2 beginner help within the db2-udb forums in Other Databases category; What is the equalant statement in DB2 for the Oracle sql's below. Thanks PROMPT Please enter the tablespace name for small tables [DATA1]: DEF small_data_ts=&1 CREATE TABLE BONUS ( ENAME VARCHAR2(10 CHAR ), JOB VARCHAR2(9 CHAR), SAL NUMBER, COMM NUMBER )TABLESPACE &&small_data_ts; CREATE TABLE SALGRADE ( GRADE NUMBER, LOSAL NUMBER, HISAL NUMBER )TABLESPACE &&small_data_ts;...

Go Back   Database Forum > Other Databases > db2-udb

Database Forums

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 01-04-2006, 02:54 PM
Default DB2 beginner help

What is the equalant statement in DB2 for the Oracle sql's below.

Thanks

PROMPT "Please enter the tablespace name for small tables [DATA1]: "
DEF small_data_ts=&1

CREATE TABLE BONUS
(
ENAME VARCHAR2(10 CHAR ),
JOB VARCHAR2(9 CHAR),
SAL NUMBER,
COMM NUMBER
)TABLESPACE &&small_data_ts;

CREATE TABLE SALGRADE
(
GRADE NUMBER,
LOSAL NUMBER,
HISAL NUMBER
)TABLESPACE &&small_data_ts;

Reply With Quote
  #2  
Old 01-04-2006, 03:57 PM
Default Re: DB2 beginner help

create table space small_data_ts managed by system using
('d:\small_data_ts')

create table bonus (ename varchar (10), job varchar (10), sal int, comm
int) in small_data_ts

CREATE TABLE SALGRADE (GRADE integer, LOSAL integer, HISAL integer )
in small_data_ts

schaturvedula-at-thegoldensource.com wrote:

> What is the equalant statement in DB2 for the Oracle sql's below.
>
> Thanks
>
> PROMPT "Please enter the tablespace name for small tables [DATA1]: "
> DEF small_data_ts=&1
>
> CREATE TABLE BONUS
> (
> ENAME VARCHAR2(10 CHAR ),
> JOB VARCHAR2(9 CHAR),
> SAL NUMBER,
> COMM NUMBER
> )TABLESPACE &&small_data_ts;
>
> CREATE TABLE SALGRADE
> (
> GRADE NUMBER,
> LOSAL NUMBER,
> HISAL NUMBER
> )TABLESPACE &&small_data_ts;
>

Reply With Quote
  #3  
Old 01-05-2006, 11:59 AM
Default Re: DB2 beginner help

Thanks for the reply. what if i want to provide the tablespace name at execution time instead of having it in the script.

something like

CREATE TABLE BONUS
(
ENAME VARCHAR2(10), JOB VARCHAR2(9), SAL NUMBER, COMM NUMBER )TABLESPACE &&small_data_ts;

where i can enter the tablespace name at runtime.

thanks
Reply With Quote
  #4  
Old 01-05-2006, 12:27 PM
Default Re: DB2 beginner help

You'd have to use whatever scripting language is available from your
operating system (i.e. ksh on UNIX).

schaturvedula-at-thegoldensource.com wrote:

> Thanks for the reply. what if i want to provide the tablespace name at execution time instead of having it in the script.
>
> something like
>
> CREATE TABLE BONUS
> (
> ENAME VARCHAR2(10), JOB VARCHAR2(9), SAL NUMBER, COMM NUMBER )TABLESPACE &&small_data_ts;
>
> where i can enter the tablespace name at runtime.
>
> thanks

Reply With Quote
  #5  
Old 01-05-2006, 12:58 PM
Default Re: DB2 beginner help

Thanks for the reply
Reply With Quote
  #6  
Old 01-05-2006, 01:10 PM
Default Re: DB2 beginner help

This article may also help:

http://www-128.ibm.com/developerwork...07fierros.html

schaturvedula-at-thegoldensource.com wrote:

> Thanks for the reply

Reply With Quote
  #7  
Old 01-06-2006, 02:11 PM
Default Re: DB2 beginner help

One more thing - it you've used TOAD with Oracle, you may want to read
this:

http://www.devx.com/IBMDB2/Article/29615

blair kenneth adamache wrote:

> This article may also help:
>
> http://www-128.ibm.com/developerwork...07fierros.html
>
>
> schaturvedula-at-thegoldensource.com wrote:
>
>> Thanks for the reply

Reply With Quote
Reply


Thread Tools
Display Modes



All times are GMT -4. The time now is 05:18 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Integrated by bbpixel2009 :: jvbPlugin R1013.368.1

Search Engine Friendly URLs by vBSEO 3.1.0
vB Ad Management by =RedTyger=
In an effort to better serve ads to our visitors, cookies are used on Mydatabasesupport.com. For more information, check out our Privacy Policy.