Solve ORA-01756 error when insert data
Problem encountered
When insert the big text into database like html, developer break the lines and concat using ||.
There’s no problem run such script in Oracle SQL Developer, but encounter ORA-01756: Quoted String Not Properly Terminated error when execute script using SQLPlus.
Solution
Generally ORA-01756 caused by tried to execute a statement that contained a string that was not surrounded by two single quotes. One of the quotes was entered without the second accompanying quote. like the script as below:
1 |
|
But it may also cause by big insert/update script in one block, for such case we should use BEGIN … END Compound-Statement Syntax to solve such problem.
1 |
|