1
votes

I have a very simple question. Assume, I want to do select:

select '''Y''' asd, q'['Y']' asd from dual

Okay, it works. Then I switch it to

select '''N''' asd, q'['N']' asd from dual

And it fails with ORA-01756! So have I missed something in manuals about quoting with Q-letter? By the way I'm using Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production

Thanks in advance!

1
Where did you try this? Does a simple, clean SQLPlus session give this error? These both work well for me - Aleksej
What you've posted seems fine. Which client are you using? (Only immediate thought is that something is somehow confused by the n'...' syntax for an nchar literal... seems more likely that you're running something slightly different to what you've shown though?) - Alex Poole
I did this in PL/SQL Developer using SQL-Window and it gave an error. I tried it in Command Window and it worked fine. So I guess Alex Poole is right and PL/SQL Developer looks at my string like it's nchar literal. - Roman
No problem in PL/SQL Developer SQL window here. - Rene
No, I can't see it being anything to do with NLS settings. Are you using an old version, maybe? - Alex Poole

1 Answers

0
votes

The reason is that I was using v.9 of PL/SQL Developer. After moving to the v.10 the issue was gone.