how to create view dynamically [message #331988] |
Mon, 07 July 2008 02:46 |
masterborj
Messages: 21 Registered: October 2007 Location: Philippines
|
Junior Member |
|
|
how could i create a view dynamically by using a trigger.
i try to do it inside the trigger "key-next-item" but it give me an error "encountered the symbol "CREATE" when expecting......."
--my code--
CREATE OR REPLACE FORCE VIEW "MASTERBORJ"."JVDETAIL" ("JV_NO", "OR_NO", "ACCOUNT_CODE", "OR_AMOUNT", "LASTUSER") AS
select jv_no,or_no, account_code, or_amount, lastuser
from jv_agt_dtl
union
select jv_no,or_no, accnt_code, or_amount, lastuser
from jv_appl_dtl
union
select jv_no,or_no, account_code, or_amount, lastuser
from jv_contract_dtl
union
select jv_no,or_no, account_code, or_amount, lastuser
from jv_loan_dtl;
experts help please....
regards
master_borj
|
|
|
|
|
|
|
Re: how to create view dynamically [message #332002 is a reply to message #331999] |
Mon, 07 July 2008 03:52 |
Frank
Messages: 7901 Registered: March 2000
|
Senior Member |
|
|
First of all, you should make clear that you are referring to Forms-trigger, not database triggers.
Second: why do you think you need to create the view from within the Form? Why not create it now, in sqlplus and use it in the form?
|
|
|
Re: how to create view dynamically [message #332009 is a reply to message #331999] |
Mon, 07 July 2008 04:20 |
JRowbottom
Messages: 5933 Registered: June 2006 Location: Sunny North Yorkshire, ho...
|
Senior Member |
|
|
If your application would benefit from this view, then get it created once on the server, by your DBAs, or your server side developers. That way everyone will know about it, and it will be included in your source control and releases.
Alternatively, you can just use a FROM CLAUSE query on one of your data blocks in Forms, and include the text of the view query in there - that way you can select the data that the view would return without needing to create the view.
|
|
|
|