Re: Como establecer la fecha Actual comovalor por defecto en un campo

From: Jose Carlos Chevarria <jchevarria(at)yarkan(dot)com(dot)pe>
To: pgsql-es-ayuda(at)postgresql(dot)org
Subject: Re: Como establecer la fecha Actual comovalor por defecto en un campo
Date: 2007-12-20 17:39:26
Message-ID: 476AA8CE.3050100@yarkan.com.pe
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Luis German Torres M escribi&oacute;:
<blockquote
cite="mid:80130dc10712200911s213d3dc7y703b0be7aa0559cc(at)mail(dot)gmail(dot)com"
type="cite">Hola a todos:<br>
<br>
Bien mi pregunta es la siguiente :<br>
<br>
Tengo un tabla en la que se manejan transacciones de pagos, y manejo un
campo en el cual se incluye la fecha de presentaci&oacute;n de la transacci&oacute;n
el scritp es el siguiente:
<br>
<br>
DROP TABLE pago;<br>
<br>
CREATE TABLE pago<br>
(<br>
&nbsp; codigopago integer NOT NULL,<br>
&nbsp; numerocuota integer NOT NULL,<br>
&nbsp; codigodeclaracion integer NOT NULL,<br>
&nbsp; fechaliquidacion date NOT NULL,<br>
&nbsp;<span style="background-color: rgb(255, 255, 0);"> </span><span
style="color: rgb(204, 0, 0); background-color: rgb(255, 255, 0);">fechapresentacion
date DEFAULT date,</span> <br>
&nbsp; codigoestablecimiento integer NOT NULL,<br>
&nbsp; codigoactividadcomercial integer NOT NULL,<br>
&nbsp; codigoperiodo integer NOT NULL,<br>
&nbsp; codigoano integer NOT NULL,<br>
&nbsp; codigocobro integer NOT NULL,<br>
&nbsp; codigoconcepto integer NOT NULL,<br>
&nbsp; naturaleza character varying(1) NOT NULL,<br>
&nbsp; valor double precision NOT NULL DEFAULT 0,
<br>
&nbsp; descuento double precision NOT NULL DEFAULT 0,<br>
&nbsp; interes double precision NOT NULL DEFAULT 0,<br>
&nbsp; estado boolean NOT NULL DEFAULT false,<br>
&nbsp; CONSTRAINT pk_pago PRIMARY KEY (codigopago, numerocuota,
codigodeclaracion, codigoestablecimiento, codigoactividadcomercial,
codigoperiodo, codigoano, codigocobro, codigoconcepto),
<br>
&nbsp; CONSTRAINT fk_basegravable_declaracion FOREIGN KEY (codigoconcepto)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; REFERENCES basegravable (codigoconcepto) MATCH SIMPLE<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ON UPDATE NO ACTION ON DELETE NO ACTION,<br>
&nbsp; CONSTRAINT fk_cobros_declaracion FOREIGN KEY (codigocobro)
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; REFERENCES cobros (codigocobro) MATCH SIMPLE<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ON UPDATE NO ACTION ON DELETE NO ACTION,<br>
&nbsp; CONSTRAINT fk_cobros_declaracion_origen FOREIGN KEY (codigocobro)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; REFERENCES cobros (codigocobro) MATCH SIMPLE
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ON UPDATE NO ACTION ON DELETE NO ACTION,<br>
&nbsp; CONSTRAINT fk_codigoactividadcomercial_declaracion FOREIGN KEY
(codigoactividadcomercial)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; REFERENCES actividadescomerciales (codigoactividadcomercial)
MATCH SIMPLE
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ON UPDATE NO ACTION ON DELETE NO ACTION,<br>
&nbsp; CONSTRAINT fk_establecimientos_declaracion FOREIGN KEY
(codigoestablecimiento)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; REFERENCES establecimientos (codigoestablecimiento) MATCH SIMPLE<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ON UPDATE NO ACTION ON DELETE NO ACTION
<br>
) <br>
WITHOUT OIDS;<br>
ALTER TABLE pago OWNER TO root;<br>
<br>
en el campo fechadepresentacion (fondo amarillo y letras rojas)
pretende colocar como valor por defectos la fecha actual, &iquest; como puedo
hacerlo?, puesto que al correr el script me dice que no encuentra el
campo date
<br>
</blockquote>
<span style="background-color: rgb(255, 255, 0);"></span><span
style="color: rgb(204, 0, 0); background-color: rgb(255, 255, 0);">fechapresentacion
date DEFAULT now()</span>
</body>
</html>

Attachment Content-Type Size
unknown_filename text/html 3.4 KB

In response to

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message Fernando Luyo 2007-12-20 18:03:51 Fw: ayuda con un layer en postgis
Previous Message Leonel Nunez 2007-12-20 17:28:58 Re: Como establecer la fecha Actual comovalor por defecto en un campo