Re: PLPERLU help

Поиск
Список
Период
Сортировка
От Michael Wood
Тема Re: PLPERLU help
Дата
Msg-id AANLkTikOfZ6zq8locyJ3GYp0dKg_kFk-2EC__rJUzEdp@mail.gmail.com
обсуждение исходный текст
Ответ на PLPERLU help  (Atif Jung <atifjung@gmail.com>)
Список pgsql-novice
On 30 June 2010 10:59, Atif Jung <atifjung@gmail.com> wrote:
> I have the following SPL written in plperlu which I need help with please.
>
> CREATE or replace FUNCTION validatesubmission(submission_num text) RETURNS
> INTEGER AS $$
>    $ISIS2_USER = "unknown";
>    $cmd = '/isis2/pgbin/valsub ' || '-u' || ISIS2_USER || ' ' ||
> submission_num;

I have never used plperlu, but I suspect your problem is the
concatenation operators you are attempting to use.  Perl uses "." for
concatenating strings, not "||".  So try changing those ||s to dots.

P.S.  What happens if this function is called with something other
than a number?  e.g. what if it includes shell meta-characters?

--
Michael Wood <esiotrot@gmail.com>

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

Предыдущее
От: Atif Jung
Дата:
Сообщение: PLPERLU help
Следующее
От: Kent Thomas
Дата:
Сообщение: null vs empty string