Forms :: Post Query Trigger With Cursor
Jan 11, 2011
I create a master detail form. I created also a post quey trigger, inside I wrote the code below.A cursor looks to another table and returns to the form some values i need!
declare
cursor C1 is
select apofaa, startdate, enddate, transport
from trapofdet
where trapofdet.apofcode = :trapof.apofcode;
[code]....
How to solve the
a. frm-40737, illegal restricted procedure go block in post-query trigger
b. It seems tha returns all the records but it appears only the last one.
View 2 Replies
ADVERTISEMENT
Jun 12, 2012
I have an issue with the oracle forms trigger. This is the scenario. The form is a query only form . A user can only query on this form . No update or insert is allowed.
The base table say TABLE1 consists of these fields. 1) pro id, pro item, empno , fname, lname, deptno .
The user can query on all items except the fname and lname.
The issue is few records in the TABLE1 have null values for the empno.
When the user queries on proid, pro item , empno or deptno - when the empno on TABLE1 is not NULL , the fname and lname should be fetched from a different table say TABLE2. otherwise, if the empno on TABLE1 is null , the fname and lname from the same table i.e, TABLE1 are retrieved. I have tried with the post change trigger on empno . Also tried the When validate item trigger . But it doesnt work the way it is expected to. what is the appropriate trigger that must be used.
View 22 Replies
View Related
Feb 8, 2013
I have this layout
[URL]
and a post trigger insert and update
IF :item1 IS NULL
AND :item3 IS NOT NULL THEN
alert_id := FIND_ALERT('blank_alert');
SET_ALERT_PROPERTY(alert_id,ALERT_MESSAGE_TEXT,'Item3 must have a value.');
v_alert := SHOW_ALERT(alert_id);
RAISE Form_trigger_Failure;
END IF;
My problem was as it fires, the cursor will be on the item1. I've already use
SET_ITEM_INSTANCE_PROPERTY
NEXT_ITEM
GO_ITEM
but it was all illegal. The cursor must be in the item3.
Don't question me why I do not set the item3 to required and why post triggers. It is just that. It is the requirement.
View 4 Replies
View Related
Jul 15, 2013
I have a multi record block based on a view. All records in the view are displayed in the block by use of Post-Query trigger when entering the form.
The block has 5 items as follows:
1) RECORD_STATUS = a non-base table column which is a checkbox.
2) ITEM_TYPE = a text-item which has an LOV attached.
3) ITEM_TEXT = a text-item which is free format text.
4) LAST_UPDATE_DATE a date column
5) STATUS = a text item either 'Open' or 'Closed'
The LOV is based on a table of Item Types with values say, 'Type1', upto 'Type9'.
I have a Wnen-New-Record-Instance trigger which 'Posts' changes to the database. This has been included as i want to limit the values of the ITEM_TYPE column to values which have not been previously used.
Consider this scenario...
The block has 3 records.
record 1 has 'Closed' status so no updates are allowed.
record 2 has 'Open' status so updating of Item_Text is allowed.
record 3 has 'Open' status so updating of Item_Text is allowed.
I check the RECORD_STATUS checkbox on record2.
(This sets the RECORD_STATUS checkbox to a checked value and changes the STATUS column to 'Closed' by When-Checkbox-Changed trigger.) At this point the record has not been saved so if you uncheck the checkbox , then the STATUS column will go back to 'Open'. However at this point i will leave it as Checked (Closed).
I then insert a new record, only values Item4 to Item 9 are correctly shown in the LOV. I select Item4.
I then go back to the previous record and uncheck the Checkbox to say that i wish to leave it 'Open' after all (in effect no changes have occurred), then the STATUS column correctly reverts back to 'Open' by my WCC trigger. If i then SAVE the changes, the new record has been inserted on the database correctly, however the LAST_UPDATED_DATE from the record which was checked and then unchecked has also been updated incorrectly even though no net changes have actually occurred.
(because i am using WNRI trigger to limit the List of Values on the LOV column, this has incorrectly set the previous records LAST_UPDATED_DATE column to be Sysdate.)
How can i stop this from happening?
View 1 Replies
View Related
Feb 9, 2011
I am facing a post trigger problem.No error while compiling.
DECLARE
mYPACCT VARCHAR2(10);
mTRNNO NUMBER; mVNO NUMBER; mSR NUMBER; mNARRATION VARCHAR2(200); mCHCODE VARCHAR2(10); mPARTY VARCHAR2(200);
mBRAND VARCHAR2(200); mYARN VARCHAR2(200);
BEGIN
BEGIN
SELECT YPACCT INTO mYPACCT FROM CONFIG;
EXCEPTION WHEN NO_DATA_FOUND THEN NULL;
END;
[code].....
View 7 Replies
View Related
Aug 12, 2010
I have a form w/a tab canvas. BlkA is on Tab1 and Blk2 is on Tab2. In BlkA I have several items that have when-validate-item triggers. However, the trigger does not fire when I enter a value into item1 of BlkA followed by clicking on Tab2. To solve, I placed validate(form_scope) in the When-Tab-Page-Changed trigger. This works well with invoking the validation. However, focus remains on Tab2 (Blk2).
I would like focus to return to failed validation item in Blk1. I can capture the block name using :system.cursor_block in the Post-Block trigger of BlkA, assign that value to a form parameter and when a validation fails via the When-Tab-Page-Changed trigger I can return user back to BlkA(Tab1). However, I need direction on how to return user to the specific item in BlkA that failed validation
View 2 Replies
View Related
Jul 26, 2010
I have sort button that have the following code
go_block('TEL_OTHER_INFO');
set_block_property('TEL_OTHER_INFO',order_by,:system.cursor_item);
execute_query;
I have in the same form display item that its value will be sitting according to the post trigger of the previous text field when i press the sort button i get frm-40735 post-text-item unhandled exception Ora-01403 error.
View 2 Replies
View Related
Apr 13, 2012
I getting a error Ora-06511 when-new-item-instance trigger raised unhandled exception.
below is the coding for the trigger when-new-item-instance : where the cursor is open? how to close it?
if :blk_master.action_status = 'A' then
declare
doc_slno number;
[Code].....
View 3 Replies
View Related
Apr 12, 2011
How to secure my source code forms like my trigger query is, how can this process possible
View 4 Replies
View Related
Mar 8, 2010
What is the trigger which should be used to check certain field value after posting the query.
Example:
I have executed the query and the records are fetched. There is one field I want to check if it is null then it should be enabled, else, keep it disabled.
View 2 Replies
View Related
Jan 23, 2013
I have a view t1 having the records:
1 A
1 A+
2 B
3 C
4 D
I want to display that in an LOV but without the first record (1 A) I used the code :
SELECT DISTINCT num,
DECODE(num,1,(SELECT DISTINCT desc FROM t1 a
WHERE a.desc='A+'AND a.num=1),desc) desc
FROM t1
this worked fine but how to apply this in a post_change trigger where a user inters the num and the desc appears in atext-item in my form
View 1 Replies
View Related
Jun 17, 2013
When i select Filnumber(DEC99) and press QUERY button, i get error"frm-40735 pre-query trigger raised unhandled exception ora-06502".
View 1 Replies
View Related
May 7, 2010
I have been testing out a form using 10.1.2.0.2 on a v10.2.0.1 db and in my local env. the form works correctly i.e. if I make a change and 'post' it and then exit and press NO (when asked to save changes) then it correctly leaves the value in the database as it originally was.
The process works by the user pressing a button in form A (read only form) and this opens form B (using open_mode,session,activate) and the user makes their change(s) in form B (a 'post' command is issued in a When New Rec Inst trigger on a db block when the user navigates to a new record within the same block if it is determined that the block status <> 'QUERY') before returning to form A and pressing 'NO' when prompted to save changes.
However, if I run the same process in the TEST env. using the same executable against the same database then it actually updates the database value.
I have tested this by adding a debug message at the end of form B to retrieve the db value back AFTER having issued a clear_form(no_commit) just for the sake of the test and it still returns me the 'new' i.e. amended value - which is obviously incorrect. From what I can see it would appear that the commit occurs straight after the 'post' has been issued and well before the user even exits the form.
Is this a known bug with the 'post' built-in or could it be that a parameter is set to act in this way (i.e. is there an 'autocommit' setting that is 'ON') within the application server?
View 8 Replies
View Related
Aug 6, 2011
i m using oracle 10g forms. in one form i m using post keyword when i use this function then records saved in temporary database but i want to remove one record from this form but it is allrady saved through post.
View 1 Replies
View Related
May 23, 2010
We just migrated our technology platform on one of the six servers yesterday on production d/b as follows :
OAS Server - Linux Patch Applied (2.6.18-53.el5 #1 SMP Wed Oct 10 16:34:19 EDT 2007 x86_64 x86_64 x86_64 GNU/Linux)
D/B Server - From Oracle 10.2.0.2.0 to Oracle 10.2.0.4.0
Batch Server - From OpenVMS to Red Hat Linux
Post Migration, we are facing some issues with Oracle Forms 10g, Text Items which contains one or more than one multibyte characters, is displaying only # character in the entire text box instead of what is stored in the database. In other words, information in the database is stored correctly. Before Migration everything was working perfectly fine.
One other thing which I would like to tell here is that we compile forms using the following environment settings:
NLS_LANG_SEMANTICS=CHAR
NLS_LANG=AMERICAN_AMERICA.UTF8
View 9 Replies
View Related
Oct 20, 2010
tell me excat diff. between when- validate -item vs. post-change in a simple way...
View 4 Replies
View Related
Jul 29, 2010
I have a form which will call another and do some transactions and come back to original form and do other processes. save if successful. or roll back with error message.i m doing POST when i exit from the called form. and continue process in calling form. if any error, i m raising an error message with rollback.
But sometimes, it is getting committed with that error trn. especially in new database, first time try the scenario, it any error comes then getting commited.I m not able to find where the commit is happening? if any other sessions commit will affect this trn?
View 1 Replies
View Related
Dec 25, 2011
i have a problem with Cursor in trigger,
CODEcreate or replace trigger admin
after insert on admin
for each row
declare
bang varchar2(250):='ADMIN';
[code]...
i will try with select :new.i.column_name from dual, but not run (because i can't determination exactly column name thus i must use column_name variable)
View 6 Replies
View Related
Sep 26, 2011
I am working on form 10g, here i am using post command in save procedure to apply some record in database temporary.
But Frm-40404 Message raise during saving record i need post commond but i dont want to this message should popup, is there any method to avoid the message only?
View 7 Replies
View Related
Jul 1, 2011
How can "call one trigger of item in trigger of form"
View 5 Replies
View Related
Aug 20, 2013
I have a function :
FUNCTION WP19DUMMY(vname IN VARCHAR2) RETURN SYS_REFCURSOR
IS
tmpcur SYS_REFCURSOR ;
BEGIN
OPEN tmpcur FOR SELECT IVALUE FROM GENPARAMS WHERE NAME = vname;
RETURN tmpcur;
END WP19DUMMY;
I want to use the returned REF CURSOR in a SQL query. So I ran the following @ SQL prompt :
SELECT WP19DUMMY('TD') FROM DUAL;
and I am gettng the following result :
WP19DUMMY('TD
--------------------
CURSOR STATEMENT : 1
CURSOR STATEMENT : 1
IVALUE
-------------
0
BUT I do not want such a result. I want a result that will only return the IVALUE.
View 6 Replies
View Related
Aug 29, 2010
Is it possible to define a cursor using dynamic sql. Reason being is, I want to fetch data from 4 diffrent tables but dont want 4 diffrent cursors for this purpose.
I have a procedure that takes an in parameter . Cursor is declared in this procedure. Again is there a way to use dynamic sql so that this cursor declared in procedure uses all 4 table one at a time i.e cursor c1 is select * from table_name(I want this table name to be updated every time with new table name).
View 5 Replies
View Related
Mar 17, 2013
To display highest marks,least marks,average marks,total marks of the student name entered.
desc stud;
Name Null? Type
----------------------------------------- -------- ----------------------------
SID NUMBER
NAME VARCHAR2(20)
M1 NUMBER
M2 NUMBER
How do I do that using PL/SQL and without Cursor.
View 4 Replies
View Related
Jun 21, 2011
I want to pass a damn long query(which includes a lot of column names, tables, joins, union, where clauses etc. and whose length is more than 120000) in a Ref cursor (that's length is more than 32767). Query is stored in a LONG type variable V_QRY in stored procedure, and I am opening that ref cursor like below-
OPEN P_RPT_TEST FOR V_QRY;
at run time its giveing string buffer too small error.
View 7 Replies
View Related
Nov 11, 2012
Just explaining what I am trying to achieve:
1) i have a hr.departments table that was loaded in hr schema on 1st oct 2012 with 4 columns(department_id, department_name, manager_id, location_id)
2) now I have a new schema by my name 'rahul' and I have loaded departments table but now an additional column has come into picture,ie created_date, this table got loaded on 1st-Nov-2012
3) Now going forward my columns could be dropped from the departments table (it can be a case), for example might be my departments table in my schema 'rahul' one day could comprise of only 3 columns(department_id,department_name,manager_id)
4) Now in the next step, I have managed to extract common column names(in a single line where columns are delimited using a comma) from both the tables(hr.departments and rahul.departments) which are (department_id, department_name, manager_id, location_id) using all_tab_cols table and I have written a function for it which i will be pasting below.
5) now going forward, using the above column names line with column names delimited using comma, I have used a ref cursor and assigned a query to it using the line of columns that I have extracted from the above point
6) Now I want to create a record variable which refers to my ref cursor, something like we do when we create a record variable by reffering to an explicit cursor defination that we give in the declaration block.
PS:
1) I have been out of touch with plsql for a long time so I have lost a lot of mmeory regarding plsql.
2) basically I need to compare data in hr.departments table with rahul.departments table for only columns that are common to both the tables, rest new or discarded columns information will go in one of the log tables that I have created(this is done already)
Code :
===================================================================================================
create or replace procedure p_compare_data(fp_old_table_name in varchar2, fp_new_table_name in varchar2)
is
[Code].....
View 5 Replies
View Related
Dec 7, 2010
I am trying to create and update query to use as a trigger for updating information in a database which is dependent upon time.
I have a severity level which needs to be decreased in value after a set amount of time. the time of the action is recorded automatically on the creation of the the record. after an hour anything at severity level 2 needs to go up to 1, after 2 hours level 3 goes up to 2 and 3 hours level 4 goes up to 3
so far this is what I have
UPDATE calllog
SET timedate = current_timestamp, severityid = severityid - 1
WHERE ((severityid = 2 and timedate >= current_timestamp + (1/24)) or
(severityid = 3 and timedate >= current_timestamp + (2/24)) or
(severityid = 4 and timedate >= current_timestamp + (3/24)))
I am not getting any errors back from this sql but it is not updating the relevent information. I am using one cell for time and date in format = DD-MON-YYYY HH24:MM:SS.
View 3 Replies
View Related
Mar 14, 2012
How can i get data from Ref cursor on Oracle forms?
View 1 Replies
View Related
Feb 6, 2013
I have created/added one new RAC database.What post validation check has to be performed after creating new Database.
Note: already there is one DB exist in the server.
View 4 Replies
View Related
May 3, 2011
Find the sample data and table.
CREATE TABLE table_x
( arrival_time VARCHAR2 (8),
post_arrival_time VARCHAR2 (8),
arrival_date date
);
INSERT INTO table_x VALUES ('3:50 PM', '3:50 AM',trunc(sysdate)); -- Post arrival date = trunc(sysdate) - 1
INSERT INTO table_x VALUES ('3:50 AM', '1:00 AM',trunc(sysdate)); -- Post arrival date = trunc(sysdate)
INSERT INTO table_x VALUES ('11:59 AM','11:59 PM',trunc(sysdate)); -- Post arrival date = trunc(sysdate) - 1
Need to calculate Post arrival date .. which will be always < = Arrival date
View 8 Replies
View Related
Jul 1, 2011
I have installed Oracle 10g on Windows 7 64 bit today by own from the following link with data.
[URL]
1. At the start of my installation
Global Database Name : oracl
Password : my own password
2. At last i got the message "The installation of Oracle Database 10g was successful."
I have tried logon with
User Name as scott with tiger with Host String as oracl
User Name as scott with tiger
User Name as system with manager with Host String as oracl
User Name as system with manager
But i am unable to login to SQL.
Note: In between installation, i have not set any password.
View 7 Replies
View Related