Re: Concatenating

Поиск
Список
Период
Сортировка
От Heath Tanner
Тема Re: Concatenating
Дата
Msg-id 4724C8A3-EE33-11D7-99A5-0003930C11A0@inligo.com
обсуждение исходный текст
Ответ на Concatenating  (Juan Francisco Diaz <j-diaz@publicar.com>)
Список pgsql-novice
On Tuesday, September 23, 2003, at 06:08  PM, Juan Francisco Diaz wrote:

> cadena := 'select * from orden where idlibro = ';
> cadena := cadena || Libro;
> cadena := cadena || ' order by idorden limit ';
> cadena := cadena || ''numFin'';
> cadena := cadena || ';';
>
> And I cant get it to wrok. Libro and numFin are variables that are
> received
> in a pgsql function. Libro is char(6) and numFin is numeric.
> I tried this and also doing everything in the same line... With no good
> results... Iam now very confused with this!!!! AHAHHAHAh

Looks like you need to double your quotes, e.g. ''select * from orden
where idlibro = ''.

See "19.11.1.1. Quote Me on That: Escaping Single Quotes":
http://www.postgresql.org/docs/7.3/interactive/plpgsql-porting.html.

-heath


В списке pgsql-novice по дате отправления:

Предыдущее
От: Bruno LEVEQUE
Дата:
Сообщение: Re: Referencing multiple primary keys from a single table.
Следующее
От: Juan Francisco Diaz
Дата:
Сообщение: Badly placed ()'s