470,647 Members | 1,193 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,647 developers. It's quick & easy.

Concatenating String Literals in pgsql

How does one concat string literals in pgsql ?

The compiler complains about the concat operator in the following code
fragment:

RAISE EXCEPTION
''SELECT DISTINCT "t1"."usesysid" '' ||
''INTO userID '' ||
''FROM "pg_user" AS "t1" '' ||
''WHERE "t1"."usename" = current_user '' ||
''NOT FOUND'';

Thanks in advance.

Raymond

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postgresql.org

Nov 11 '05 #1
1 7428
Raymond <su*****@bigriverinfotech.com> writes:
The compiler complains about the concat operator in the following code
fragment: RAISE EXCEPTION
''SELECT DISTINCT "t1"."usesysid" '' ||
''INTO userID '' ||


RAISE EXCEPTION doesn't support expressions in its arguments, IIRC.
The format has to be a simple string literal, and anything to be plugged
into it has to be a variable reference.

So, do the concatenation beforehand.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Nov 11 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

16 posts views Thread by Don Starr | last post: by
8 posts views Thread by junky_fellow | last post: by
6 posts views Thread by copx | last post: by
21 posts views Thread by c | last post: by
8 posts views Thread by arnuld | last post: by
3 posts views Thread by TheCoder | last post: by
7 posts views Thread by lithiumcat | last post: by
1 post views Thread by Korara | last post: by
reply views Thread by warner | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.