Thread: ask for help !!! (emergency case)

ask for help !!! (emergency case)

From
"Jaruwan Laongmal"
Date:
dear all
I hava 2 problems about view
1. i can't insert into view
2. i can't create view with union

I try to insert into view as following
create table t1 (id int,name varchar(12) check(id<=10));
create table t2 (id int,name varchar(12) check(id>10));
create view v1 as select * from t1,t2;
insert into v1 values(1,'wan1');
insert into v1 values(12,'wan12');

it does not show any problem but it doen't have data in table t1 and table
t2

------------------------------
if i want to distribute database into 2 database servers
and i want to insert into database1.table1 when database1.table1.id <=100
and i want to insert into database2.table2 when database2.table2.id >100

How can i do that with create view .........as .......union all ............
and insert into view ,afterthat view is check condition and distrubute data
into diferent database
up on condition

and How to configure the postgres sql server?

If you have idea or example for solving this problem , pls help me
thank you so much , i'm looking forward to seeing your response.
Regards,




Re: ask for help !!! (emergency case)

From
jdassen@cistron.nl (J.H.M. Dassen (Ray))
Date:
Jaruwan Laongmal <jaruwan@gits.net.th> wrote:
>create view v1 as select * from t1,t2;
>insert into v1 values(1,'wan1');

Quoting http://www.postgresql.org/docs/aw_pgsql_book/node149.html:
: Because views are not ordinary tables, INSERTs , UPDATEs , and DELETEs  on
: views have no effect. The next section shows how rules can correct this
: problem.   

HTH,
Ray
-- 
Pinky, Are You Pondering What I'm Pondering?
Ewww, I think so Brain, but I think I'd rather eat the Macarena. Pinky and the Brain in "Plan Brain From Outer Space"