pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
execute
4+ messages / 4 participants
[nested] [flat]

* execute
@ 2013-04-25 16:17  Mauricio Cruz <cruz@sygecom.com.br>
  0 siblings, 2 replies; 4+ messages in thread

From: Mauricio Cruz @ 2013-04-25 16:17 UTC (permalink / raw)
  To: pgsql-sql



Hi every one,  

I'm trying to do the follow: 

declare  

 aCad
text[][] 

begin 

... 

execute 'aCad:=aCad
array[['||var1||','||var2||']]' 

... 

end; language plpgsql

but I get
the follow error:  

sintax erro near to "aCad" 

aCad := aCad ||
array[rCad.cmp,rSql.codfor]  

^ 

I guess I should not use "execute"
besides of insert, update, delete ... but how could I do in this case ?


Thanks every one. 

-- 
Grato,
Mauricio Cruz
Sygecom Informática
[1]
51 3442-3975 / 3442-2345 
 

Links:
------
[1]
http://www.sygecom.com.br

^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: execute
@ 2013-04-26 00:21  Sergey Konoplev <gray.ru@gmail.com>
  parent: Mauricio Cruz <cruz@sygecom.com.br>
  1 sibling, 1 reply; 4+ messages in thread

From: Sergey Konoplev @ 2013-04-26 00:21 UTC (permalink / raw)
  To: Mauricio Cruz <cruz@sygecom.com.br>; +Cc: pgsql-sql

On Thu, Apr 25, 2013 at 9:17 AM, Mauricio Cruz <cruz@sygecom.com.br> wrote:
> execute 'aCad:=aCad array[['||var1||','||var2||']]'

What are you going to do using this construction

aCad:=aCad array[['||var1||','||var2||']]

?

I can not understand the meaning.

--
Kind regards,
Sergey Konoplev
Database and Software Consultant

Profile: http://www.linkedin.com/in/grayhemp
Phone: USA +1 (415) 867-9984, Russia +7 (901) 903-0499, +7 (988) 888-1979
Skype: gray-hemp
Jabber: gray.ru@gmail.com


-- 
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: execute
@ 2013-04-26 00:57  Jov <amutu@amutu.com>
  parent: Sergey Konoplev <gray.ru@gmail.com>
  0 siblings, 0 replies; 4+ messages in thread

From: Jov @ 2013-04-26 00:57 UTC (permalink / raw)
  To: Sergey Konoplev <gray.ru@gmail.com>; +Cc: Mauricio Cruz <cruz@sygecom.com.br>; pgsql-sql

2013/4/26 Sergey Konoplev <gray.ru@gmail.com>

> aCad:=aCad array[['||var1||','||var2||']]


do you want append array[['||var1||','||var2||']] to aCad?
you can do this:

declare tmpa text[] := array[]::text[];
...
tmpa:= tmpa || var1 || var2;
aCad:= aCad || tmpa;
...

execute in plpgsql can ruan any pg sql command,but

aCad:=aCad array[['||var1||','||var2||']]

is not a command, it is a statement in plpgsql, a PART of plpgsql cmd.


-- 
Jov
blog: http:amutu.com/blog <http://amutu.com/blog;

^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: execute
@ 2013-04-27 06:34  Jasen Betts <jasen@xnet.co.nz>
  parent: Mauricio Cruz <cruz@sygecom.com.br>
  1 sibling, 0 replies; 4+ messages in thread

From: Jasen Betts @ 2013-04-27 06:34 UTC (permalink / raw)
  To: pgsql-sql

On 2013-04-25, Mauricio Cruz <cruz@sygecom.com.br> wrote:

> declare 
>
>  aCad
> text[][]
>
> begin
>
> ...
>
> execute 'aCad:=aCad
> array[['||var1||','||var2||']]'

  execute 'select array[['||var1||','||var2||']]' into acad;
  

-- 
⚂⚃ 100% natural



-- 
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql



^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2013-04-27 06:34 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2013-04-25 16:17 execute Mauricio Cruz <cruz@sygecom.com.br>
2013-04-26 00:21 ` Sergey Konoplev <gray.ru@gmail.com>
2013-04-26 00:57   ` Jov <amutu@amutu.com>
2013-04-27 06:34 ` Jasen Betts <jasen@xnet.co.nz>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox