by wfriesen · 3y ago · 0 comments
A DBA is likely doing things like looping over metadata tables and running
'grant select on ' || some_table || ' to ' || some_user
While an app developer with free reign will end up doing something much more complex, and much harder to reason about/tuneI am perfectly able to:
SELECT ACCOUNT_STATUS FROM DBA_USERS WHERE USERNAME=:var;
But I cannot: ALTER USER :var ACCOUNT UNLOCK;
I really don't understand why that capability wasn't added a decade ago, as loud as the advice is to avoid hard parsing.Dynamic SQL is used on practice to fix a lot of problems the SQL people have been refusing to touch.
(The characters never actually get escaped with parameterisation - they are not part of the query text when it is parsed so can’t affect it - hence parameterising a value in sql query replaces the need to escape it with something much more robust.)