pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedRe: RES: Inserting data in composite types!
2+ messages / 2 participants
[nested] [flat]
* Re: RES: Inserting data in composite types!
@ 2006-11-13 17:42 Richard Broersma Jr <rabroersma@yahoo.com>
parent: Rodrigo Sakai <rodrigo.sakai@zanthus.com.br>
0 siblings, 0 replies; 2+ messages in thread
From: Richard Broersma Jr @ 2006-11-13 17:42 UTC (permalink / raw)
To: rodrigo.sakai@zanthus.com.br, 'imad' <immaad@gmail.com>; +Cc: pgsql-sql
> 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!
What is the error message?
Regards,
Richard Broersma Jr.
^ permalink raw reply [nested|flat] 2+ messages in thread
* RES: Inserting data in composite types!
@ 2006-11-13 18:27 Rodrigo Sakai <rodrigo.sakai@zanthus.com.br>
0 siblings, 1 reply; 2+ messages in thread
From: Rodrigo Sakai @ 2006-11-13 18:27 UTC (permalink / raw)
To: 'imad' <immaad@gmail.com>; +Cc: pgsql-sql
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 <rodrigo.sakai@zanthus.com.br> 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!
>
>
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2006-11-13 18:27 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-11-13 18:27 RES: Inserting data in composite types! Rodrigo Sakai <rodrigo.sakai@zanthus.com.br>
2006-11-13 17:42 ` Richard Broersma Jr <rabroersma@yahoo.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox