How to anticipate and escape single quote ' in oracle

前端 未结 2 966
轮回少年
轮回少年 2020-11-28 14:42

Suppose I have a column value as aaa\'gh it will throw error in oracle saying sql command not properly ended.

My question is if I don\'t know how many <

2条回答
  •  失恋的感觉
    2020-11-28 15:27

    My simple approach with this problem, was always to just use

    replace(string, '''', '''''')
    

    but Lalit Kumar B solution, seems more sophisticated

提交回复
热议问题