tag:blogger.com,1999:blog-18313336.post5019302123324872289..comments2024-03-28T08:40:36.084-04:00Comments on Abhi On Java: Returning data from anonymous PL/SQL blockabhihttp://www.blogger.com/profile/05788965755655733389noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-18313336.post-36029014343643590062008-06-10T06:28:00.000-04:002008-06-10T06:28:00.000-04:00Hi Abhi,,,I got my mistake ,,, there is an error i...Hi Abhi,,,<BR/>I got my mistake ,,, there is an error in PL/SQL block (insert stmt),,, its wrking nw ,,, <BR/>Thank you very much for the useful information in the blogAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-18313336.post-31457082858262704082008-06-10T06:02:00.000-04:002008-06-10T06:02:00.000-04:00Hi Abhi ,,, I did in the same way as u did,,, The ...Hi Abhi ,,, I did in the same way as u did,,, The below is the code snippet ,,,<BR/><BR/> private static String sql = "BEGIN " + "insert into test values (id 4); "<BR/> + "END;";<BR/><BR/> public static void main(String[] args) throws ClassNotFoundException,<BR/> SQLException, Exception {<BR/> Class.forName("oracle.jdbc.driver.OracleDriver");<BR/> String url = "jdbc:oracle:thin:@//10.0.3.183:1521/test";<BR/> Connection conn = DriverManager.getConnection(url, "test", "test");<BR/> Statement stmt = conn.createStatement();<BR/> CallableStatement cstmt = null;<BR/> try {<BR/> cstmt = conn.prepareCall(sql);<BR/> cstmt.executeUpdate();<BR/><BR/> } catch (Exception e) {<BR/> e.printStackTrace();<BR/> }<BR/> stmt.close();<BR/> }<BR/><BR/>This is the exception :<BR/>java.sql.SQLException: ORA-06550: line 1, column 35:<BR/>PL/SQL: ORA-00917: missing comma<BR/>ORA-06550: line 1, column 7:<BR/>PL/SQL: SQL Statement ignored<BR/><BR/>Could u plz help me out on this. mail me to srinivas.eruvanti@gssamerica.com<BR/>Thank you ,,,Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-18313336.post-51432058963872050322007-09-14T17:04:00.000-04:002007-09-14T17:04:00.000-04:00I have a .sql file like following:execute xxx_pack...I have a .sql file like following:<BR/><BR/>execute xxx_package.xxx_procedure;<BR/><BR/>declare<BR/>begin<BR/><BR/>end;<BR/>/<BR/><BR/>declare<BR/>begin<BR/>end;<BR/>/<BR/><BR/>The .sql script is generated dynamically. I need to run this script through JDBC.<BR/><BR/>How should I do it? I try to read the whole script into a string and callablestatement.execute() it. It does not work. Any suggestions? Thanks.Anonymousnoreply@blogger.com