how to fix error on

Vahagn

I have sql request

DELETE FROM BC_UDV3_ROLES 
WHERE PERMISSION_ID = 'x' OR
      0 < (SELECT * FROM BC_UDV3_ROLES 
           WHERE "SUBSTR"(PERMISSION_ID, 0, 1)='D')  OR '1'='1'

when I execute it get this error

Please help, how I can fix it?

Vamsi Prabhala
DELETE FROM BC_UDV3_ROLES
WHERE PERMISSION_ID = 'x'
OR 0 < (SELECT count(*) FROM BC_UDV3_ROLES WHERE SUBSTRING(PERMISSION_ID, 1, 1)='D')

OR '1'='1' condition always evaluates to TRUE. it is not needed.

Also if you are using mysql the function should be substring instead of substr. Also there should be no quotes around the function name. You can't compare 0 with all the columns in the table. Use a count(*) instead.

Alternately you can also try

DELETE FROM BC_UDV3_ROLES
WHERE PERMISSION_ID = 'x'
OR SUBSTRING(PERMISSION_ID, 1, 1)='D'

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related