RES: [SQL] Another question about composite types

2006-11-13 Thread Rodrigo Sakai
I know that if I create a table salary that references my employee table works! But I'm trying to work with the composite type concept! Thinking in Object-Oriented Programming (OOP) I have a class employee that is composed by the class salary among other things! Like: Class salary { private

[SQL] Another question about composite types

2006-11-13 Thread Rodrigo Sakai
  Hi, I need to create a table like:     CREATE TYPE t_salary AS (     Value numeric(10,2),     Validity date   );     CREATE TABLE employee ( id int, name varchar(30), salary t_salary[]   );       That is, I need an array of composite type and searching on goog

RES: [SQL] Inserting data in composite types!

2006-11-13 Thread Rodrigo Sakai
10 Para: [EMAIL PROTECTED] 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.Enterprise

[SQL] Inserting data in composite types!

2006-11-13 Thread Rodrigo Sakai
  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

[SQL] SEQUENCES

2006-10-02 Thread Rodrigo Sakai
  Hi all,     I need to get all sequences and their respective current values! Is there any catalog table or any other away to get this???     Thanks in advance.

[SQL] Null attributes

2006-07-04 Thread Rodrigo Sakai
  How can I get all attributes that is not null + don’t have defaults + is not PKs??? I know I have to use system catalog, but I have some Pks that is multicolumn!     Any help??     Rodrigo Sakai Administrador de Banco de Dados É(11) 3750-7075 * [EMAIL PROTECTED]    

RES: [SQL] Joins between int and int[]

2006-06-28 Thread Rodrigo Sakai
Thanks Mantzios, your answer helped a lot! But I have a lot of multi column foreign keys! Any other ideia?? Thanks in advance! -Mensagem original- De: Achilleus Mantzios [mailto:[EMAIL PROTECTED] Enviada em: quarta-feira, 28 de junho de 2006 04:01 Para: Rodrigo Sakai Assunto: Re

[SQL] Joins between int and int[]

2006-06-27 Thread Rodrigo Sakai
  Hi,     I want to use the system catalog tables/views to query some things, and one of the queries I have to do is joining pg_attribute and pg_constraint to know what constraint belongs to which table.attribute. My question is how can I write the join clause between a int (pg_attribute.

[SQL] How to avoid (stop) a endless loop in a trigger

2004-03-04 Thread Rodrigo Sakai
\'N\' where codigo=NEW.codigo; RETURN NULL; end if; end; ' LANGUAGE 'plpgsql' VOLATILE; CREATE TRIGGER tr_sp_teste_trigger BEFORE INSERT OR UPDATE ON public.teste_trigger FOR EACH ROW EXECUTE PROCEDURE public.sp_teste_loop(); Thank for any hel

Re: [SQL] Compiling pl/pgsql functions

2004-02-19 Thread Rodrigo Sakai
our codes. I insist in my question, is there a way to compile the plpgsql codes or something like that, or its better to think about writting this postgres functions in C?? Thanks for all!!! ===== Rodrigo Sakai Database Programmer [EMAIL PROTECTED] http://www.2bfree.com.br Te

[SQL] Compiling pl/pgsql functions

2004-02-19 Thread Rodrigo Sakai
to do that, or the only way is writting my functions in C?? Thanks for any help and regards to all!!! = Rodrigo Sakai Database Programmer [EMAIL PROTECTED] http://www.2bfree.com.br Tel: (55) (11) 5083-5577 Fax: (55) (11) 5549

[SQL] Importation wtih copy generated some wrong registers..

2004-01-07 Thread Rodrigo Sakai
question is, why is it storing some exponential numbers (rows number 2 and 4) instead of a string if you look in the definition of the table above, the column 'num_contr' is a varchar(50)! So, what is happening? Thanks for any help!!! = Rodrigo Sakai Analist