Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 560459FB271 for ; Mon, 13 Nov 2006 13:28:15 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 76452-04 for ; Mon, 13 Nov 2006 13:28:07 -0400 (AST) X-Greylist: delayed 05:50:26.253869 by SQLgrey- Received: from mail.zanthus.com.br (mail.zanthus.com.br [200.212.65.85]) by postgresql.org (Postfix) with ESMTP id 9850C9FA12B for ; Mon, 13 Nov 2006 13:28:06 -0400 (AST) Received: from cprsakai (unknown [192.168.0.71]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by mail.zanthus.com.br (Postfix) with ESMTP id 2536B23FC0; Mon, 13 Nov 2006 15:33:12 -0200 (BRST) Reply-To: From: "Rodrigo Sakai" To: "'imad'" Cc: Subject: RES: Inserting data in composite types! Date: Mon, 13 Nov 2006 15:27:17 -0300 Organization: Zanthus Message-ID: <000001c70751$5cae7130$4700a8c0@TREEZANTHUS> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 Thread-Index: AccHLkFfApq6RQcPTBSXcOH9eVAW5AAIp94A In-Reply-To: <1f30b80c0611130609s423d017aj1cb8c20b36c47007@mail.gmail.com> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1807 X-Zanthus-MailScanner: Found to be clean X-Zanthus-MailScanner-From: rodrigo.sakai@zanthus.com.br X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200611/133 X-Sequence-Number: 26785 Thanks, It works! I have tried: insert into employee (c, nome, sal) values(1, 'emp name', '(1, (01/01/2000, 01/01/2000))' ); And it doesn't work! -----Mensagem original----- De: imad [mailto:immaad@gmail.com] Enviada em: segunda-feira, 13 de novembro de 2006 11:10 Para: rodrigo.sakai@zanthus.com.br Cc: pgsql-sql@postgresql.org Assunto: Re: [SQL] Inserting data in composite types! I am able to do this thing with the following query: insert into employee (a, name, s) values(1, 'emp name', ((1, '(01/01/2000, 01/01/2000)'))); --Imad www.EnterpriseDB.com On 11/13/06, Rodrigo Sakai wrote: > > > > > Hi, I have a question about how to insert data in composite types! > > > > Imagine the exemple: > > > > CREATE TYPE t_time AS ( > > a date, > > b date > > ); > > > > CREATE TABLE salary ( > > salary numeric(10,2), > > t_date t_time > > ); > > > > I know that if I want to insert data in the table SALARY I just have to do > like: > > > > INSERT INTO salary VALUES (1000.00, '(2006/10/10, 2006/12/10)'); > > > > But if I have another table: > > > > CREATE TABLE employee ( > > employee_id int, > > name varchar(30), > > emp_salary salary > > ) > > > > How can I insert a single row in this table??? > > > > Thanks in advamce! > >