Consulta

Started by Alejandro Ciceroalmost 25 years ago2 messagesgeneral
Jump to latest
#1Alejandro Cicero
acicero@afip.gov.ar

En ORACLE, puedo pasar parametros a un query de la siguiente manera:

select campo1, campo2
from tabla1
where campo3=&variable

En Postgres como se hace?

Gracias.

#2Peter Eisentraut
peter_e@gmx.net
In reply to: Alejandro Cicero (#1)
Re: Consulta

Alejandro Cicero writes:

En ORACLE, puedo pasar parametros a un query de la siguiente manera:

select campo1, campo2

from tabla1

where campo3=&variable

En Postgres como se hace?

If you are using Embedded SQL (epgc) then it's probably :variable. If
you're in PL/pgSQL then it's just the name of the variable without special
characters. Otherwise you need to prepare the query string in your client
application before sending it to the database server. PostgreSQL doesn't
have generic server-side variables.

--
Peter Eisentraut peter_e@gmx.net http://funkturm.homeip.net/~peter