Ajuda - insert into select com variavel

Danilo <[email protected]>
Newsgroups gmane.comp.db.postgresql.sql
Message-ID <[email protected]>
Pessoal boa noite, sou novo no mundo Postgres. Conheço bem Oracle mais
Postgres está sendo um novo desafio.
Tenho a seguinte situação:

Tenho uma procedure onde existe uma variavel chamanda vContador do tipo int.
Abaixo vou exemplificar alterado o nome da tabela e campos para poder
facilitar.

quando faço:

     INSERT INTO TAB1
     (CAMPO1, CAMPO2, CAMPO3)
     SELECT TAB2.CAMPO1, TAB2.CAMPO2, vContador
       FROM TAB2 
              where TAB2.CAMPO3 = 1

O Sistema apresenta erro de column "vContador" does not exists

Alguem por favor pode me ajudar?



--
Sent from: http://www.postgresql-archive.org/PostgreSQL-sql-f2142323.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.