Sidebar

How to use DB Delete / Truncate

0 votes
407 views
asked Apr 28, 2014 by (120 points)

I need to execute a delete or truncate command, i have permissions in the DB to delete and truncate with the user that is connected on the database connections, if i go to sql server i can delete the table using delete from tbl_XXX and it runs correctly, but when trying to run it from qvera using 

var queryResult = qie.doQuery("DBTest", "delete from tbl_BarDataPaymentsRefunds;");

I get this error:

[line: 2] [func: 1 line: 1] NoResultsException: com.microsoft.sqlserver.jdbc.SQLServerException: The DELETE permission was denied on the object 'tbl_XXX', database 'XXXXX', schema 'dbo'.
Query: delete from tbl_XXX;  in <Unknown Source> at line number 2
 
Does the qie.doQuery run delete / truncate commands?
 

1 Answer

0 votes

Yes, but it requires the correct permissions and user mapping.  This is how I usually map the user to the QIE database in MS SQL SERVER. If working with GRANT commands the user will need all of these SELECT/INSERT/DELETE/UPDATE.

answered Apr 29, 2014 by rich-c-2789 (16,180 points)
...