|
|
|
Junior Member
      
Group: Forum Members
Last Login: 7/7/2008 2:17:32 AM
Posts: 24,
Visits: 90
|
|
Hi,
I need to create multiple stored procedures in a single script, i mean
I am having definitions of 5 stored procedures.Individually they get created but when same definitions are executed in batch then the following Error Occurs
"Only an ET or null statement is legal after a DDL Statement. "
If anyone knows the solution please let me know..
Thanks
Satish Gaikwad
|
|
|
|
|
Supreme Being
      
Group: Forum Members
Last Login: Today @ 8:21:59 AM
Posts: 159,
Visits: 461
|
|
Hello,
If you are using BTEQ script for batch, you can use ".COMPILE FILE sp1.sql" to compile the SP.
Regards,
Adeel
|
|
|
|
|
Junior Member
      
Group: Forum Members
Last Login: 7/7/2008 2:17:32 AM
Posts: 24,
Visits: 90
|
|
Thanks for Reply,
I am using Teradata SQL Assistant for creation of the stored procedures.They get created if executing individually but i need to execute all in a batch.
Thanks
Satish Gaikwad
|
|
|
|
|
Supreme Being
      
Group: Forum Members
Last Login: Today @ 8:21:59 AM
Posts: 159,
Visits: 461
|
|
For my information, how can you write a batch in SQL Assistant?
And can't you write a BTEQ script for a batch task?
Regards,
Adeel
|
|
|
|
|
Junior Member
      
Group: Forum Members
Last Login: 7/7/2008 2:17:32 AM
Posts: 24,
Visits: 90
|
|
Hi ,
IF I am executing following three statements at a time then they get executed even if executed individually then they also get executed as like same I need to create 5 stored procedure
CREATE TABLE ALFCT_STATICCHANNEL(
STATICCHANNELID Decimal(18,0) NOT NULL,
STATICCHANNELTYPE varchar(256) NULL)
PRIMARY INDEX ( STATICCHANNELID );
CREATE TABLE ALENT_ARTWORKCAMPAIGN(
CAMPAIGNID Decimal(18,0) NOT NULL,
CAMPAIGNNAME varchar(255) NULL,
VALIDTO Timestamp NULL,
CAMPAIGNTYPE varchar(100) NULL)
PRIMARY INDEX ( CAMPAIGNID );
CREATE TABLE ALFCT_STOCK(
STOCKID Decimal(18,0) NOT NULL,
STOCKLEVEL Decimal(18,0) NULL,
MINORDERLEVEL Decimal(18,0) NULL)
PRIMARY INDEX ( STOCKID );
For my information will you please tell me how to create/Execute the batch in BTEQ.
Satish Gaikwad
|
|
|
|
|
Supreme Being
      
Group: Forum Members
Last Login: Today @ 8:21:59 AM
Posts: 159,
Visits: 461
|
|
It should work, this way in SQL Assistant as well, e.g I just tried following on V12:
create procedure sp1()
begin
...
end;
create procedure sp2()
begin
...
end;
create procedure sp3()
begin
...
end;
In case of BTEQ scripts, suppose you are working in a folder "C:\SPTest" and you have saved all definitions (starting from "Create" till "End;") of all SPs in seperate files (e.g. sp1.spl, sp2.spl, sp3.spl) in the same folder, following BTEQ script will compile all three in batch mode:
.LOGON server ip/login,pass;
.DATABASE database;
.COMPILE FILE = sp1.spl;
.COMPILE FILE = sp2.spl;
.COMPILE FILE = sp3.spl;
.LOGOFF;
HTH.
Regards,
Adeel
|
|
|
|
|
Junior Member
      
Group: Forum Members
Last Login: 7/7/2008 2:17:32 AM
Posts: 24,
Visits: 90
|
|
Thanks,
I am using Teradata SQL Assistant 7.1
Satish Gaikwad
|
|
|
|