Hello Marius,

the JDBC standard distinguishes between statements which
return result sets (aka queries) which should be executed
with executeQuery, and statements which return nothing or
a count of affected rows (such as INSERT, UPDATE, DELETE, or 
some DDL), which are executed via executeUpdate.

If you don't know what you are executing (e.g. cause
an user entered a statement), you can use simply 'execute'
and check the result - true means a query, false a row count,
getResultSet resp. getRowCount can be called afterwards to
get the statement's result.

Thus, there is nothing wrong with the driver here.

Regards

Alexander Schr�der 
SAP Labs Berlin


> -----Original Message-----
> From: Augenstein, Marius 
> Sent: Tuesday, October 15, 2002 1:19 PM
> To: [EMAIL PROTECTED]
> Subject: SQL Statement generates a row count
> 
> 
> Hy all
> 
> I'm currently trying to use SAP DB's JDBC driver to insert 
> some data into our database. So when I'm trying to send the 
> the following statement (which runs fine in SQL Studio) I'm 
> getting an exception "SQL Statement generates a row count":
> 
> 
> INSERT INTO XYZ (ID, SID, HOST_NAME, INSTANCE_NAME) VALUES 
> (XYZ_SEQ.NEXTVAL, 'SAP', 'xyz.wdf.sap-ag.de', 'M00')
> 
> com.sap.dbtech.jdbc.exceptions.SQLExceptionSapDB: SQL 
> Statement generates a row count
>  at 
> com.sap.dbtech.jdbc.StatementSapDB.executeQuery(StatementSapDB
> .java:311)
>  at jedicol.DBConnection.ExecuteStmt(DBConnection.java:317)
>  at jedicol.DBConnection.InsertUpdate(DBConnection.java:306)
>  at jedicol.jedicol.write2pdb(jedicol.java:859)
> 
> 
> "XYZ_SEQ.NEXTVAL" means a sequence in the DB only for 
> calculating an unique ID.
> 
> Does anybody know what the problem could be ?? What is that 
> error message meaning ??
> 
> Thanks in advance, Marius
> _______________________________________________
> sapdb.general mailing list
> [EMAIL PROTECTED]
> http://listserv.sap.com/mailman/listinfo/sapdb.general
> 
_______________________________________________
sapdb.general mailing list
[EMAIL PROTECTED]
http://listserv.sap.com/mailman/listinfo/sapdb.general

Reply via email to