cancel
Showing results for 
Search instead for 
Did you mean: 

Delete an entry from sql-table

Former Member
0 Kudos

Hello,

I get an error message while trying to delete an entry in a sql table using the uSelect command in a java script code:

org.mozilla.javascript.EvaluatorException: uSelect(DELETE FROM testtable WHERE id = '8') got exception com.microsoft.sqlserver.jdbc.SQLServerException: The statement did not return a result set.

Is there an other option to delete specific entries in a table?

Thanks & best Regards,

Carsten

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Carsten,

the problem is that the uSelect command expects a result set that the INSERT command does not deliver. If I rember it correctly, a workaround was to add a select statement to your DELETE command:

uSelect("SELECT 'A'; DELETE FROM testtable WHERE id = '8")

Best regards

Holger

Edited by: Holger Flocken on Oct 1, 2010 3:55 PM

Answers (3)

Answers (3)

Former Member
0 Kudos

Thanks for your answers.

@Holger: This solves my issue

Best Regards,

Carsten

thomas_groth2
Explorer
0 Kudos

Hello,

you could also use a "to database" task with option "sql updating". If you need dynamic attributes in you sql statement you can use context variables or functions in the statement.

Best regards,

Thomas

former_member2987
Active Contributor
0 Kudos

Thomas, this is true but it looks like the original question poits to doing this within a script.

former_member2987
Active Contributor
0 Kudos

Hi there.

Go into your MSSQL and give delete rights on the table to mxmc_rt and mxmc_oper.

That should take care of it.

By default, the mxmc* users do not get access to new tables. On a related topic, if you're going to use a query to populate a singles select attribute, you'll need to add SELECT rights as well.

Hope this helps you out!

Matt