I want to escape single quote when a user enters an input text such as "Sam's project deliverable" in a form entry developed in C# (.NET). Database is ORACLE 10g.
I came across Quote delimiter feature offered from ORACLE 10g http://www.orafaq.com/wiki/SQL_FAQ#How_does_one_escape_special_characters_when_writing_SQL_queries.3F but I am not sure if using such a quote delimiter q'[ some text with single quote]' as part of a SELECT statement would prevent SQL Injection attacks?
Example usage of quote delimiter q'[ text with single quote ]':
SQL> SELECT q'[Frank's Oracle site]' AS text FROM DUAL;
TEXT
-------------------
Frank's Oracle site
SQL> SELECT q'[A 'quoted' word.]' AS text FROM DUAL;
TEXT
----------------
A 'quoted' word.
SQL> SELECT q'[A ''double quoted'' word.]' AS text FROM DUAL;
TEXT
-------------------------
A ''double quoted'' word.