Before Paramter form trigger problem
In Before Paramter form trigger
function BeforePForm return boolean is
w_cnt number;
begin
if user <> 'PF' then
select count(*)
into w_cnt
from tab
where tname = 'PFMAST';
if w_cnt > 0 then
srw.do_sql('drop table pfmast');
srw.do_sql('drop table pfloan');
srw.do_sql('drop table wspfcard1');
srw.do_sql('drop table wspfcard2');
end if;
srw.do_sql('create table pfmast as
select *
from pf.pfmast');
srw.do_sql('create table pfloan as
select *
from pf.pfloan');
srw.do_sql('create table wspfcard1 as
select *
from pf.wspfcard1');
srw.do_sql('create table wspfcard2 as
select *
from pf.wspfcard2');
end if;
return (TRUE);
end;
I am creating 4 temporary tables which are used in this report dynamically by adding the session id to this 4 table name.
It works fine till the parameter form is displayed. I choose the parameter and run the report. When i do that it agian tries to execute before parameter form trigger (which i can't understand why it is going to before parameter form trigger).
Kindly support
Thanking All in anticipation.
Hello,
http://www.oracle.com/webapps/online-help/reports/10.1.2/topics/htmlhelp_rwbuild_hs/rwrefex/plsql/triggers/tr_before_param_form.htm
Usage Notes
If the Parameter Form is used on the Web, the Before Parameter Form trigger fires twice: once when the Parameter Form is displayed, and a second time when the parameters are submitted. This is because Reports Builder executes in a stateless fashion. There is no session to return to, so the Before Parameter Form trigger has to fire the second time to ensure that the parameters selected on the Parameter Form and passed on the command line are valid.
Regards
Similar Messages
-
Parameter not being set in before parameter form trigger
I am running 10g reports over the web and have a problem with some parameters. I have a User parameter which I set in the BEFORE-PARAMETER-FORM trigger. This parameter is not displayed on the parameter form because it shouldn't ever be changed by a user. It is supposed to be displayed on the report output to show who ran the report, but it is appearing blank.
I've found that if I physically display the parameter on the parameter form it works, but this isn't a realistic option. It looks like it gets cleared out if it isnt displayed on the parameter form. Can anyone explain why and offer any help?Assign value to the parameter in the After Parameter Form Trigger, not Before.
-
Reports 10g problem: Before parameter form trigger(BPFT) problem
In report bilder there is no problem - I get parameter form wit all the parameters, I initialized in BPFT
function BeforePForm return boolean is
s_date date;
begin
s_date := Trunc(SYSDATE);
if :PAR_TEM_OD is null then
:PAR_TEM_OD := '1';
end if;
if :PAR_TEM_DO is null then
:PAR_TEM_DO := '9';
end if;
if :PAR_DAT_OD is null then
:PAR_DAT_OD := s_date ;
end if;
if :PAR_DAT_Do is null then
:PAR_DAT_Do := s_date ;
end if;
return (TRUE);
end;
PAR_DAT_... is data type DATE wit input mask DD.MM.YYYY.
REPORT crashes when I run it from forms - no parameter form is displayed. When I initialize only CHAR PARAMETERS IN BPFT then I get result - parameter form is displayed. . The problem is when I want to initailize DATE parameters.
Any idea?
GordanWhy are you using srw.do_sql here? You are just performing some sql and pl/sql statements here. This is an explanation of do_sql in the Report Builder Help:
"Since you cannot perform *DDL statements* in PL/SQL, the SRW.DO_SQL packaged procedure is especially useful for performing them within Report Builder, instead of via a user exit."
So, your code would simply be:
function BeforePForm return boolean is
segment2 varchar2(10);
begin
select segment1
into segment2
from xxmssl_po_headers_all
where rownum<2;
... etc. ...
end; -
Problem in Insertion into table through After Report Parameter form trigger
Hi All,
I am getting problem in inserting some data into temp table through Report.
My requirement is like that, I have to do a calculation based on user parameters, and then insert the data into the temp table. I wanted to do this into After Report Parameter form trigger function. I have done all the calculation and wrote all the insert statement in that function. There is no problem in compilation. then I am taking value from this temp table in my formula columns.
When I run this report, it hangs, don't understand what is the problem.Can anybody help me out in this.
Thanks,
NidhiThe code is as follows:
function AfterPForm return boolean is
CURSOR CUR_RECEIPT(RECEIPT_NUM_FROM NUMBER, RECEIPT_NUM_TO NUMBER) IS
SELECT DISTINCT receipt, item_no FROM xxeeg.xxeeg_1229_sp_putaway WHERE RECEIPT BETWEEN
RECEIPT_NUM_FROM AND RECEIPT_NUM_TO ;
V_CUR_RECEIPT CUR_RECEIPT%ROWTYPE;
begin
OPEN CUR_RECEIPT(:RECEIPT_NUM_FROM, :RECEIPT_NUM_TO);
FETCH CUR_RECEIPT
INTO V_CUR_RECEIPT;
LOOP
EXIT WHEN CUR_RECEIPT%NOTFOUND;
IF V_CUR_RECEIPT.ITEM_NO = 'TEST1' AND V_CUR_RECEIPT.RECEIPT = '12' THEN
INSERT INTO SP_TEMP
(RECEIPT, ITEM_NO, LOCATION1)
VALUES
(V_CUR_RECEIPT.RECEIPT, V_CUR_RECEIPT.ITEM_NO, 10);
UPDATE SP_TEMP
SET LOCATION2 = 12
WHERE RECEIPT = V_CUR_RECEIPT.RECEIPT AND ITEM_NO = V_CUR_RECEIPT.ITEM_NO;
UPDATE SP_TEMP
SET LOCATION3 = 13
WHERE RECEIPT = V_CUR_RECEIPT.RECEIPT AND ITEM_NO = V_CUR_RECEIPT.ITEM_NO;
UPDATE SP_TEMP
SET LOCATION4 = 14
WHERE RECEIPT = V_CUR_RECEIPT.RECEIPT AND ITEM_NO = V_CUR_RECEIPT.ITEM_NO;
ELSE
IF V_CUR_RECEIPT.ITEM_NO = 'TEST2' AND V_CUR_RECEIPT.RECEIPT = '12' THEN
INSERT INTO SP_TEMP
(RECEIPT, ITEM_NO, LOCATION1)
VALUES
(V_CUR_RECEIPT.RECEIPT, V_CUR_RECEIPT.ITEM_NO, 10);
UPDATE SP_TEMP
SET LOCATION2 = 16
WHERE RECEIPT = V_CUR_RECEIPT.RECEIPT AND ITEM_NO = V_CUR_RECEIPT.ITEM_NO;
UPDATE SP_TEMP
SET LOCATION3 = 17
WHERE RECEIPT = V_CUR_RECEIPT.RECEIPT AND ITEM_NO =V_CUR_RECEIPT.ITEM_NO;
UPDATE SP_TEMP
SET LOCATION4 = 18
WHERE RECEIPT = V_CUR_RECEIPT.RECEIPT AND ITEM_NO = V_CUR_RECEIPT.ITEM_NO;
ELSE
INSERT INTO SP_TEMP
(RECEIPT, ITEM_NO, LOCATION1)
VALUES
(V_CUR_RECEIPT.RECEIPT, V_CUR_RECEIPT.ITEM_NO, 10);
UPDATE SP_TEMP
SET LOCATION2 = 19
WHERE RECEIPT = V_CUR_RECEIPT.RECEIPT AND ITEM_NO = V_CUR_RECEIPT.ITEM_NO;
UPDATE SP_TEMP
SET LOCATION3 = 20
WHERE RECEIPT = V_CUR_RECEIPT.RECEIPT AND ITEM_NO =V_CUR_RECEIPT.ITEM_NO;
UPDATE SP_TEMP
SET LOCATION4 = 21
WHERE RECEIPT = V_CUR_RECEIPT.RECEIPT AND ITEM_NO = V_CUR_RECEIPT.ITEM_NO;
END IF;
END IF;
END LOOP;
COMMIT;
CLOSE CUR_RECEIPT;
return(TRUE);
end;
..................................................................................................................... -
Difference between After parameter Form Trigger and before Report Trigger
hi,
Can some one tell me difference between After parameter form Trigger and Before parameter trigger.
Why do we need both these trigger , why can't we use any one of them because after parameter trigger will obviously fire before report trigger and similarly before report trigger will fire after parameter form.
Thanks
RamHi,
i will make it clear..!
Actually, we have four type of triggers in reports..!
Before Parameter -- fires before params are suppied to the calling report..
After Parameter -- fires after params are suppied to the calling report..
Before Report -- fires before report is generated..
After Report. -- fires after report is generated..
Before Report and After Report triggers are used for formatting the report design..
like u can specify a report to be displayed based on a condition in the Before
Report trigger and u can specify some backend updations in the after report trigger
which fires after report is generated.. -
Calling report from form and after parameter form trigger
Hi, I've also posted to this to the reports forum but because it works from Reports Builder it may be a forms issue which is why I'm x-posting. Apologies.
I have a report that creates a file, desname is set in the after parameter form trigger (it uses one of the parameter values).
The problem is file is not created using the path and filename set in the trigger, the file is created in the bin folder with the name account_by_service_type.txt (account_by_service_type.rdf is the report definition).
If the desname is set in the before parameter form AND a field with the source=desname is added to the parameter form then the file will be created with the correct path and name however it won't have the relevant parameter incorporated into the file name obviously.
I've noticed in other reports that where the desname is being set in the after parameter form that I've had to pass the desname from the form but obviously I cannot do that here either.
Am I missing something obvious?
Regards
SeanHi Frank,
It's WebForms. Below is the code:
-- call from menu item
run_report_object_proc(TRUE,'accounts_by_service_type.RDF',null,FILE,'delimited','paramform=yes');
-- run_report_0bject procedure
PROCEDURE run_report_object_proc (p_screen IN BOOLEAN,
p_report_filename IN VARCHAR2,
p_desname IN VARCHAR2,
p_destype IN NUMBER,
p_desformat IN VARCHAR2,
p_paramform IN VARCHAR2)IS
v_report_id report_object;
v_report varchar2(100);
v_job_id varchar2(100);
v_url varchar2(1000);
rep_status varchar2(20);
hidden_action VARCHAR2(2000) :='';
BEGIN
v_report_id := find_report_object( 'report2');
SET_REPORT_OBJECT_PROPERTY(v_report_id,REPORT_FILENAME,p_report_filename);
SET_REPORT_OBJECT_PROPERTY(v_report_id,REPORT_DESNAME,p_desname);
SET_REPORT_OBJECT_PROPERTY(v_report_id,REPORT_DESTYPE,p_destype);
SET_REPORT_OBJECT_PROPERTY(v_report_id,REPORT_DESFORMAT,p_desformat);
hidden_action := hidden_action||'&report='||GET_REPORT_OBJECT_PROPERTY(v_report_id, REPORT_FILENAME);
hidden_action := hidden_action||'&destype='||GET_REPORT_OBJECT_PROPERTY(v_report_id, REPORT_DESTYPE);
hidden_action := hidden_action||'&desformat='||GET_REPORT_OBJECT_PROPERTY(v_report_id, REPORT_DESFORMAT);
hidden_action := hidden_action||'&userid='||GET_APPLICATION_PROPERTY(username)||'/'||GET_APPLICATION_PROPERTY(password)||'@'||GET_APPLICATION_PROPERTY(connect_string);
if p_desname is not null then
hidden_action := hidden_action||'&'||p_paramform||'&desname='||p_desname;
else
hidden_action := hidden_action||'&'||p_paramform;
end if;
hidden_action := '/reports/rwservlet?_hidden_server=rserv1'||hidden_action;
SET_REPORT_OBJECT_PROPERTY(v_report_id, REPORT_OTHER, 'pfaction='||hidden_action||' '||p_paramform);
-- SET_REPORT_OBJECT_PROPERTY(v_report_id, REPORT_OTHER, 'paramform=no');
v_report := run_report_object( v_report_id);
IF p_screen THEN
v_job_id := substr(v_report,instr(v_report,'_',-1)+1);
rep_status:=report_object_status(v_report);
while rep_status in ('RUNNING', 'OPENING_REPORT', 'ENQUEUED')
loop
rep_status:=report_object_status(v_report);
end loop;
if rep_status='FINISHED' THEN
v_url := '/reports/rwservlet/getjobid'||v_job_id||'?server=rserv1';
web.show_document(v_url,'_blank');
else
message(rep_status||' error running report');
end if;
end if;
END;
-- report after parameter form trigger
function AfterPForm return boolean is
begin
:desname := 'c:\service_type_'||:p_service_type||'_'||to_char(sysdate,'DDMMYYYY')||'.xls';
return (TRUE);
end; -
Report Builder 6i returns ORA-01483 in after parameter form trigger ?
Can anybody help me ?
I've been working on a report with report builder 6.0.8.11.3,
and whenever i run the report the after parameter form trigger
returns REP-1401 and following ORA-01483.
I've been trying to change the values of some user parameters
from within the trigger code, none of them is a date or a number
parameter, these are character variables who would be referenced
lexically to change a table name dynamically when the trigger
fires. Aditionally I'm using a cursor to obtain data and then
modify the parameters.
How can i get this thing to work ?
Thanks in advance for your reply...hello,
this might be related to the usage of number(1) as type/length
of your parameter. this is a known problem. it should be solved
by using e.g. number(2) as the type/length of your parameter.
regards,
the oracle reports team --pw -
Require name and date before printing form
I have a 13 page PDF that a customer or our staff prints from our website. Often the customer or staff does not name and date each page of the form. Not having a name and date on each page of the form causes problems when they customer returns the form to the office, and the form pack gets divided for scanning into different areas of the customer file. 1) Is there an Adobe product that changes a PDF to require the downloader of the form to place a first and last name in the name field before printing. 2) Also, I would need a date stamp placed on the form when it prints. Is there I product that could help me program this PDF to do these 2 things? This post is the first time I can recall posting in this community. Any other suggestions are welcome. Thank you.
>> 1) Is there an Adobe product that changes a PDF to require the downloader of the form to place a first and last name in the name field before printing.
Many fields have a "Required" property. This is used when a form is submitted to a scripted web page for processing to throw an error message if any required fields are not completed.
One can use this property within a an action for a form to check if required fields are competed.
>> 2) Also, I would need a date stamp placed on the form when it prints.
I would add a form field that is filled in with the print date and time by some JavaScript in the Will Print action. -
I'm trying to use form generator from Designer 6i rel 2.
I found big problems regenerating a migrated application.
Layout of most of my blocks is completely changed and I can't reproduce the previous behaviour.
I found some solutions using relative tabs but may problems are still there.
The biggest problems I've are on tab canvases :
1 - I use the same font as before (6.0) but the generated canvases are smaller and fields don't fit in it.
2 - The height of the tab canvases is smaller then before and form developer tries to reduce it every time I run it giging me a CDG-3484 "error"
3 - the stacked footer disappeared (sometime totaly somtime partialy).
Please give me any suggestion or idea.
TIA
TullioWe noticed the same thing when we started creating Headstart for Designer 6i. Some things we found:
- We used to always leave page width/height blank to get optimal layout. Now it seems to work better if you specify a value.
- We found that we get better results when we explicitly specify height and width on all displayed items as well. (We didn't used to ever specify a width on a date column, nor height on any column that we wanted to default to 1.)
- Designer used to widen the page when an individual item was too wide. Now it narrows the item.
- Designer has changed its algorithm for determining item width.
- Designer has added new objects in its object library for Display Only (_DO) objects which affects the layout of these objects particularly.
Of course, using Headstart we had the luxury of knowning that our object library, template form and preference settings had not changed. If you are using the Designer default object library, template and preferences, I recommend you carefully compare the old versus the new. There may be changes to these underlying objects which would of course affect your generated modules.
Regards,
Lauri -
REP-52007 Error and Web Parameter Form Format Problems
I am attemting to get Oracle 9i reports working. I created a super simple report just for test purposes. I am using the following URL to call it directly from the browser:
http://myserver.com:8008/reports/rwservlet?server=repapp&report=jtest_rep.rdf&userid=myuser/mypass@mydb&DESTYPE=cache&DESFORMAT=pdf&PARAMFORM=YES
When it generates the parameter form page, the formatting of the section that has the paramters is terrible. Looking at the HTML generated, it is creating a large <table> that places the elements outside of the viewing area. I do not know how why it is doing this or how to fix it.
If I actually do find the field and enter in the prameter and hit submit, I then get:
REP-52007: Parameter form format error.
java.lang.IllegalStateException: Response is already committed! at com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].server.http.EvermindHttpServletResponse.setContentType(EvermindHttpServletResponse.java:973) at javax.servlet.ServletResponseWrapper.setContentType(ServletResponseWrapper.java:27) at oracle.reports.rwclient.RWReportRunner.setContentType(RWReportRunner.java:261) at oracle.reports.rwclient.RWReportRunner.getMainFile(RWReportRunner.java:135) at oracle.reports.rwclient.RWReportRunner.getMainFile(RWReportRunner.java:95) at oracle.reports.rwclient.RWClient.runReport(RWClient.java:1312) at oracle.reports.rwclient.RWClient.processRequest(RWClient.java:1129) at oracle.reports.rwclient.RWClient.doPost(RWClient.java:318) at javax.servlet.http.HttpServlet.service(HttpServlet.java:283) at javax.servlet.http.HttpServlet.service(HttpServlet.java:336) at com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:59) at oracle.security.jazn.oc4j.JAZNFilter.doFilter(JAZNFilter.java:283) at com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:523) at com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:269) at com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:735) at com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].server.http.AJPRequestHandler.run(AJPRequestHandler.java:151) at com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].util.ThreadPoolThread.run(ThreadPoolThread.java:64)
If I set paramform=no and pass in the parmater in the url string, then it skips the paramter form and runs fine accepting the input.
Any idea what the solution is for these two errors?After more searching, I found out that the problem for both is an Oracle Bug posted on mealink. It has to do with using capital letters for the oracle default parameters. Once you make it lower case, it works.
ex:
http://myserver.com:8008/reports/rwservlet?server=repapp&report=myreport.rdf&userid=myid/mypass@mydb&destype=cache&desformat=pdf¶mform=yes -
FRM-40735:PRE-FORM trigger raise unhandled exception ORA-04067
FRM-40735:PRE-FORM trigger raise unhandled exception ORA-04067:not executed, stored, procedure "PUBLIC.FND_TIMEZONES" does not exist.
After I log into Applications, and when I click on responsibility, and when I'm in the Form to retreive the Navigator page, I got the above error.
If I click on any one of the menu from the list, I automatically gets log off. "your logon session has become invalid".
please help..Hi,
Yes this was working befor enable rapid clone feature.How did you enable this feature? Did you apply any patches?
Following Task has been made by me:
Enable Rapid Clone Featue -------> execute pre clone -------> change IP and Hostname --------> execute post clone-----------> change has been made sucessfully.
APPS.FND_TIMEZONE package is not avaliable .What does this query return?
SQL> select object_name, object_type, owner
from dba_objects
where object_name = 'FND_TIMEZONES';Regards,
Hussein -
Oracle Forms Trigger firing hierarchy flowchart
Greetings,
In 1994, there was a "Oracle Forms Processing Manual" (Oracle part# A11990-2).
This book contained the visual representation of Oracle Forms processes showing where each trigger fires.
Where is this "flow-chart" in documentation available today?
I need to know the explicit chronological sequence of each trigger firing....
Pre-Form trigger fires first...then the When-New-Form-Instance....etc
Thank you for your support!Sorry.
Let me clarify.
Need to know where it is defined about which trigger fires before or after which other trigger….
The whole sequence…every trigger…
Example:
Document must show stuff like ON-COMMIT fires before(or after) POST-DELETE.
So I am certain that when a delete is initiated by the user, the ON-COMMIT fires before(or after), and so data in the database record is still available(or not available) to the code in the ON_COMMIT trigger.
This helps me know for certain what really happens, step-by-step, when Forms deletes a record.
So the document must show a visual representation of the DELETE EVENT.
This visual representation must explicitly show the ON-COMMIT trigger and the PRE-DELETE trigger and the ON-DELETE trigger and the POST-DELETE trigger…
Thank you! -
Hello all, i have a ' Mutating DB Trigger Problem' for the following Trigger :
=============================================
CREATE OR REPLACE TRIGGER ASSIUT.EMP_ATTENDANCEE_MONA
AFTER INSERT
ON ASSIUT.ACCESSLOG
REFERENCING NEW AS NEW OLD AS OLD
FOR EACH ROW
DECLARE
V_COUNT CHAR(2);
--V_COUNT_OUT CHAR(2);
BEGIN
IF :NEW.INOUT = 'IN' THEN
INSERT INTO EMP_ATTENDANCEE (EMP_ID, DATE_IN ,DATE_OUT ,TIME_IN ,TIME_OUT)
VALUES (TO_NUMBER(TO_CHAR(:NEW.employeeid,99999)),
TO_DATE(:NEW.LOGDATE,'dd/mm/rrrr'), -- DATE_IN
NULL,
TO_DATE(:NEW.LOGTIME,'HH24:MI:SS'), -- TIME_IN
NULL ); -- TIME_OUT
SELECT COUNT(employeeid )
INTO V_COUNT
FROM ACCESSLOG
WHERE employeeid =:NEW.employeeid
AND LOGDATE =:NEW.LOGDATE
AND LOGTIME =:NEW.LOGTIME
AND INOUT ='IN';
IF V_COUNT > 0 THEN
INSERT INTO ATT_INCOMPLETE ( EMP_ID , ATT_DATE , ATT_TIME , ATT_FLAG)
VALUES (TO_NUMBER(TO_CHAR(:NEW.employeeid,99999)),
TO_DATE(:NEW.LOGDATE,'dd/mm/rrrr'), -- DATE_IN
TO_DATE(:NEW.LOGTIME,'HH24:MI:SS'), -- TIME_IN
1); -- check in
END IF;
ELSIF :NEW.INOUT = 'OUT' THEN
UPDATE EMP_ATTENDANCEE
SET DATE_OUT = TO_DATE(:NEW.LOGDATE,'dd/mm/rrrr'), -- DATE_OUT,
TIME_OUT = TO_DATE(:NEW.LOGTIME,'HH24:MI:SS') -- TIME_OUT
WHERE EMP_ID = TO_NUMBER(TO_CHAR(:NEW.employeeid,99999))
AND DATE_IN = (SELECT MAX (DATE_IN )
FROM EMP_ATTENDANCEE
WHERE EMP_ID = EMP_ID
AND DATE_OUT IS NULL
AND TIME_OUT IS NULL ) ;
SELECT COUNT(employeeid )
INTO V_COUNT
FROM ACCESSLOG
WHERE employeeid =:NEW.employeeid
AND LOGDATE =:NEW.LOGDATE
AND LOGTIME =:NEW.LOGTIME
AND INOUT ='OUT';
IF V_COUNT > 0 THEN
INSERT INTO ATT_INCOMPLETE ( EMP_ID , ATT_DATE , ATT_TIME , ATT_FLAG)
VALUES (TO_NUMBER(TO_CHAR(:NEW.employeeid,99999)),
TO_DATE(:NEW.LOGDATE,'dd/mm/rrrr'), -- DATE_IN
TO_DATE(:NEW.LOGTIME,'HH24:MI:SS'), -- TIME_IN
0); -- check in
END IF;
END IF;
EXCEPTION
WHEN OTHERS THEN RAISE;
END EMP_ATTENDANCEE_MONA ;The above Trigger generates the following error:
ORA-04091: table ASSIUT.ACCESSLOG is mutating, trigger/function may not see it
ORA-06512: at "ASSIUT.EMP_ATTENDANCEE_MONA'", line 65
ORA-04088: error during execution of trigger 'ASSIUT.EMP_ATTENDANCEE_MONA'i want an easy and a straight forward solution to this problem which occured on selecting or manipulating from the same table i triggered it.
Best regards,
Abdetu..Create a package
CREATE OR REPLACE PACKAGE PK_TRIGGER IS
PROCEDURE PR_BS;
PROCEDURE PR_ARIU(i_vcType IN TABLE.COLUM%TYPE, i_nEmpId TABLE.COLUM%TYPE, i_vcLogDate IN TABLE.COLUMN%TYPE, i_vcLogTime IN TABLE.COLUMN%TYPE);
PROCEDURE PR_AS;
END;
CREATE OR REPLACE PACKAGE BODY IS
TYPE tData IS RECORD (
vcType TABLE.COLUMN%TYPE,
nEmpid TABLE.COLUMN%TYPE,
vcLogDate TABLE.COLUMN%TYPE,
vcLogTime TABLE.COLUMN%TYPE
TYPE tDataList IS TABLE OF tData INDEX BY BINARY_INTEGER;
lData tData;
PROCEDURE PR_BS IS
BEGIN
lData.DELETE;
END;
PROCEDURE PR_ARIU(i_vcType IN TABLE.COLUM%TYPE, i_nEmpId TABLE.COLUM%TYPE, i_vcLogDate IN TABLE.COLUMN%TYPE, i_vcLogTime IN TABLE.COLUMN%TYPE) IS
iPos PLS_INTEGER:=lData.COUNT+1;
BEGIN
lData(iPos).vcType:=i_vcType;
lData(iPos).nEmpId:=i_nEmpId;
lData(iPos).vcLogDate:=i_vcLogDate;
lData(iPos).vcLogTime:=i_vcLogTime;
END;
PROCEDURE PR_AS IS
CURSOR crCheck(i_nIdentnum IN NUMBER) IS
SELECT 1
FROM <YOURTABLE> A,
<YOURTABLE> B
WHERE A.IDEN_NUM=B.IDENT_NUM
AND ( A.BEGIN_DATE BETWEEN B.BEGIN_DATE AND B.END_DATE
OR A.END_DATE BETWEEN B.BEGIN_DATE AND B.END_DATE
iPos PLS_INTEGER;
nDummy NUMBER;
BEGIN
iPos:=lData.FIRST;
LOOP
EXIT WHEN iPos IS NULL;
-- Do whatever you want with the data in the record
-- Process next record
iPos:=lIds.NEXT(iPos);
END LOOP;
lIds.DELETE;
END;
END;replace TABLE.COLUM%TYPE with appropiate table and column
Now create a
- Before Statement trigger on your table calling PK_TRIGGER.PR_BS;
- After Insert on Update for each row Trigger calling PK_TRIGGER.PR_ARIU(...values...);
- After Statement trigger on your table calling PK_TRIGGER.PR_AS;
Hope the code compiles for i have no database at hand.
Andreas -
Explict cursor on 6i form - efficiency problem
Hello:
I have created a form with an explicit cursor that loops though a table and as part of the loop, uses TEXT_IO to output to a file. The problem is that this process is slow-- took just over 8 minutes just to write 5000 records. I think that since the cursor is executing from the client, as part of a WHEN_BUTTON_PRESSED trigger, is the reason the process is so slow. Anyone have any ideas on how to speed up this process? I am thinking that turning this as a procedure that could run on the server instead would make it faster but I am not sure how I should do that due to the TEXT_IO being part of the loop. Also, I have a sql/Plus program that spools tables to text files and is extremly fast but I can't have my end users working in sql/plus. Would be nice if I could run that program from a form. Anyway, below is the code I am currently using in the form trigger:
DECLARE
V_F_NAME VARCHAR2(25) := NULL;
V_L_NAME VARCHAR2(25) := NULL;
v_M_INT varchar2(25) := NULL;
out_file Text_IO.File_Type;
cursor vw_cursor is
select * from tbl_my_table;
vw_record vw_cursor%rowtype;
BEGIN
V_F_NAME := :ctl.v_F_NAME;
V_L_NAME := :ctl.v_L_NAME;
v_M_INT := :ctl.v_M_INT;
-- OPEN FILE
out_file := Text_IO.Fopen('C:\BAT\MyFile.txt', 'w');
open vw_cursor;
LOOP
fetch vw_cursor into vw_record ;
exit when vw_cursor%notfound;
--PRINT TO FILE...
if v_f_name is not null then
v_f_name := vw_record.f_name || ',';
if v_L_NAME is not NULL THEN
v_L_NAME := vw_record.l_name || ',';
if v_M_INT IS NOT NULL THEN
v_M_INT := vw_record.M_INT || ',';
END IF;
END IF;
END IF;
text_io.putf(out_file, v_f_name ||
v_l_name ||
v_M_INT);
Text_IO.New_Line(out_file);
END LOOP;
CLOSE vw_cursor ; -- remember to close the cursor! ;)
-- CLOSE FILE
TEXT_IO.FCLOSE(OUT_FILE);
END ;Depends on how you populate the array - if you populate it server side and send the whole pl/sql table back then it may be quicker.
Record group population uses a fatch size of 100 records at a time.
It also would ve quicker to use text_io.putf() to write multiple lines at once to the file, but this depends on you adding the line breaks as \n yourself -
FRM-40735:PRE-FORM trigger raised unhandled expception ORA-06508-SATYAM
Hi,
This is Sateesh, presently working on Designer migration project from Designer 2000 V1.3.2 to Designer 10g with headstart.I successfully completed the migration of repository from 1.3.2 to 6i and also migrated the headstart to 6i using simple upgrade method.After this i successfully migrated the repository from 6i to 10g and I compiled all the libraries using forms10g and then i generated all the 10g forms through designer.then 10g forms and libraries are deployed in Oracle Application Server and then we are trying to access the application then we are getting the messsage for most of the forms, i.e FRM-40735:PRE-FORM trigger raised unhandled expception ORA-06508. Can you please help me out in this regard.
Regards
K.Sateesh KumarYes,
that's right. FRM-40735 is a generic error message generated in case of form failure.
This may be as a result of failure while calling sub-programs in a form or any other problem.
For my case I had a call to a built in Package for which the user didnt have the privileges to execute that package.
So how did I find out?
EXCEPTION
WHEN OTHERS THEN
MESSAGE('SQLERRM: ' || SQLERRM);
exception handling does the trick. I got the real error that was causing the problem.
Error was: SQLERRM: xxx package does not exist. This made me think in the lines of either privileges or synonym problem. I found out that the user in the db doent have the execution privileges.
GRANT ALL ON xxxpackage TO xxxuser;
This is a nice forum. I love it and thanks to everyone.
Maybe you are looking for
-
Need tab order to loop back to first field.
Using Adobe Pro, would like the form to loop back to the first tab after tabbing off of the last field. Currently it goes to a couple text boxes that I added to the form that are not part of the fillable text fields.
-
hi, Am running forms on win xp. and suddenly when i ran the forms, The forms wouldn't come up. I tried clearing the temp folder and found that one file . (C:\Docume~\joey\Local Settings\Temp\s31o ) has been growing ... the file size reached upto 2GB
-
Could not load file or assembly 'Interop.SBODI_Server' Web Service Error
Hello Professionals, I'm trying to build a .net application to create a PO through SAP B1 Web Service, I have downloaded the SAP B1 Web Service Tool and generated all WSDL Files, I followed the manual to host web services on IIS. However, when i try
-
Compiler won't run application
I downloaded Java 1.3.1_04 and I believed i installed it correctly when I compile a class the message is cannot run application. I set all paths correctly My dos prompt says the the Jre is installed. Why won't it run
-
How to define percent for MRP?
Dear experts! I have a project: ABC WBS1: Floor1 Network 1: System 1: Activity 1: Shopping 1 Material 1: 100 PC. WBS1: Floor2 Network 2: System 2: Activity 2: Shopping 2 Material 1: 20 PC. For first procure stage i only buy 40% material for this proj