execute in pl/pgsql

Поиск
Список
Период
Сортировка
От Dino Vliet
Тема execute in pl/pgsql
Дата
Msg-id 20060910114646.64617.qmail@web51101.mail.yahoo.com
обсуждение исходный текст
Ответы Re: execute in pl/pgsql  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Hi,

In my pl/pgsql procedure I have the following line:

execute 'copy cancella to ' || location || ' with
delimiter as \',\'';

Location is a string that gives the absolute pathname.

It's obvious what I'm aiming for, but this still gives
an error because of the two '' I'm missing around the
location var.

That's why I'm getting this error message:

NOTICE:  location is hier
/usr/local/pgsql/data/plpgtrainin10.txt

ERROR:  syntax error at or near "/" at character 18
QUERY:  copy cancella to
/usr/local/pgsql/data/plpgtrainin10.txt with delimiter
as ','
CONTEXT:  PL/pgSQL function "perform" line 16 at
execute statement

How can I solve it? I've tried a few things but keep
getting this error.

Thanks

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

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

Предыдущее
От: maarten
Дата:
Сообщение: Re: Reinstall problem of PostgreSQL in Windows XP
Следующее
От: Dave Cramer
Дата:
Сообщение: Re: [JDBC] Idle in transaction state.