473,670 Members | 2,295 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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("vie wpatrix", 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 ,
customerdescrip tion.descr
iption, customer.firstn ame,
customer.lastna me from customer, customerdescrip tion
where
customer.custid =customerdescri ption.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 viewpatrixcustd esc as on update to
viewpatrix do instead update customerdescrip tion set
description=new .description where custid=old.cust id;
CREATE RULE
kv=#

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

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

But how to make that the user can I also update the
data in the table "customer" (customer.first name and
customer.lastna me).

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 957

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

Similar topics

1
2623
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 Studio .Net, where you can see the available database, expand it to get a list of tables, etc. What level of access is required? Of course you need to have an account with the right user rights, but is there some specific service that needs to be...
4
8660
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 select a row and delete that row however this seem impossible right now. I am not sure if it's possible to delete a row from a view?? Or could it be that these tables are all interconnected and in order to delete a record that is joined to one or more...
4
2713
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 add insert and delete triggers to each of the underlying tables. The triggers modify a different set of tables in the same database as the view (different than the underlying table). The problem is those triggers aren't fired when inserting or...
2
2306
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 somehow run this same SQL statement within the view but hit all 5 servers so we don't have 5 different versions of this data to mess with. I'm not opposed to creating an update query in a stored procedure to hit all 5 databases and update a...
3
12408
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 database: create view my_view as
1
2834
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? Database: Access 97 Connection: ADO 2.0 Please reply to my email aswell as the group if possible.
7
15054
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 table C which has field 1,6,7,8,9. I would like to join on field 1 and bring in the other fields. I can join table C to A or B. I can union table A and B but I do not know how to both union A and B then join C. Can someone please help me? Thanks...
12
7495
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 it to reset info in a combo box. Below is some sample code for my view interface and the presenter: public interface IDevToolView
5
7226
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, but will be migrating my back ends to Oracle ODBC. 1. Does anyone have recommendations for books or web resources for general rules/guidelines/help on doing this? I haven't found a good
2
9834
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 to open in datasheet view. As an experiment, I deleted all rows in all tables; after that, the query took only seconds to open in both design view and datasheet view. From these facts, I conclude that Access is evaluating the query when I go to...
0
8471
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8388
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8663
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7423
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5687
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4215
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4396
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2804
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1799
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.