Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ecDZQ-0003Cs-BU for pgsql-sql@arkaria.postgresql.org; Thu, 18 Jan 2018 17:01:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ecDZP-0000uc-RE for pgsql-sql@arkaria.postgresql.org; Thu, 18 Jan 2018 17:01:43 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ecDZP-0000uS-Ik for pgsql-sql@lists.postgresql.org; Thu, 18 Jan 2018 17:01:43 +0000 Received: from mail-qt0-x22d.google.com ([2607:f8b0:400d:c0d::22d]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ecDZI-00019G-IP for pgsql-sql@postgresql.org; Thu, 18 Jan 2018 17:01:43 +0000 Received: by mail-qt0-x22d.google.com with SMTP id o35so21777353qtj.13 for ; Thu, 18 Jan 2018 09:01:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=1g+0tG/72or2y3dfTp4y30Yxsp4Fi0EaGdx7RUDYGm8=; b=k1inwGi2i4jEqeqdzKh6+4lgx44k9hDvrHqpJi2zA2tkgPSxWOvlQTtI7wLfzf8+CC Ns1TXwX1yDdicPCtu9voyGbh5MMdG7c3+0HpyQZSH5y9n1lYZMljs6r+y5Of/bBYh/6O fBm3dLcmPCvHd6OxgkkBErR5PcbqqczG8iK1nKrU9mI4d7cZ7caQ4aOdDU2NGQjE7yWA 9rjyeyEZuxEfcBYgPtwSdOck5BW/q83CYc9AG1KHW09ms1faGX3lWHPEaGdsT1bf/bdo uJj92oGkVEZ7ZYarzYjJSJmkrK/xrTKpHK8m3wt9dCgntYm0hb6HYEU8F6zME0g6at8N oQ5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=1g+0tG/72or2y3dfTp4y30Yxsp4Fi0EaGdx7RUDYGm8=; b=g1z6tHqLF0+TbArWy3bcJE+XyPccvi+7Kg/A+QF1r+M4D/uyOPDzyqX2cDDuibNmOH CByXcI0NxMWTSbsTVrhxrWdjbaD+ufJdEIxQrMLCwcc6HM65sUjXpWN4wWS4Yn2zQGBU Pe+j4cSY9AMNJfXvjOjq9Qg0S0YBVH9NLRW1B60lgABSnfMuROFBC0jtG1/IjyN0J31+ B4IxSWmMuaYM+4+HDV+3+OFXyph/Nalxh5Vbyw/3BAepp2PoaODw1pk9yHEAANWlSXZC DQ2Y3hm0KW3/NHk0Slme9FQSQzP0MZ/62/8zcndA78yVzZTJ1kwO5mpL6j9U4Al4TeGl jM0Q== X-Gm-Message-State: AKwxytcRYYeA9cR/68d4eorTuUA4LGCLoOwt7zC2IFvQ8Cm3RK3MdNZi +65X+qOwgQp5EEL0Ka/xU8Q= X-Google-Smtp-Source: ACJfBovWFKYsoobyyN6TN+iSGToH8mjPhMuoWxFVgqgBtH+zxQm/Lf4gThJEKVcWTpjIa5hBfnzHfg== X-Received: by 10.55.65.76 with SMTP id o73mr53600353qka.241.1516294893309; Thu, 18 Jan 2018 09:01:33 -0800 (PST) Received: from [192.168.1.3] (201-50-52-61.user.veloxzone.com.br. [201.50.52.61]) by smtp.gmail.com with ESMTPSA id g12sm5208919qtc.3.2018.01.18.09.01.30 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 18 Jan 2018 09:01:32 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: Ajuda - insert into select com variavel From: Iuri Sampaio In-Reply-To: <1516238136165-0.post@n3.nabble.com> Date: Thu, 18 Jan 2018 14:01:27 -0300 Cc: pgsql-sql@postgresql.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <1516238136165-0.post@n3.nabble.com> To: Danilo X-Mailer: Apple Mail (2.3124) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Para quem entende de Oracle, siga os mesmos conceitos. Na tabela tab2 = n=C3=A3o ha existe a coluna vContador. Adicione-a. ALTER TABLE tab2 ADD COLUMN vContador int; =20 > On Jan 17, 2018, at 22:15, Danilo wrote: >=20 > Pessoal boa noite, sou novo no mundo Postgres. Conhe=C3=A7o bem Oracle = mais > Postgres est=C3=A1 sendo um novo desafio. > Tenho a seguinte situa=C3=A7=C3=A3o: >=20 > 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. >=20 > quando fa=C3=A7o: >=20 > INSERT INTO TAB1 > (CAMPO1, CAMPO2, CAMPO3) > SELECT TAB2.CAMPO1, TAB2.CAMPO2, vContador > FROM TAB2=20 > where TAB2.CAMPO3 =3D 1 >=20 > O Sistema apresenta erro de column "vContador" does not exists >=20 > Alguem por favor pode me ajudar? >=20 >=20 >=20 > -- > Sent from: = http://www.postgresql-archive.org/PostgreSQL-sql-f2142323.html >=20