Fórum Ajuda passa valores para variavel #27115
18/09/2009
0
Olá amigos.
sou novo em postgrees
alguem sabe como faço para receber o valor de uma sql na variavel abaixo, está sql retorna apenas 1 valor tipo string.?
xcodlote = ´select codlote from lotecontabilidade where lote=$1´;
sou novo em postgrees
alguem sabe como faço para receber o valor de uma sql na variavel abaixo, está sql retorna apenas 1 valor tipo string.?
xcodlote = ´select codlote from lotecontabilidade where lote=$1´;
CREATE OR REPLACE FUNCTION gera_voucher(text,text) RETURNS text AS $BODY$ DECLARE xcodlote TEXT=´´; BEGIN xcodlote = ´select codlote from lotecontabilidade where lote=$1´; if xcodlote = ´1.1´ then delete from temp_voucher; end if; RETURN xcodlote; END $BODY$ LANGUAGE ´plpgsql´ VOLATILE STRICT; ALTER FUNCTION gera_voucher(text) OWNER TO postgres;
Jjander.cunha
Curtir tópico
+ 0
Responder
Clique aqui para fazer login e interagir na Comunidade :)