473,386 Members | 1,674 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,386 software developers and data experts.

How to use two tables in view? which is referred in the block of the forms

Hi All,

I am new to Oracle forms, I have a question,

I create a view with two tables, which is referred in the block of the froms, if i try to query the data it will populate the values but if i try to update the data it will not allow. But i need to update the data.

Query is like

select a.col1,b.col1
from table1
, (select b.col1,b.col2 from table2 ) t2
where a.col2 = b.col2


Please help me to proceed further.


Regards
Shankar
Oct 31 '06 #1
3 4346
milonov
32
hello, Shankar.

Usually stored procedures are used to make an update, or if you use oracle 9i or higher you can write trigger "instead of update" for this view .and put your logic in it.

example of "instead of update" trigger for view:

Expand|Select|Wrap|Line Numbers
  1. CREATE OR REPLACE TRIGGER your_view_vu_u
  2.       INSTEAD OF UPDATE
  3.       ON your_view
  4.       FOR EACH ROW
  5.       BEGIN                   
  6.           -- We can update col3
  7.           IF (:NEW.col3 <> :OLD.col3) THEN
  8.            UPDATE b  
  9.             SET    col3 = :NEW.dname,
  10.                       WHERE col2 = :OLD.col2;
  11.           END IF;
  12.       END;
  13.  
  14.  
Regards,
Michael Milonov
http://www.snotratech.com

Hi All,

I am new to Oracle forms, I have a question,

I create a view with two tables, which is referred in the block of the froms, if i try to query the data it will populate the values but if i try to update the data it will not allow. But i need to update the data.

Query is like

select a.col1,b.col1
from table1
, (select b.col1,b.col2 from table2 ) t2
where a.col2 = b.col2


Please help me to proceed further.


Regards
Shankar
Oct 31 '06 #2
Hi Michael,

I need to do the updation from the front end. If i refer the view from the block then i will not allow to edit any columns.


Regards
Shankar.M
Nov 1 '06 #3
milonov
32
Hello, Shankar.

IMHO the right solution is to create "view", for example
"create or replace view your_view_name as
select * from your tables.... "
and then write trigger "instead of update" for this view (see code in previous post). But of cource it is advice only.

Best Regards,
Michael Milonov
http://www.snotratech.com

Hi Michael,

I need to do the updation from the front end. If i refer the view from the block then i will not allow to edit any columns.


Regards
Shankar.M
Nov 1 '06 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Andreas Lauffer | last post by:
I changed from Access97 to AccessXP and I have immense performance problems. Details: - Access XP MDB with Jet 4.0 ( no ADP-Project ) - Linked Tables to SQL-Server 2000 over ODBC I used...
5
by: Jay McGrath | last post by:
Does anyone know if it is possible to prevent a user from accessing the tables in an MDE file? I can go to my start-up menu and limit access to various functions, etc. I could even disable the...
13
by: Aladdin | last post by:
I have an MS Access form on which I have a listbox listing tables in that database. I want to be able to click on any of those tables and view its contents on the same form using subforms or any...
3
by: Bob C. | last post by:
When I migrated my tables to SQL Server I needed a way to overcome the slow performance of the Find method on my recordsets. Although this can be done by accessing the table directly using dao and...
3
by: sea | last post by:
If a runtime installation of Access is created and installed on a client machine that has a full verion of access, will it still be possible to view the tables and queries in design view but not...
11
by: dskillingstad | last post by:
I've been struggling with this problem for some time and have tried multiple solutions with no luck. Let me start with, I'm a novice at Access and I'm not looking for someones help to design my...
1
by: Julia | last post by:
Hello there. I have a question somewhat related to this topic, and I don't know where else to go. I hope somebody can help. I've created a database in access, that I'd like to share with less...
53
by: Alan Silver | last post by:
Hello, I understand the issue that tables should be used for tabular data and not for layout, but I would like some clarification as to exactly what constitutes tabular data. For example, if...
3
by: jayhart | last post by:
Im having an issue with a database where Im missing tables and forms............but they still seem to be present (but not displayed). When Im looking at the table list, the table is not listed...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
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,...

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.