Craete table ?

Database
Enthusiast

Craete table ?

Hi folks,

The below generic scripts creats a table {tmpdb1}.{tag1} but during the run time i need to repalace with actual table named item_daily_sales ,could you please tell me how can i do it?

Actual table Name: item_daily_sales

.SET ERRORLEVEL 3807 SEVERITY 0
;
DROP TABLE {tmpdb1}.{tag1}
;
CREATE MULTISET TABLE {tmpdb1}.{tag1}
,NO FALLBACK
,NO BEFORE JOURNAL
,NO AFTER JOURNAL
(
loc_nbr CHAR(5) CHARACTER SET LATIN NOT CASESPECIFIC NOT NULL,
itm_nbr CHAR(8) CHARACTER SET LATIN NOT CASESPECIFIC NOT NULL,
transaction_dt DATE FORMAT 'YYYYMMDD' NOT NULL,
offer_nbr INTEGER,
net_nonpromo_wo_vat_amt DECIMAL(9,2) NOT NULL,
net_nonpromo_abat_contrib DECIMAL(9,2) NOT NULL)
PRIMARY INDEX ( loc_nbr ,itm_nbr ,transaction_dt )
;
.QUIT
1 REPLY
Enthusiast

Re: Craete table ?

Try this
dbase=$0
tname=$1
.
.
.
.
create multiset table $dbase.$tname
.
.
.
.
Let me know if this works