Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Tue, 11 Nov 2008 @ 21:23:09 GMT


     
  <Prev Next>   <<First <Prev
Next>
Last>>
 


Subj:   Re: Issue while creating and inserting in teradata tables through java
 
From:   McCall, Glenn David

The error most commonly occurs if you are performing DDL and DML in a single multi-statement request.

For example if you have something like this:

     String sql = "create table a (i1 integer); insert into a values (1);";
     statement.execute (sql);

You need to do this in two steps. First the create (DDL) then the insert (DML). You will get the same error if you did the create followed by a select and there are a number of other variations that can cause the error.

For example:

     String sql = "create table a (i1 integer);";
     statement.executeUpdate (sql);
     ...
     sql = "insert into a values (1);";
     statement.executeUpdate (sql);

Note that you can batch up the DML statements if you like, although that isn't the best way to get data into the table. Example:

     sql = "insert into a values (1); insert into a values (2); insert into a";

I hope this helps

Glenn Mc



     
  <Prev Next>   <<First <Prev
Next>
Last>>
 
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023