Received: from localhost (uranus.hub.org [200.46.204.60]) by postgresql.org (Postfix) with ESMTP id 12BA29FB20F for ; Mon, 13 Nov 2006 07:37:52 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.60]) (amavisd-new, port 10024) with ESMTP id 42018-06 for ; Mon, 13 Nov 2006 07:37:49 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id 2BCA89FB1F2 for ; Mon, 13 Nov 2006 07:37:48 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 Received: from mail.zanthus.com.br (mail.zanthus.com.br [200.212.65.85]) by svr4.postgresql.org (Postfix) with ESMTP id 418065AF8BA for ; Mon, 13 Nov 2006 11:37:46 +0000 (GMT) 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 CD12B23F95 for ; Mon, 13 Nov 2006 09:43:01 -0200 (BRST) Reply-To: From: "Rodrigo Sakai" To: Subject: Inserting data in composite types! Date: Mon, 13 Nov 2006 09:37:07 -0300 Organization: Zanthus Message-ID: <00fc01c70720$7364c400$4700a8c0@TREEZANTHUS> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_00FD_01C70707.4E19FD00" X-Mailer: Microsoft Office Outlook 11 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1807 Thread-Index: AccHIG0KUObrfOl6TZSgVIVx8befTg== 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/121 X-Sequence-Number: 26773 This is a multi-part message in MIME format. ------=_NextPart_000_00FD_01C70707.4E19FD00 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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! ------=_NextPart_000_00FD_01C70707.4E19FD00 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

  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!

 

------=_NextPart_000_00FD_01C70707.4E19FD00--