- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: how to insert a ' character
Operating System - HP-UX
1748089
Members
4978
Online
108758
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-29-2004 04:40 AM
тАО07-29-2004 04:40 AM
I need to construct a dinamic query with ' character. for example
how to obtain a next result:
create user 'goviedo';
I execute the next query :
SQL> select 'create user ' ' ' '||username||';' from dba_users;
ERROR:
ORA-01756: quoted string not properly terminated
my problem is how I can insert a ' character in my select?
Thanks
how to obtain a next result:
create user 'goviedo';
I execute the next query :
SQL> select 'create user ' ' ' '||username||';' from dba_users;
ERROR:
ORA-01756: quoted string not properly terminated
my problem is how I can insert a ' character in my select?
Thanks
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-29-2004 04:44 AM
тАО07-29-2004 04:44 AM
Solution
what you need is double ' to put a single ' in string and a single ' to close/open your string. So, it gives something like this :
select 'create user '''||username||''';'
from dba_users;
Regards,
Fred
select 'create user '''||username||''';'
from dba_users;
Regards,
Fred
--
"Reality is just a point of view." (P. K. D.)
"Reality is just a point of view." (P. K. D.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-29-2004 04:44 AM
тАО07-29-2004 04:44 AM
Re: how to insert a ' character
Try
select 'create user''' || username || ''';' from dba_users
Regards,
Jean-Luc
select 'create user''' || username || ''';' from dba_users
Regards,
Jean-Luc
fiat lux
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-29-2004 09:45 PM
тАО07-29-2004 09:45 PM
Re: how to insert a ' character
hi,
please allow me to contribute the new functionality in 10g:
select q'|It's great|', q'#it's great#', q'xit's great!x'
from dual
Q'|IT'SGREAT Q'#IT'SGREAT Q'XIT'SGREAT
------------ ------------ ------------
It's great it's great it's great!
if the literal begins with q -- then the next two characters represent the "begin of string" marker and the reverse of those two represent the "end of string" marker.
hope this helps too!
regards
Yogeeraj
please allow me to contribute the new functionality in 10g:
select q'|It's great|', q'#it's great#', q'xit's great!x'
from dual
Q'|IT'SGREAT Q'#IT'SGREAT Q'XIT'SGREAT
------------ ------------ ------------
It's great it's great it's great!
if the literal begins with q -- then the next two characters represent the "begin of string" marker and the reverse of those two represent the "end of string" marker.
hope this helps too!
regards
Yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP