plpgsql - can't get a simple block to execute

Поиск
Список
Период
Сортировка
От Walker, Jed S
Тема plpgsql - can't get a simple block to execute
Дата
Msg-id 41669DC6FE3B80449A33A4DD46DB370A09E7E97B@entcoexch15.broadband.att.com
обсуждение исходный текст
Ответы Re: plpgsql - can't get a simple block to execute  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: plpgsql - can't get a simple block to execute  (Michael Fuhr <mike@fuhr.org>)
Список pgsql-novice
I'm resending as I didn't get any response earlier.
> This should be simple, but it's not. I think I'm just missing something
> simple.  I converted an oracle PL/SQL program to plpgssql, but it wouldn't
> work, so I tried some very simple blocks, and even they fail. As far as I
> can tell, the syntax is all valid.
>
Any help would be appreciated.

> (postgres) robux:/opt/postgres/VRNJED
> ->cat it.sql
>
> \echo raise notice attempt
> begin
>   raise notice 'hello';
> end;
>
> \echo select into attempt
> declare
>   i_int integer;
> begin
>  select count(1) into i_int from vrnsys_version;
> end;
>
> (postgres) robux:/opt/postgres/VRNJED
> ->psql -U vrnsys
> Welcome to psql 7.3.2, the PostgreSQL interactive terminal.
>
> Type:  \copyright for distribution terms
>        \h for help with SQL commands
>        \? for help on internal slash commands
>        \g or terminate with semicolon to execute query
>        \q to quit
>
> VRNJED=> \i it.sql
> raise notice attempt
> psql:it.sql:4: ERROR:  parser: parse error at or near "raise" at character
> 9
> psql:it.sql:5: WARNING:  COMMIT: no transaction in progress
> COMMIT
> select into attempt
> psql:it.sql:9: ERROR:  parser: parse error at or near "integer" at
> character 17
> psql:it.sql:11: ERROR:  parser: parse error at or near "select" at
> character 8
> psql:it.sql:12: WARNING:  COMMIT: no transaction in progress
> COMMIT
> VRNJED-> \q
> (postgres) robux:/opt/postgres/VRNJED
> ->
>
> Jed S. Walker
>
>
>

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

Предыдущее
От: Sean Davis
Дата:
Сообщение: Re: PREPARE statements
Следующее
От: "Celia McInnis"
Дата:
Сообщение: casting for bit strings in plpgsql.