Re: Inserting data in composite types!

Поиск
Список
Период
Сортировка
От imad
Тема Re: Inserting data in composite types!
Дата
Msg-id 1f30b80c0611130609s423d017aj1cb8c20b36c47007@mail.gmail.com
обсуждение исходный текст
Ответ на Inserting data in composite types!  ("Rodrigo Sakai" <rodrigo.sakai@zanthus.com.br>)
Ответы RES: Inserting data in composite types!
Список pgsql-sql
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!
>
>


В списке pgsql-sql по дате отправления:

Предыдущее
От: "A. Kretschmer"
Дата:
Сообщение: Re: max (timestamp,timestamp)
Следующее
От: imad
Дата:
Сообщение: Re: max (timestamp,timestamp)