473,394 Members | 1,787 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

one view for 2 different tables

Dear my friends...

I am developing a database application with postgres
7.2.x, qt on SuSE 9.1 . I am in a situation where I
have to use QDataTable and I have to use QSqlCursor
that support only 1 table manipulation ( QSqlCursor *
cursor = QSqlCursor("viewpatrix", true, db); ).

So, as a strategy I make a view. with this view I hope
I can work with more than 1 table at a time.

kv=# create view viewpatrix as select customer.custid,
customerdescription.descr
iption, customer.firstname,
customer.lastname from customer, customerdescription
where
customer.custid=customerdescription.custid;

but I have problems if I want to make data update and
data insertion from the QDataTable because I don't
know how the rule should be.

kv=# create rule viewpatrixcustdesc as on update to
viewpatrix do instead update customerdescription set
description=new.description where custid=old.custid;
CREATE RULE
kv=#

OK, it works if the user wants to update the data in
table "customerdescription".

should I simply create another rule like this:
kv=# create rule viewpatrixcust as on update to
viewpatrix do instead update customer set
firstname=new.firstname, lastname=new.lastname where
custid=old.custid;
CREATE RULE
kv=#

But how to make that the user can I also update the
data in the table "customer" (customer.firstname and
customer.lastname).

Is it possible to create one view but from
updating/inserting the data in the coresponded rule
than the records in more then 2 tables are also
updated/inserted?

Thank you very much for your help.

__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!
http://promotions.yahoo.com/new_mail

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Nov 23 '05 #1
0 949

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Bennett Haselton | last post by:
I want to get an ASP.Net hosting account with my ISP, and I'm trying to find out what level of access to the server is requried in order for me to view the server in Server Explorer in Visual...
4
by: XmlAdoNewbie | last post by:
Hi All, I am using Microsoft SQL Enterprise Manager version 8.0 and have created a view from a combination of 4 different tables. I would like to be able to go into sql and open the view and...
4
by: stacdab | last post by:
We have a partitioned view with 4 underlying tables. The view and each of the underlying tables are in seperate databases on the same server. Inserts and deletes on the view work fine. We then...
2
by: Ringo Langly | last post by:
Hi everyone, I have 5 servers, all with identical databases just different data. I have a rather lengthy SQL statement (in a View) to hit one database and pull-in certain data, but I'd like to...
3
by: Seba | last post by:
For db2 UDB I need to get dependency information for views. What I'm looking for is the tables that have the source information for the view. i.e. : if the following view was defined in my...
1
by: Chad Reid | last post by:
I was wondering what the VBA code would be to test to see if a view already exists, or how to overwrite a view if it already exists. Also, how would I do the same for a regular table? ...
7
by: jason.langdale | last post by:
I have 3 tables I want to use in a view. Table A has field 1,2,3,4,5 and table B has field 1,2,3,4,5. I want to do a union on these. (I have done so successfully if I stop here) I also want to join...
12
by: Doug | last post by:
Hi, I learned a little about the model view presenter pattern at a conference this last week and am experimenting with it. It's working pretty well but I have a question. I am trying to use...
5
by: jonceramic | last post by:
Hi All, I started developing in Access, and people took notice and so we're starting to migrate into our corporate's bigger Oracle system. I'll still be using my developed Access front ends,...
2
by: existential.philosophy | last post by:
This is a new problem for me: I have some queries that open very slowly in design view. My benchmark query takes about 20 minutes to open in design view. That same query takes about 20 minutes...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.