Re: [SQL] accessing multiple database

2005-05-05 Thread Richard Huxton
mohammad izwan ibrahim wrote: hi all, im finding some ideas, method, advice, n etc on accessing multiple database.The system that i'm currently develop is real time update and the data reside on few different db at different db site. Tq in advance. Obviously you can access more than one database fr

Re: [SQL] HELP: aggregating insert rule for multirow inserts.

2005-05-05 Thread Mikey
What about this as a rule. It seems to work for me. create or replace rule critter_counter as on INSERT to critter do ( insert into zoostats select distinct new.legs where new.legs not in (select legs from zoostats); update zoostats set headcount = ( select c

Re: [SQL] accessing multiple database

2005-05-05 Thread mohammad izwan ibrahim
Hi Richard Huxton, Tq for your advice, Hope you can help me on this 1.can I create view from dblink query 2.can I fetch the data simultaneous from multiple database using dblink function, how the syntax would be? tq -- Original message -- From: "Richard Huxton" To: "mohammad izwan ibrahim"

Re: [SQL] accessing multiple database

2005-05-05 Thread Richard Huxton
mohammad izwan ibrahim wrote: Hi Richard Huxton, Tq for your advice, Hope you can help me on this 1.can I create view from dblink query I believe so - see the dblink docs for details. 2.can I fetch the data simultaneous from multiple database using dblink function, how the syntax would be? Not in

[SQL] Select of a function that returns a array

2005-05-05 Thread Não use este endereço para mensagens pessoais
Hi guys I'm trying to figure out a way to make this select work even for a wrong value: select mean_and_variancepop('golf', 'temperature'); or select CAST (mean_and_variancepop('golf', 'temperature') AS float(2)); This function return an array the function is: CREATE or replace FUNCTION mean_a

Re: [SQL] multi-column unique constraints with nullable columns

2005-05-05 Thread Mikey
It may be possible to bypass the NULL != NULL by using coalesce. Here is an example: create table foo2 ( a integer not null, b integer not null, c integer null, UNIQUE (a,b,c) ); create function foo2_unique_func() RETURNS trigger AS ' DECLARE isfound integer = 0; BEGIN isfound =