v_quote_location := INSTR(v_my_var,'''');
If v_quote_location is greater than zero, then you know you have a quote. You'd probably like to replace that single quote with two single quotes so that your statement makes some sense. In that case, use the REPLACE function:
v_my_var := REPLACE(v_my_var,'''','''''');
If there are no single quotes, the REPLACE function does nothing. If there are single quotes, they are replaced by two single quotes.
Dig Deeper on Oracle database design and architecture
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.