18 January 2026:
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
This forum is now archived and is in read-only mode. Please continue discussions on our improved new Sahi Pro Community forum.
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
How do we delete specific record from Database or excel
Hi,
How do we delete specific record from Database or excel using sahi.
I tried to delete the specific record but not succeeded.
Please do share the information if any have ...
Regards
Raja
How do we delete specific record from Database or excel using sahi.
I tried to delete the specific record but not succeeded.
Please do share the information if any have ...
Regards
Raja
Comments
Can you post the script, that you used to delete the record from Database or excel using Sahi?
There should be some error displayed on the sahi console.Can you post the error too?
Regards,
Theeran.
I am using below code to delete specific record form Excel.
var db2 = _getDB("sun.jdbc.odbc.JdbcOdbcDriver", "jdbc:odbc:Driver={Microsoft Excel Driver (*.xls)}; DBQ=C://Users//XXXX//sahi_pro//userdata//scripts//onetwo.xls ;readOnly=false", "", "");
db2.update("delete from [Sheet1$] where Name123='QA tools'" );
Please correct if any mistake in code.
Below error copied from console.
at org.mozilla.javascript.Context.evaluateString(Context.java:1104)
at net.sf.sahi.rhino.RhinoScriptRunner.run(RhinoScriptRunner.java:144)
at java.lang.Thread.run(Unknown Source)
ql.SQLException: [Microsoft][ODBC Excel Driver] Deleting data in a linked
is not supported by this ISAM.
at sun.jdbc.odbc.JdbcOdbc.createSQLException(Unknown Source)
at sun.jdbc.odbc.JdbcOdbc.standardError(Unknown Source)
at sun.jdbc.odbc.JdbcOdbc.SQLExecDirect(Unknown Source)
at sun.jdbc.odbc.JdbcOdbcStatement.execute(Unknown Source)
at sun.jdbc.odbc.JdbcOdbcStatement.executeUpdate(Unknown Source)
at net.sf.sahi.plugin.DBClient.execute(DBClient.java:56)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:161)
at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:2
at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:33
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2487)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.
4)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:30
at org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.
5)
at org.mozilla.javascript.Context.evaluateString(Context.java:1104)
at net.sf.sahi.rhino.RhinoScriptRunner.run(RhinoScriptRunner.java:144)
at java.lang.Thread.run(Unknown Source)
Please reply..
Regards
Raja