dbTalk Databases Forums  

execution of multiple DDL statements from .net

comp.databases comp.databases


Discuss execution of multiple DDL statements from .net in the comp.databases forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Tara database Guidliance
 
Posts: n/a

Default execution of multiple DDL statements from .net - 02-01-2008 , 07:26 AM






hi i want to execute following satement in .net

TDStrSQL = "create volatile table tab1(somename varchar(100)) on
commit preserve rows;create volatile table tab2(somenames
varchar(100)) on commit preserve rows;" 'insert into tab1 values
('a'); insert into tab2 values ('b'); select * from tab1 union select
* from tab2;"


TDODBCcn.Open()
TDODBCcmdSelect = New Odbc.OdbcCommand(TDStrSQL, TDODBCcn)

TDODBCdtr = TDODBCcmdSelect.ExecuteReader

and database is teradata i the error is

ERROR [25000] [NCR][ODBC Teradata Driver][Teradata Database] Only an
ET or null statement is legal after a DDL Statement.

Reply With Quote
  #2  
Old   
Ed Prochak
 
Posts: n/a

Default Re: execution of multiple DDL statements from .net - 02-01-2008 , 09:20 AM






On Feb 1, 7:26*am, Tara database Guidliance <meetsati... (AT) gmail (DOT) com>
wrote:
Quote:
hi i want to execute following satement in .net

TDStrSQL = "create volatile table tab1(somename varchar(100)) on
commit preserve rows;create volatile table tab2(somenames
varchar(100)) on commit preserve rows;" 'insert into tab1 values
('a'); insert into tab2 values ('b'); select * from tab1 union select
* from tab2;"

TDODBCcn.Open()
* * * * TDODBCcmdSelect = New Odbc.OdbcCommand(TDStrSQL, TDODBCcn)

* * * * TDODBCdtr = TDODBCcmdSelect.ExecuteReader

and database is teradata i the error is

ERROR [25000] [NCR][ODBC Teradata Driver][Teradata Database] Only an
ET or null statement is legal after a DDL Statement.
Looks like a teradata constraint, not a .net error. You need an ET or
a NULL statement;
(What's an ET?? End Transaction?, IOW a commit?) It looks like it
means you cannot have both DDL (CREATE) and DML (INSERT, SELECT) in
the same transaction.


Why are you creating tables from the application?
Tables should be designed and implemented outside applications (with a
few exceptions).

So what is the business problem you are trying to solve???

Ed


Reply With Quote
  #3  
Old   
Ed Prochak
 
Posts: n/a

Default Re: execution of multiple DDL statements from .net - 02-01-2008 , 09:20 AM



On Feb 1, 7:26*am, Tara database Guidliance <meetsati... (AT) gmail (DOT) com>
wrote:
Quote:
hi i want to execute following satement in .net

TDStrSQL = "create volatile table tab1(somename varchar(100)) on
commit preserve rows;create volatile table tab2(somenames
varchar(100)) on commit preserve rows;" 'insert into tab1 values
('a'); insert into tab2 values ('b'); select * from tab1 union select
* from tab2;"

TDODBCcn.Open()
* * * * TDODBCcmdSelect = New Odbc.OdbcCommand(TDStrSQL, TDODBCcn)

* * * * TDODBCdtr = TDODBCcmdSelect.ExecuteReader

and database is teradata i the error is

ERROR [25000] [NCR][ODBC Teradata Driver][Teradata Database] Only an
ET or null statement is legal after a DDL Statement.
Looks like a teradata constraint, not a .net error. You need an ET or
a NULL statement;
(What's an ET?? End Transaction?, IOW a commit?) It looks like it
means you cannot have both DDL (CREATE) and DML (INSERT, SELECT) in
the same transaction.


Why are you creating tables from the application?
Tables should be designed and implemented outside applications (with a
few exceptions).

So what is the business problem you are trying to solve???

Ed


Reply With Quote
  #4  
Old   
Ed Prochak
 
Posts: n/a

Default Re: execution of multiple DDL statements from .net - 02-01-2008 , 09:20 AM



On Feb 1, 7:26*am, Tara database Guidliance <meetsati... (AT) gmail (DOT) com>
wrote:
Quote:
hi i want to execute following satement in .net

TDStrSQL = "create volatile table tab1(somename varchar(100)) on
commit preserve rows;create volatile table tab2(somenames
varchar(100)) on commit preserve rows;" 'insert into tab1 values
('a'); insert into tab2 values ('b'); select * from tab1 union select
* from tab2;"

TDODBCcn.Open()
* * * * TDODBCcmdSelect = New Odbc.OdbcCommand(TDStrSQL, TDODBCcn)

* * * * TDODBCdtr = TDODBCcmdSelect.ExecuteReader

and database is teradata i the error is

ERROR [25000] [NCR][ODBC Teradata Driver][Teradata Database] Only an
ET or null statement is legal after a DDL Statement.
Looks like a teradata constraint, not a .net error. You need an ET or
a NULL statement;
(What's an ET?? End Transaction?, IOW a commit?) It looks like it
means you cannot have both DDL (CREATE) and DML (INSERT, SELECT) in
the same transaction.


Why are you creating tables from the application?
Tables should be designed and implemented outside applications (with a
few exceptions).

So what is the business problem you are trying to solve???

Ed


Reply With Quote
  #5  
Old   
Tara database Guidliance
 
Posts: n/a

Default Re: execution of multiple DDL statements from .net - 02-04-2008 , 01:44 AM



thanks for reply

Actually my other and major part of the project is related to this so
is there any setting available in BTEQ or other in SQL assiestient to
execute it, so i proceed


reply


Reply With Quote
  #6  
Old   
Tara database Guidliance
 
Posts: n/a

Default Re: execution of multiple DDL statements from .net - 02-04-2008 , 01:44 AM



thanks for reply

Actually my other and major part of the project is related to this so
is there any setting available in BTEQ or other in SQL assiestient to
execute it, so i proceed


reply


Reply With Quote
  #7  
Old   
Tara database Guidliance
 
Posts: n/a

Default Re: execution of multiple DDL statements from .net - 02-04-2008 , 01:44 AM



thanks for reply

Actually my other and major part of the project is related to this so
is there any setting available in BTEQ or other in SQL assiestient to
execute it, so i proceed


reply


Reply With Quote
  #8  
Old   
Ed Prochak
 
Posts: n/a

Default Re: execution of multiple DDL statements from .net - 02-04-2008 , 08:47 AM



On Feb 4, 6:44 am, Tara database Guidliance <meetsati... (AT) gmail (DOT) com>
wrote:
Quote:
thanks for reply

Actually my other and major part of the project is related to this so
is there any setting available in BTEQ or other in SQL assiestient to
execute it, so i proceed

reply
Well then you may have to find a teradata group since this appears to
be Teradata specific.

But I do question again the design that requires creating tables on-
the-fly. You are headed into a database administration nightmare doing
what you propose. Talk to your Teradata DBA. Please.

Sorry I cannot offer more help. I have not yet used Teradata.

Ed


Reply With Quote
  #9  
Old   
Ed Prochak
 
Posts: n/a

Default Re: execution of multiple DDL statements from .net - 02-04-2008 , 08:47 AM



On Feb 4, 6:44 am, Tara database Guidliance <meetsati... (AT) gmail (DOT) com>
wrote:
Quote:
thanks for reply

Actually my other and major part of the project is related to this so
is there any setting available in BTEQ or other in SQL assiestient to
execute it, so i proceed

reply
Well then you may have to find a teradata group since this appears to
be Teradata specific.

But I do question again the design that requires creating tables on-
the-fly. You are headed into a database administration nightmare doing
what you propose. Talk to your Teradata DBA. Please.

Sorry I cannot offer more help. I have not yet used Teradata.

Ed


Reply With Quote
  #10  
Old   
Ed Prochak
 
Posts: n/a

Default Re: execution of multiple DDL statements from .net - 02-04-2008 , 08:47 AM



On Feb 4, 6:44 am, Tara database Guidliance <meetsati... (AT) gmail (DOT) com>
wrote:
Quote:
thanks for reply

Actually my other and major part of the project is related to this so
is there any setting available in BTEQ or other in SQL assiestient to
execute it, so i proceed

reply
Well then you may have to find a teradata group since this appears to
be Teradata specific.

But I do question again the design that requires creating tables on-
the-fly. You are headed into a database administration nightmare doing
what you propose. Talk to your Teradata DBA. Please.

Sorry I cannot offer more help. I have not yet used Teradata.

Ed


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.