Re: Problems with PLPGSQL

Поиск
Список
Период
Сортировка
От Alex
Тема Re: Problems with PLPGSQL
Дата
Msg-id 3FAA11C0.4010309@meerkatsoft.com
обсуждение исходный текст
Ответ на Re: Problems with PLPGSQL  (Jason Godden <jasongodden@optushome.com.au>)
Ответы Re: Problems with PLPGSQL  (Bruno Wolff III <bruno@wolff.to>)
Список pgsql-general
Hi Jason,
thanks, for the reply. Tried that one but still getting an error

Unable to identify an operator + for types timestamp without time zone
and text ....

Alex

Jason Godden wrote:

>Hi Alex,
>
>If you want to achieve say '360 min' as the string you will have use
>concatenation:
>
>FOR myRec IN SELECT * FROM myTable WHERE job_end + ($1::text || '' Min'') >
>now LOOP
>
>The syntax is SQL rather than PHP-like.
>
>Rgds,
>
>Jason
>
>On Thu, 6 Nov 2003 03:13 pm, Alex wrote:
>
>
>>Hi,
>>I have a problem with quoting  in one of my functions:
>>
>>now TIMESTAMP := ''now'';
>>FOR myRec IN SELECT * FROM myTable WHERE job_end + ''360 Min'' > now LOOP
>>
>>I want to replace the 360 with the contents of a passed value
>>
>>but for some reason I can't quote it. ... job_end + ''$1 Min'' does not
>>work.
>>
>>Could anyone help me out here ?
>>
>>
>>On the subject:
>>The whole quoting in PLPGSQL seems to create many people a headache...
>>is there any plan to make it a bit more user friendly?
>>
>>Thanks
>>Alx
>>
>>
>>
>>
>>---------------------------(end of broadcast)---------------------------
>>TIP 3: if posting/reading through Usenet, please send an appropriate
>>      subscribe-nomail command to majordomo@postgresql.org so that your
>>      message can get through to the mailing list cleanly
>>
>>
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 9: the planner will ignore your desire to choose an index scan if your
>      joining column's datatypes do not match
>
>
>
>



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

Предыдущее
От: Richard Huxton
Дата:
Сообщение: Re: Problems with PLPGSQL
Следующее
От: Richard Huxton
Дата:
Сообщение: Re: Sequences without blank holes