Dynamically obtain parameter count for a prepared statement
Hi JDBC Gurus,
Given a prepared statement, is there a way to figure out the parameter count at runtime? I need this info. to prompt the user for parameter values at the right time from my GUI tool. Any help will be greatly appreciated.
i don't know of any way to do this put perusing through the API i am wondering what the getMetaData method of PreparedStatement is supposed to do. it says returns the meta data of a ResultSet's columns but i think it could contain info about the parameters for the PreparedStatement. i guess i just don't see why that method is there... anyone?
Similar Messages
-
Need Help: Dynamically displaying parameter values for a procedure.
Problem Statement: Generic Code should display the parameter values dynamically by taking "package name" and "procedure name" as inputs and the values needs to be obtained from the parameters of the wrapper procedure.
Example:
a) Let us assume that there is an application package called customer.
create or replace package spec customer
as
begin
TYPE cust_in_rec_type IS RECORD
cust_id NUMBER,
,cust_name VARCHAR2(25) );
TYPE cust_role_rec_type IS RECORD
(cust_id NUMBER,
role_type VARCHAR2(20)
TYPE role_tbl_type IS TABLE OF cust_role_rec_type INDEX BY BINARY_INTEGER;
Procedure create_customer
p_code in varchar2
,p_cust_rec cust_in_rec_type
,p_cust_roles role_tbl_type
end;
b) Let us assume that we need to test the create customer procedure in the package.For that various test cases needs to be executed.
c) We have created a testing package as mentioned below.
create or replace package body customer_test
as
begin
-- signature of this wrapper is exactly same as create_customer procedure.
procedure create_customer_wrapper
p_code in varchar2
,p_cust_rec customer.cust_in_rec_type
,p_cust_roles customer.role_tbl_type
as
begin
//<<<<<---Need to display parameter values dynamically for each test case-->>>>>
Since the signature of this wrapper procedure is similar to actual app procedure, we can get all the parameter definition for this procedure using ALL_ARGUMENTS table as mentioned below.
//<<
select * from ALL_ARGUMENTS where package_name = CUSTOMER' and object_name = 'CREATE_CUSTOMER'
but the problem is there are other procedures exists inside customer package like update_customer, add_address so need to have generalized code that is independent of each procedure inside the package.
Is there any way to achieve this.
Any help is appreciated.
// >>>>
create_customer
p_code => p_code
,p_cust_rec => p_cust_rec
,p_cust_roles => p_cust_roles
end;
procedure testcase1
as
l_cust_rec customer.cust_in_rec_type ;
l_cust_roles customer.role_tbl_type;
begin
l_cust_rec.cust_id := 1;
l_cust_rec.cust_name := 'ABC';
l_cust_roles(1).cust_id := 1;
l_cust_roles(1).role_type := 'Role1';
create_customer_wrapper
p_code => 'code1'
,p_cust_rec => l_cust_rec
,p_cust_roles => l_cust_role
end;
procedure testcase2
as
l_cust_rec customer.cust_in_rec_type ;
l_cust_roles customer.role_tbl_type;
begin
l_cust_rec.cust_id := 2;
l_cust_rec.cust_name := 'DEF';
l_cust_roles(1).cust_id := 2;
l_cust_roles(1).role_type := 'Role2';
create_customer_wrapper
p_code => 'code2'
,p_cust_rec => l_cust_rec
,p_cust_roles => l_cust_role
end;
end;Not possible to dynamically in a procedure, deal with the parameter values passed by a caller. There is no struct or interface that a procedure can use to ask the run-time to give it the value of the 1st or 2nd or n parameter.
There could perhaps be some undocumented/unsupported method - as debugging code (<i>DBMS_DEBUG</i>) is able to dynamically reference a variable (see Get_Value() function). But debugging requires a primary session (the debug session) and the target session (session being debugged).
So easy answer is no - the complex answer is.. well, complex as the basic functionality for this do exists in Oracle in its DBMS_DEBUG feature, but only from a special debug session.
The easiest way would be to generate the wrapper itself, dynamically. This allows your to generate code that displays the parameter values and add whatever other code needed into the wrapper. The following example demonstrates the basics of this approach:
SQL> -- // our application proc called FooProc
SQL> create or replace procedure FooProc( d date, n number, s varchar2 ) is
2 begin
3 -- // do some stuff
4 null;
5 end;
6 /
Procedure created.
SQL>
SQL> create or replace type TArgument is object(
2 name varchar2(30),
3 datatype varchar2(30)
4 );
5 /
Type created.
SQL>
SQL> create or replace type TArgumentList is table of TArgument;
2 /
Type created.
SQL>
SQL> -- // create a proc that creates wrappers dynamically
SQL> create or replace procedure GenerateWrapper( procName varchar2 ) is
2 procCode varchar2(32767);
3 argList TArgumentList;
4 begin
5 select
6 TArgument( argument_name, data_type )
7 bulk collect into
8 argList
9 from user_arguments
10 where object_name = upper(procName)
11 order by position;
12
13 procCode := 'create or replace procedure Test'||procName||'( ';
14 for i in 1..argList.Count
15 loop
16 procCode := procCode||argList(i).name||' '||argList(i).datatype;
17 if i < argList.Count then
18 procCode := procCode||', ';
19 end if;
20 end loop;
21
22 procCode := procCode||') as begin ';
23 procCode := procCode||'DBMS_OUTPUT.put_line( '''||procName||''' ); ';
24
25 for i in 1..argList.Count
26 loop
27 procCode := procCode||'DBMS_OUTPUT.put_line( '''||argList(i).name||'=''||'||argList(i).name||' ); ';
28 end loop;
29
30 -- // similarly, a call to the real proc can be added into the test wrapper
31 procCode := procCode||'end;';
32
33 execute immediate procCode;
34 end;
35 /
Procedure created.
SQL>
SQL> -- // generate a wrapper for a FooProc
SQL> exec GenerateWrapper( 'FooProc' );
PL/SQL procedure successfully completed.
SQL>
SQL> -- // call the FooProc wrapper
SQL> exec TestFooProc( sysdate, 100, 'Hello World' )
FooProc
D=2011-01-07 13:11:32
N=100
S=Hello World
PL/SQL procedure successfully completed.
SQL> -
Passing values for a prepared statement encounters problem
I have a query which runs fine when executed from sqlplus
SELECT SYSDATE + (INTERVAL '10' MINUTE) FROM dual;
The same query when run using a java statement also works well.
when I use a Prepared statement like
String sql = SELECT SYSDATE + (INTERVAL ? MINUTE) FROM dual;
PreparedStatement ps = this.getPreparedStatement(sql.toString());
ps.setString(1, "10");
and execute I get the following exception
ORA-00920: invalid relational operator
I tried another way which also gives me a similar exception
String timeout = "10";
SELECT SYSDATE + (INTERVAL" + timeout + "MINUTE) FROM dual;
Can anybody tell me why the problem happens. Is anything wrong in passing values dynamically for an 'interval' function in oracle?asokan_srini wrote:
Yes friends
Thanks for the reply. It worked out this way as u said
sql.append("SELECT SYSDATE + (INTERVAL ");
sql.append("'" + Integer.parseInt(timeout) + "' MINUTE) FROM dual");
Mr.masijade said.
First of all, there is no reason to do this command, really, but okay.
There may be scenarios like this to use the command
select * from mytable where (systimestamp - lastUpdateTimestamp) > Interval '10' Minute
Is there any other better way to get all records updated before a certain timestamp?Use Timestamp to create a timestamp and PreparedStatement's setTimestamp(), maybe? -
Correct format for a prepared statement.
Statement myStmt = myCon.createStatement();
String sqlQuery = "SELECT * FROM customer WHERE custName='" + name + "'";
ResultSet mRs = myStmt.executeQuery(sqlQuery);
String sqlQuery = "SELECT * FROM customer WHERE custName= ? ";
PreparedStatement myStmt = myCon.prepareStatement(sqlQuery);
myStmt.setString(1, name);
ResultSet mRs = myStmt.executeQuery(sqlQuery);Is this correct to change the statement into a prepared statement? Because it doen't work, been looking at the prepared statement API and managed to convert my update statement.>
String sqlQuery = "SELECT * FROM customer WHERE
custName= ? ";
PreparedStatement myStmt =
myCon.prepareStatement(sqlQuery);
myStmt.setString(1, name);
ResultSet mRs = myStmt.executeQuery(sqlQuery);Is this correct to change the statement into a
prepared statement? Because it doen't work, been
looking at the prepared statement API and managed to
convert my update statement.Try running the java.sql.PreparedStatement.executeQuery() method that doesn't take any arguments:
ResultSet mRs = myStmt.executeQuery();MOD
ResultSet mRs = myStmt.executeQuery(sqlQuery); -
Error handling in prepared statement batch
Hi,
For a prepared statement batch, it is not possible to know which operation failed. ... You should always perform a ROLLBACK operation in this situation.
For a generic statement batch or callable statement batch, the update counts array is only a partial array containing the actual update counts up to the point of the error. ... You can either commit or roll back the successful operations in this situation, as you prefer.
-- http://otn.oracle.com/docs/products/oracle9i/doc_library/release2/java.920/a96654/oraperf.htm#1056233
But, I want to skip failed operations and continue to excecute the remains of the batch, also, I want to improve application performance, what should I do? Is there any choice?
Best Regards,
Kevin ZhaoAccording to the Oracle docs these are not the only possible values:
Oracle9i JDBC Developer's Guide and Reference
Release 2 (9.2) chapter 12
Performance Extensions
"For a prepared statement batch, it is not possible to know which operation failed. The array has one element for each operation in the batch, and each element has a value of -3. According to the JDBC 2.0 specification, a value of -3 indicates that an operation did not complete successfully. In this case, it was presumably just one operation that actually failed, but because the JDBC driver does not know which operation that was, it labels all the batched operations as failures."
It goes on to say that for a generic statement batch it is possible to know which failed. I would like to know if similar functionality will be available for prepared statement batches in the future. -
MS SQL Server 7 - Performance of Prepared Statements and Stored Procedures
Hello All,
Our team is currently tuning an application running on WL 5.1 SP 10 with a MS
SQL Server 7 DB that it accesses via the WebLogic jConnect drivers. The application
uses Prepared Statements for all types of database operations (selects, updates,
inserts, etc.) and we have noticed that a great deal of the DB host's resources
are consumed by the parsing of these statements. Our thought was to convert many
of these Prepared Statements to Stored Procedures with the idea that the parsing
overhead would be eliminated. In spite of all this, I have read that because
of the way that the jConnect drivers are implemented for MS SQL Server, Prepared
Statments are actually SLOWER than straight SQL because of the way that parameter
values are converted. Does this also apply to Stored Procedures??? If anyone
can give me an answer, it would be greatly appreciated.
Thanks in advance!Joseph Weinstein <[email protected]> wrote:
>
>
Matt wrote:
Hello All,
Our team is currently tuning an application running on WL 5.1 SP 10with a MS
SQL Server 7 DB that it accesses via the WebLogic jConnect drivers.The application
uses Prepared Statements for all types of database operations (selects,updates,
inserts, etc.) and we have noticed that a great deal of the DB host'sresources
are consumed by the parsing of these statements. Our thought was toconvert many
of these Prepared Statements to Stored Procedures with the idea thatthe parsing
overhead would be eliminated. In spite of all this, I have read thatbecause
of the way that the jConnect drivers are implemented for MS SQL Server,Prepared
Statments are actually SLOWER than straight SQL because of the waythat parameter
values are converted. Does this also apply to Stored Procedures???If anyone
can give me an answer, it would be greatly appreciated.
Thanks in advance!Hi. Stored procedures may help, but you can also try MS's new free type-4
driver,
which does use DBMS optimizations to make PreparedStatements run faster.
Joe
Thanks Joe! I also wanted to know if setting the statement cache (assuming that
this feature is available in WL 5.1 SP 10) will give a boost for both Prepared Statements
and stored procs called via Callable Statements. Pretty much all of the Prepared
Statements that we are replacing are executed from entity bean transactions.
Thanks again -
Required Prepared Statement help
Consider the following query
select col2, col3
from table1
where col1 = ?
I can set the bindings for the prepared statement as pStmt.setString(1, value);
but sometimes I need all the rows in the table therefore the query would be like
select col2, col3
from table1
where col1 = col1
I would like to set the first query's bindings for the prepared statement to execute like the second one.
Please do not ask me to create two different queries. I know it is possible to do it and I would appreciate if you can guide me as to how to set the bindings. Thanks,Adam Martin wrote:
Sorry, you cannot treat a bind variable like a bind some of the time and literal SQL text the other part of the time.
How about something like this:
select col2, col3
from table1
where col1 between ? and ?When you want a specific value, you can say "between 23 and 23" and when you want all values, you can put extremes in like "between -999999 and 999999" so that all rows a returned.
This is not to say that this is a great approach, but it seems like it would technically allow you to do what you wanted.This is an EXCELLENT approach to confuse the optimizer & produce poor performance.
I suspect that using the same EXPLAIN PLAN to bring back 1 or and bring back all rows;
will be suboptimal for a subset of all executions. -
Using "IN" clause in prepared statement
I need to set string for an IN clause in a sql query. But I am not able to get the format in which the string to be set.
TABLENAME.COLUMNAME IN ( ? )
preparedStatement.setString( 'A' , 'B' );
It doesn't works
help me out?I need to set string for an IN clause in a sql query.
But I am not able to get the format in which the
string to be set.
TABLENAME.COLUMNAME IN ( ? )
preparedStatement.setString( 'A' , 'B' );
It doesn't works
help me out?You can't do that; the "?" in the SQL for a prepared statement is not used for arbitrary string replacement. Each "?" has to correspond to a data value that will be bound later.
In other words, you can do:
"SELECT * FROM tablename WHERE keyvalue in (?, ?, ?)";
pstmt.setString(1,"A");
pstmt.setString(2,"A");
pstmt.setString(3,"A");There is no way to have a single "?" replaced by a variable-length list. -
Running explain plan on a prepared statement
I'm using IBatis to run queries against an Oracle database. IBatis runs the queries as prepared statements. I want to run explain plan on the prepared statements.
I already have a shim -- a proxy java.sql.Connection object -- that takes the SQL used to create a prepared statement (e.g., "select a, b, c from table d where c = ?"), returns a proxy java.sql.PreparedStatement, and then on the PreparedStatement's execute(), interpolates the bound parameters into the SQL statement, and runs Explain Plan on that (e.g, preparedStatement.setInt(5) is called, followed by preparedStatement.execute(), which results in my proxy running "explain plan for select a, b, c from table d where c = 5;")
Using Spring configuration, I can transparently insert the shim and get explain plans for all queries run through that Connection.
The problem is this: I'm explaining the plan for the SQL with the bound parameters, not necessarily the SQL run for the prepared statement.
Assume that in the above example, there exists an index on column c in table d, and that 5% of d's rows have the value 1, 15% have the value 2, and 80% have the value 3.
For "select a, b, c from table d where c = 1", Oracle will use the index. But for "select a, b, c from table d where c = 3", Oracle will do a full table scan.
What I want to know is what Oracle will do for "select a, b, c from table d where c = ?" when "?" is an unknown, arbitrary value subsequently bound to 1 or to 3.
As I understand it, the query plan for a prepared statement is done once, when the prepared statement is created. At execute time (as I understand it), the query plan is not reformulated based on the actual bound values (though partition pruning is recalculated).
So how can I find out what query plan is actually be used for prepred statement?
Thanks.I already have a shim -- a proxy java.sql.Connection object -- that takes the SQL used to create a prepared statement I believe explain plan is part of PL/SQL rather than external to it.
As such you can pass it via a prepared statement. It is just a matter of getting the syntax correct. And of course collecting the result.
The syntax is going to be be something like the following. You would use it just like you use the existing sql.
begin
select ... from ... where c = ?;
endThe result might be returned a result sets (plural). If so you would need to code appropriately for that. -
Best Practice: Combine prepared statements with ;
Hi,
I would like to know what the best prctice is for combining prepared statements to give the query below
INSERT INTO my_table (value) VALUES (?); SELECT LAST_INSERT_ID()The reason for this is that i have written a simple DB wrapper to handle my database connections and queries based on a property file containing sql strings. I would prefer not to change this wrapper code, but be able to specify combined queries in the sql string if possible.
Thanks in advanceHave you thought about using Batch statements ?
-
Pass table name as parameter in prepared Statement
Can I pass table name as parameter in prepared Statement
for example
select * from ? where name =?
when i use setString method for passing parameters this method append single colon before and after of this parameter but table name should be send with out colon as SQL Spec.
I have another way to make sql query in programing but i have a case where i have limitation of that thing so please tell me is it possible with prepared Statment SetXXx methods or not ?
Thanks
Haroon Idrees.haroonob wrote:
I know ? is use for data only my question is this way to pass table name as parameterI assume you mean "how can I do it?" As I have already answered "is this the way?" with no.
Well, I would say (ugly as it is) String concatenation, or stored procedures. -
Dynamic Prepared statement--pls help
I need to create a prepared statement where i do not know how many parameters( or arguments i.e " ? ") will be passed. The arguments are decided dynamically while runtime...as in i may pass only a single argument or many.
example:
select * from employee_table where employee_id in (?,?....)
in the above query i may only one employee_id or may be more than one.This is decided during run time.I do not want to run a for loop for the number of employee is as this will cause performance issue. can anybody please tell me how these arguments can be generated dynamically
thanks 4 ur help in advanceWhen will you know the emp.Id ?
Reason is Once you get the emp.Id at runtime means you can assign this id to string variable using the comma separator and assigned this string to the query.
Example
String listOfEmpId = "e11,ee23,e55..."; and then use this variable in the query. -
Prepared statement parameter order?
We have prepared statements for insert and update where changing the order of columns in the statement gives different results.
Problem 1:
For an update statements setting 8 column values via preparedStatement.executeUpdate, we got the following exception containing an internal error:
java.sql.SQLException: Interner Fehler: Daten-Array nicht zugewiesen
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:210)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:273)
at oracle.jdbc.dbaccess.DBDataSetImpl._setDBItem(DBDataSetImpl.java:365)
at oracle.jdbc.dbaccess.DBDataSetImpl._bindsRowCompleted(DBDataSetImpl.java:737)
at oracle.jdbc.dbaccess.DBDataSetImpl.rowCompleted(DBDataSetImpl.java:1619)
at oracle.jdbc.driver.OraclePreparedStatement.get_data_for_columns(OraclePreparedStatement.java:2343)
at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:362)
All statement ? parameters where bound correctly.
When we changed the order of the update's set-clauses and of the according setString parameters to the same order the table is created in the database, the statement works fine.
Problem 2:
An insert statement using a VALUES clause with not more than 10 columns works fine independent of the column order.
But if we have a table with more than 10 columns, the insert only works if the columns in the insert statement are in the same order as the database table. Otherwise we got an IndexOutOfBoundsException - looks like a array overflow in an internal array used to sort column indexes...
We are using Oracle 8.1.7 and JDBC 1.2 thin driver.
Anyone else with similar problems?Did you try to define the Parameter name?
Like these:
strSQL="XXX(p_1=>?, p_2=>?,p_3=>?)"
cstmt.setXXX(1,'v1');
cstmt.setXXX(3,'v3');
cstmt.setXXX(2,'v2');
I am suprised, If you have so many parameter, how can you maintain you code if you do not define the parameter names? -
Count of Rows Updated with prepared statement batch
I am using a batch of prepared statements for update operation. (pstmt.executeBatch())
Configuration I am using
WLS 6.1sp2 Connection pool - Oracle Thin driver - TX Datasource
DB - Oracle 8.1.7
The batch update works well i.e data gets updated and committed. BUT I am not
getting back the count of number of rows updated.
Is there any thing more required on WLS side ?
Thanks in AdvanceThe Oracle drivers do not return the updated row counts from batched updates.
Try running the attached program with the thin driver
java Batch oracle.jdbc.driver.OracleDriver jdbc:oracle:thin:@host:port:database user password
You will see that returns -2, which indicates that the number of rows updated is unknown.
This does meet the JDBC spec.
"Harshad Nanal" <[email protected]> wrote in message news:3f8a455f$[email protected]..
>
I am using a batch of prepared statements for update operation. (pstmt.executeBatch())
Configuration I am using
WLS 6.1sp2 Connection pool - Oracle Thin driver - TX Datasource
DB - Oracle 8.1.7
The batch update works well i.e data gets updated and committed. BUT I am not
getting back the count of number of rows updated.
Is there any thing more required on WLS side ?
Thanks in Advance[Batch.java] -
Prepared statement and DELETE returns 0 count
when executing an oracle prepared statement, the count returned is allways 0 for DELETE. However, if doing an INSERT, the count returned is correct
public void CreatePreparePurgeRcdSetArray(String sql, int i, int max, boolean create) throws SQLException,Exception
if (create == true)
if (preparedStatementArray == null)
preparedStatementArray = new PreparedStatement[max];
int scroll_type = getScrollType();
if (sql.compareTo("NOT_USED") == 0)
preparedStatementArray[i] = null;
else
preparedStatement = (connClass.getConn()).prepareStatement(sql);
preparedStatementArray[i] = preparedStatement;
preparedStatement = null;
else
closePrepareStatementArray(max);
public int UpdatePreparePurgeRcdSet(Vector smry, String sqlP, int i) throws SQLException,Exception
Object[] searchs = (Object[])smry.elementAt(0);
/*java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
String aaa = searchs[1].toString();
String aab = searchs[1].toString();
java.util.Date dtx = sdf.parse(aaa);
java.util.Date dty = sdf.parse(aab);
oracle.sql.DATE aa1 = new DATE(new Timestamp(dtx.getTime()));
oracle.sql.DATE aa2 = new DATE(new Timestamp(dty.getTime()));
java.sql.Timestamp ts1 = (java.sql.Timestamp) searchs[1] ;
java.sql.Timestamp ts2 = (java.sql.Timestamp) searchs[5] ;
boolean oracle = true;
boolean debug = true;
if ((oracle == true) && (debug == true))
String sql1 = "INSERT INTO FFI_MASTER_PURGE_TBL values ('lmill', 'OSTDEVT', 'sdsadmin', ?, 30, 60, '0', 2, 'ZZZ', ' ')";
String sql2 = "DELETE FROM TDSADMIN.FFI_MASTER_PURGE_TBL where FORMATCATEGORY = ?";
String sql3 = "DELETE from TDSADMIN.SUMMARY_TBL where (ML_STI_SRC_SYS_CD = ?) AND (ML_STI_CYCLE_CD = ?) AND (ML_STI_FILE_ID = ?)";
preparedStatement = (connClass.getConn()).prepareStatement(sql3);
//preparedStatement.setString(1, "test");
preparedStatement.setString(1, "618");
preparedStatement.setString(2, "0114200601");
preparedStatement.setString(3, "00001591");
oraclePreparedStatement = (OraclePreparedStatement)preparedStatement;
recsDeleted = oraclePreparedStatement.executeUpdate();
if (oracle == true)
preparedStatement = preparedStatementArray;
//oraclePreparedStatement.setExecuteBatch (3);
// ML_STI_SRC_SYS_CD
preparedStatement.setString(1, searchs[0].toString());
// ML_STI_SRCSYS_DTTM
//preparedStatement.setTimestamp(2, ts1);
//preparedStatement.setObject(2, aa1);
// ML_STI_CYCLE_CD
preparedStatement.setString(2, searchs[2].toString());
// ML_STI_FILE_ID
preparedStatement.setString(3, searchs[3].toString());
// ML_STI_LOAD_DTTM
//preparedStatement.setTimestamp(5, ts2);
//preparedStatement.setObject(5, aa2);
else
preparedStatement = preparedStatementArray[i];
// ML_STI_SRC_SYS_CD
preparedStatement.setString(1, searchs[0].toString());
// ML_STI_SRCSYS_DTTM
preparedStatement.setTimestamp(2, ts1);
// ML_STI_CYCLE_CD
preparedStatement.setString(3, searchs[2].toString());
// ML_STI_FILE_ID
preparedStatement.setString(4, searchs[3].toString());
// ML_STI_LOAD_DTTM
preparedStatement.setTimestamp(5, ts2);
DateClass dateClass = new DateClass();
String startTime = dateClass.calToFormattedDateExact();
try
if (oracle == true)
//int batch_val = oraclePreparedStatement.getExecuteBatch();
oraclePreparedStatement = (OraclePreparedStatement)preparedStatement;
recsDeleted = oraclePreparedStatement.executeUpdate();
//recsDeleted = oraclePreparedStatement.sendBatch();
else
recsDeleted = preparedStatement.executeUpdate();
catch(SQLException e)
String err = (e.getMessage()).substring(0,e.getMessage().length()-1);
systemClass.logSqlStatement(sqlP + " : " + err, startTime);
throw e;
Message was edited by:
user539085
Message was edited by:
user539085
Message was edited by:
user539085user539085,
I guess it returns 0 (zero) because it doesn't delete anything. Can you verify that it did delete some records and still returned zero?
Good Luck,
Avi.
Maybe you are looking for
-
Did you know Firefox 4 does not support full frame option in iPlayer or similar?
Both at home & work - using Mac OS 10.5 & 10.6 Firefox 4 will not allow me to view full frame video stream such as BBC iPlayer, 4OD, ITV Player, TVCatchup ....etc, etc. I have now switched to using Safari & Chrome (which work perfectly) but in the in
-
SharePoint 2013 Discussion Board lists wrong name in Reply
Using a basic SharePoint 2013 Discussion Board with Content Approval enabled. Because of Content Approval, all posts/replies must be approved before they are visible. The problem is that SharePoint references the "Modified By" column in the Flat.as
-
QT 7.6.6 image sequence issue
macbook pro running osx 10.9.4 shot about 800 photos (1 every 5 seconds) on my gopro. everytime i open quicktime pro 7.6.6 and open the image sequence, it only grabs one frame. they are numbered sequentially. i had shot 1600 photos of the sunset a fe
-
Desktop Manager 6 fix and broken
Good day A while back I had the System.OutOfMemoryException Laptop Sony x127 Windows 7 32 bit BB Torch 9800 Tuesday I downloaded BB Desktop software. Uninstalled and reinstalled it from the fresh download It worked. Thrilled I synced everything witho
-
I see mention of running Aperture 3 in either 32 bit mode or 64 bits. Can you switch between the two? What are the advantages or otherwise? Regards