You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by navrsale <na...@yahoo.ca> on 2006/11/22 01:14:09 UTC

executing several delete statements as one

hi,

I am trying to execute these Oracle delete statements with no parameters as
one pl/sql block:

TabsDelete.xml:
...
  <statement id="tabsDelete">
  <![CDATA[
     BEGIN 
        delete from a_tab; 
        delete from b_tab; 
        delete from c_tab; 
        commit; 
      END;
  ]]>
  </statement>

using this statement:

...
int ret = sqlMapClient.update( "tabsDelete" );

but the statement fails showing error:

[ERROR] com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in TabsDelete.xml.
--- The error occurred while applying a parameter map.
--- Check the tabsDelete-InlineParameterMap.
--- Check the statement (update failed).
--- Cause: java.sql.SQLException: ORA-06550: line 1, column 28:
PL/SQL: ORA-00942: table or view does not exist
ORA-06550: line 1, column 16:
PL/SQL: SQL Statement ignored
PL/SQL: ORA-00942: table or view does not exist
ORA-06550: line 1, column 24:
PL/SQL: SQL Statement ignored
PL/SQL: ORA-00942: table or view does not exist
ORA-06550: line 1, column 32:
PL/SQL: SQL Statement ignored

complaining that these three tables do not exist, but tables are there and I
can execute pl/sql block from sql client with no problem.
Any idea what's wrong with TabsDelete.xml or update statement?
-- 
View this message in context: http://www.nabble.com/executing-several-delete-statements-as-one-tf2682692.html#a7483011
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.


RE: executing several delete statements as one

Posted by Randy Layman <Ra...@vocalocity.com>.
I'm pretty sure you don't need the BEGIN/END tags or the commit.  You
want:
 
  <statement id="tabsDelete">
  <![CDATA[
        delete from a_tab; 
        delete from b_tab; 
        delete from c_tab; 
  ]]>
  </statement>

	Randy

-----Original Message-----
From: navrsale [mailto:navrsalemile@yahoo.ca] 
Sent: Tuesday, November 21, 2006 7:14 PM
To: user-java@ibatis.apache.org
Subject: executing several delete statements as one


hi,

I am trying to execute these Oracle delete statements with no parameters
as one pl/sql block:

TabsDelete.xml:
...
  <statement id="tabsDelete">
  <![CDATA[
     BEGIN 
        delete from a_tab; 
        delete from b_tab; 
        delete from c_tab; 
        commit; 
      END;
  ]]>
  </statement>

using this statement:

...
int ret = sqlMapClient.update( "tabsDelete" );

but the statement fails showing error:

[ERROR] com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in TabsDelete.xml.
--- The error occurred while applying a parameter map.
--- Check the tabsDelete-InlineParameterMap.
--- Check the statement (update failed).
--- Cause: java.sql.SQLException: ORA-06550: line 1, column 28:
PL/SQL: ORA-00942: table or view does not exist
ORA-06550: line 1, column 16:
PL/SQL: SQL Statement ignored
PL/SQL: ORA-00942: table or view does not exist
ORA-06550: line 1, column 24:
PL/SQL: SQL Statement ignored
PL/SQL: ORA-00942: table or view does not exist
ORA-06550: line 1, column 32:
PL/SQL: SQL Statement ignored

complaining that these three tables do not exist, but tables are there
and I can execute pl/sql block from sql client with no problem.
Any idea what's wrong with TabsDelete.xml or update statement?
--
View this message in context:
http://www.nabble.com/executing-several-delete-statements-as-one-tf26826
92.html#a7483011
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.