Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / Ingres Topics / August 2006

Tip: Looking for answers? Try searching our database.

escape characters within DBPs

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jeffrey.duffy@gro-scotland.gsi.gov.uk - 28 Aug 2006 12:43 GMT
Hi Guys
Im trying to build up a string within a DBP and want add quotes to the
string.
I need to escape single quotes. Does anyone know how to do this?
I have tried \'string\' escape '\' and this doesnt work !

Any help appreciated
Jeff
Roy Hann - 28 Aug 2006 13:15 GMT
> Hi Guys
> Im trying to build up a string within a DBP and want add quotes to the
[quoted text clipped - 3 lines]
>
> Any help appreciated

In many languages single quotes are escaped by doubling them up; Ingres SQL
follows the same convention (the '''' is a single single quote quoted by
single quotes):

 create procedure hi as
 declare msg varchar(30) not null;
 begin
    msg='Roy'+''''+'s holiday is over';
    message :msg;
 end;
 execute procedure hi;

gives me

 MESSAGE 0: Roy's holiday is over

Roy
Jean-Pierre Zuate - 28 Aug 2006 13:17 GMT
Hi,

To add a quote try 4 quotes ('''').

Hope this help ...
Jean-Pierre

28 Aug 2006 04:43:20 -0700, jeffrey.duffy@gro-scotland.gsi.gov.uk <
jeffrey.duffy@gro-scotland.gsi.gov.uk>:

> Hi Guys
> Im trying to build up a string within a DBP and want add quotes to the
[quoted text clipped - 9 lines]
> Info-ingres@cariboulake.com
> http://mailman.cariboulake.com/mailman/listinfo.py/info-ingres

Signature

Jean-Pierre Zuate
+33(0)6 11 40 11 09

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.