From: | Lazaro Ruben Garcia Martinez <lgarciam(at)vnz(dot)uci(dot)cu> |
---|---|
To: | Miguel Angel Hernandez Moreno <miguel(dot)hdz(dot)mrn(at)gmail(dot)com>, Lista PostgreSql <pgsql-es-ayuda(at)postgresql(dot)org> |
Subject: | RE: duda sobre insert con comas |
Date: | 2013-08-07 19:18:04 |
Message-ID: | 294D3D02D5E18D42827B2ECFEADEB688A2A7A23E33@mx-interno.vnz.uci.cu |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-es-ayuda |
Puedes probar con la funcion quote_nullable
Mira este ejemplo:
CREATE OR REPLACE FUNCTION public.function1 (
var varchar
)
RETURNS void AS
$body$
DECLARE
query varchar;
BEGIN
query = 'INSERT INTO table1
(
nombre
)
VALUES (
' || quote_nullable(var) || '
)';
EXECUTE query;
END;
$body$
LANGUAGE 'plpgsql'
VOLATILE
CALLED ON NULL INPUT
SECURITY INVOKER
COST 100;
Saludos a todos.
________________________________________
De: pgsql-es-ayuda-owner(at)postgresql(dot)org [pgsql-es-ayuda-owner(at)postgresql(dot)org] En nombre de Miguel Angel Hernandez Moreno [miguel(dot)hdz(dot)mrn(at)gmail(dot)com]
Enviado el: miércoles, 07 de agosto de 2013 12:15
Para: Lista PostgreSql
Asunto: [pgsql-es-ayuda] duda sobre insert con comas
Buenos días/tardes lista
Después de mucho sin saludarlos tengo el gusto de volver a compartir
con ustedes,
El día de hoy tengo una duda muy interesante, me acordaba que cuando
insertan cadenas que contienes comillas simples ( ' ), lo que se hace es
poner doble comillas simple ('').
La duda es que si habra una forma de no tener que estar poniendo a todas
las comillas simples otra comillas para que no marque error?
Saludos y graicas!!
--
ISC Miguel Angel Hernandez Moreno
________________________________
Fin a la injusticia, LIBERTAD AHORA A NUESTROS CINCO COMPATRIOTAS QUE SE ENCUENTRAN INJUSTAMENTE EN PRISIONES DE LOS EEUU!
http://www.antiterroristas.cu
http://justiciaparaloscinco.wordpress.com
Fin a la injusticia, LIBERTAD AHORA A NUESTROS CINCO COMPATRIOTAS QUE SE ENCUENTRAN INJUSTAMENTE EN PRISIONES DE LOS EEUU!
http://www.antiterroristas.cu
http://justiciaparaloscinco.wordpress.com
-
Enviado a la lista de correo pgsql-es-ayuda (pgsql-es-ayuda(at)postgresql(dot)org)
Para cambiar tu suscripción:
http://www.postgresql.org/mailpref/pgsql-es-ayuda
From | Date | Subject | |
---|---|---|---|
Next Message | jvenegasperu . | 2013-08-07 23:04:06 | usuario postgres en trigger |
Previous Message | Alvaro Herrera | 2013-08-07 19:00:31 | Re: duda sobre insert con comas |