Basing a Datablock on Program Unit
Hi
Beginner and confused
I have a procedure with (IN OUT) ref cursor returning a RECORD. There is a button on the same form which when pressed generates the where clause of the sql statement in the procedure.
I need to display this query in a datablock. Could someone give me a step by step process for doing this? Thanks
Hi Bernd,
Thanks for the reply. I have used the count query from the example itself, and it is working, and when I display the count, it is accurate.
I tried the package in the sql plus and it is returning values
I guess somehow the parameters what is set in the datablock wizard is a problem. I have double checked the parameters and it is accurate as given in the example
I also tried creating a new canvas and built up the datablock using the same steps (as given in the example) but still I did not get any output.
Deepak
Similar Messages
-
Error : ORA-06508: PL/SQL: could not find program unit being called
Hi
I got surprise issue while testing my Oracle code . Let me explain first the environment detail . Our appliaction built on
Java/J2EE(Weblogic) and backend is Oracle 11g re2 . While calling from java it call thru different user which have been provide
synonym and exectue option for corresponding procdure ,
I created on package EXTRACT_CUSTOMER_INFO_PK which will exract data to text file using UTL_FILE ( direcory , UTL_FILE grant is provided to DB user).
Now this package has been called from rp_execute_procedure_pr -- Here I is the code
CREATE OR REPLACE PROCEDURE RP_EXECUTE_PROCEDURE_PR
i_atlas_job_schedule_fk IN atlas_job_schedule.atlas_job_schedule_pk%TYPE,
i_job_id IN atlas_job.job_id%TYPE,
i_parm_value IN atlas_job_schedule.parm_value%TYPE,
o_status_code OUT NUMBER,
o_status_mesg OUT VARCHAR2
IS
-------Other old code which is not relevent for this issue ----
--------Other old code which is not relevent for this issue ----
----Below code I added ----
ELSIF l_job_id = 'CUST_EXTRACT' THEN
EXTRACT_CUSTOMER_INFO_PK.customer_report ( i_parm_value ,
o_status_code,
o_status_mesg ) ;
-- o_status_code := -99999999;
--o_status_mesg := 'PARTHA PARTHA PARTHAcess terminated!';
ELSE
o_status_code := -20300;
o_status_mesg := 'Job Id : ' || l_job_id || ' NOT found. Process terminated!';
END IF;
update_log_auto
ajs_rec.atlas_job_schedule_pk ,
'Processing End Time (GMT): '
EXCEPTION
WHEN eProcError THEN
o_status_code := SQLCODE;
o_status_mesg := SUBSTR(vMsg ||'-'||SQLERRM, 1, 200);
WHEN OTHERS THEN
o_status_code := -20300;
o_status_mesg := SUBSTR(SQLERRM, 1, 200);
update_log_auto
ajs_rec.atlas_job_schedule_pk ,
'Error : '||SQLERRM||' '
update_log_auto
ajs_rec.atlas_job_schedule_pk,
'Processing End Time (GMT): '
END RP_EXECUTE_PROCEDURE_PR;
Now It compiled sucesfully . And while I did SIT then RP_EXECUTE_PROCEDURE_PR run fine and extracted txt file . But while I called it from Java procedure It gives us error like
Error : ORA-06508: PL/SQL: could not find program unit being called 02-AUG-2012 13:16:51.
As I told RP_EXECUTE_PROCEDURE_PR old proc and used by other proc , So I first suspect issue is newly added code or may be some grant or synonym ( Although it should not be )
so I created public synony amd gave execute grant to my pkg to public .
But it repeat same error .
I did lot of R&D on my pkg but nothing happen . Finally I remane my new pkg RP_EXTRACT_CUSTOMER_INFO_PK and it works fine
I need to know what is the RCA for it . I donot think any dependecy issue as renaming pkg is working fine .
NB my DB user is iATLAS and Javauser is SUDEEP
Thanks in Advance
Debashis MallickFirst of all If i run the main procedure in like below in my Schema it is working fine
begin
-- Call the procedure
rp_execute_procedure_pr(i_atlas_job_schedule_fk => :i_atlas_job_schedule_fk,
i_job_id => :i_job_id,
i_parm_value => :i_parm_value,
o_status_code => :o_status_code,
o_status_mesg => :o_status_mesg);
end;
So thre is no question of parameter .... or Invalid state etc . If it is parameter or Invalid state issue it will give other error.
Here problem is not syntax issue .
let me give u more detail regards this issue
1.. All objects corresponding to procedure all Valid
2.. If I test on the proc on my schema like above code . It works fine
3.rp_execute_procedure_pr is a old procudere which called for differner report generartion based on parameter passing . Also as extract_customer_info_pk called with in rp_execute_procedure_pr So there is no question of synonym or privilage issue for new procedure.
4. Suprising thing is if I rename and recreate package like extract_customer_info_pk _1 or rp_extract_customer_info_pk . Which are exactly same as extract_customer_info_pk and replace those new one with extract_customer_info_pk then it work fine in my java application
I think I make it clear the issue
Edited by: debashisora on Aug 3, 2012 5:31 AM
Edited by: debashisora on Aug 3, 2012 5:40 AM -
Hi All,
We are following Export/Import Process for Oracle Applications Release 11i Database Instances Using Oracle Database 10g Release 2
note: 362205.1
Source OS = AIX
Target OS = RHEL 5
DB version = 10.2.0.4
At Section 5: Update the imported Applications Release 11i database instance
Perform post-import steps outlined in the Interoperability documents
At post-import step: Implement and run AutoConfig
Completed the below tasks:
Copied the appsutil.zip file to to new OS ORacle home
Generated the Database Context File
While Running adconfig get the error
ADX Database Utility
getConnectionUsingAppsJDBCConnector() -->
APPS_JDBC_URL='null'
Trying to get connection using SID based connect descriptor
getConnection() -->
sDbHost : ORADB
sDbDomain : quest-global.com
sDbPort : 1521
sDbSid : TST
sDbUser : apps
Trying to connect using SID...
getConnectionUsingSID() -->
JDBC URL: jdbc:oracle:thin:@ORADB.quest-global.com:1521:TST
Connection obtained
-------------------ADX Database Utility Finished---------------
Result : Failed to upload the Context file to the DataBase
Uploading Context file and its templates to the database...FAILED
StackTrace:
java.lang.Exception: oracle.apps.ad.autoconfig.oam.InDbCtxFileException: SQLException : ORA-04063: package body "APPS.FND_GSM_UTIL" has errors
ORA-06508: PL/SQL: could not find program unit being called: "APPS.FND_GSM_UTIL"
ORA-06512: at line 1
at oracle.apps.ad.tools.configuration.FileSysDBCtxMerge.updateDBCtx(FileSysDBCtxMerge.java:685)
at oracle.apps.ad.tools.configuration.FileSysDBCtxMerge.updateDBFiles(FileSysDBCtxMerge.java:222)
at oracle.apps.ad.context.CtxValueMgt.processCtxFile(CtxValueMgt.java:1579)
at oracle.apps.ad.context.CtxValueMgt.main(CtxValueMgt.java:661)
Updating rdbms version in Context file to db102
Updating rdbms type in Context file to 64 bits
Kindly suggest
Regards,
SKHI,
As per note 369693.1 - Using Oracle Applications with a Split Configuration Database Tier on Oracle 10g Release 2
Section 4: Post-Migration Tasks
Reconfigure the application tier to connect to the target database machine
i have updated the context file parameters s_dbhost, s_dbdomain, s_dbport, s_apps_jdbc_connect_descriptor, s_isDB
but will running autoconfig i get the error
Making database connection using DBUtil
ADX Database Utility
getConnectionUsingAppsJDBCConnector() -->
APPS_JDBC_URL='NULL'
Trying to connect using APPS_JDBC_URL
Exception occurred: java.sql.SQLException: No suitable driver
Trying to get connection using SID based connect descriptor
getConnection() -->
sDbHost : oradb
sDbDomain : quest-global.com
sDbPort : 1521
sDbSid : TST
sDbUser : APPS
Trying to connect using SID...
getConnectionUsingSID() -->
JDBC URL: jdbc:oracle:thin:@oradb.quest-global.com:1521:TST
Exception occurred: java.sql.SQLException: Io exception: The Network Adapter could not establish the connection
Trying to connect using SID as ServiceName
getConnectionUsingServiceName() -->
JDBC URL: jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oradb.quest-global.com)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=TST)))
Exception occurred: java.sql.SQLException: Io exception: The Network Adapter could not establish the connection
Trying to connect using SID as ServiceName.DomainName
getConnectionUsingServiceName() -->
JDBC URL: jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oradb.quest-global.com)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=TST.quest-global.com)))
Exception occurred: java.sql.SQLException: Io exception: The Network Adapter could not establish the connection
Connection could not be obtained; returning null
-------------------ADX Database Utility Finished---------------
Exception occurred while preseeding variables in the context file: java.sql.SQLException: Could not get connection to the database
StackTrace:
java.sql.SQLException: Could not get connection to the database
at oracle.apps.ad.tools.configuration.CVMHelper.processNewContextFile(CVMHelper.java:884)
at oracle.apps.ad.context.CtxValueMgt.preSeed2Ctx(CtxValueMgt.java:1714)
at oracle.apps.ad.context.CtxValueMgt.processCtxFile(CtxValueMgt.java:1516)
at oracle.apps.ad.context.CtxValueMgt.main(CtxValueMgt.java:661)
is there any check we can do to test the DB conection?
Thanks
SK -
Could not find program unit being called
We're facing a development problem, which while it isn't stopping us from working, but it's seriously slowing down our progress. It goes something like this ...
We have a ColdFusion interface to an Oracle PACKAGE, "package A". "Package A" invokes "package B", and "package B" invokes "package C". We're actively working on "package C", the last in the chain, and then testing those changes from the ColdFusion interface.
Everytime we run a CREATE OR REPLACE on "package C" (we've tried both compiling only the BODY, as well as the SPEC and the BODY), we get the following error from ColdFusion when we test from the interface:
ORA-06508 PL/SQL: Could not find the program unit being calledIf we wait a bit, everything starts working again. Note that while we are waiting, "package C" is not being recompiled. So it's functioning fine. Our best guess is that there something happening due the connection pooling process in place. Maybe ... if you're lucky enough to latch onto a new connection, then the error doesn't appear? But, if you connect to a session that was present when "package C" was recompiled, then you get the ORA-06508? These connections are using a JDBC driver.
I guess I expected to get the ORA-04061 error ("Existing state of the package has been discarded"), and that is coming up more rarely than the ORA-06508, but the "could not find the program unit" is just stopping our efforts until everything starts working again.
I found some suggestions online (http://www.orafaq.com/forum/t/14555/2/) which claim that the SHARED POOL should be flushed and that will help with this error, but I'm not sure I need to bring an A-bomb to a fist-fight. Plus, these PACKAGES aren't huge, so I'm not sure we're encountering the memory limits focused upon in those other posts:
package A: 1533 lines
package B: 1015 lines
package C: 1842 lines
Anyone have a suggestion for us to follow-up on? Like I said, we're not dead in the water, but this is getting pretty frustrating.
Thanks,
--=ChuckI think the problem is related to the connection pooling. If you have 5 persistent sessions held open by the application server say C1, C2, ... C5 then if you have called the package from C1 , C2, and C3 then if the package is recompiled the session copy of the package variables and records no longer matches the package and an error is issued. But if the call is made from C4 or C5 it works since the work in storage areas are all initialized from the new version of the package.
In the old days (7.x, 8.0) I remember seeing a Package State has changed message but recently at least on AIX we see the Program Unit not found when this happens. We used to see this message only if we could not load the package into the shared pool due to memory issues.
Anyhow we bounce one of our Web based applications to avoid this program. That is the local customer has us stop the application, make the change, revalidate packages, and restart so they never see the error since with a large connection pool significant time can pass between the change and an error being encountered.
In theory you should just be able to reissue the package procedure call since the first call should have resulted in the work in storage being re-initialized.
HTH -- Mark D Powell -- -
PL/SQL: could not find program unit being called
Hi all,
We have a J2EE aplication running on tomcat which uses a connection pool based on JDBC 10g driver to acces a 9.2.0.5 Oracle Database.
When we compile our PL/SQL packages we always get the error "PL/SQL: could not find program unit being called" when we access our J2EE application.
It seems as if our JDBC Driver was caching PL/SQL package definitions. Is there any way to avoid so?
Thanks in advance.Hi Shui,
Does the directory where you have all the fmx, mmx have plx (compiled version of pll's).
If no, generate plx and keep them in that directory.
Also, did you set the FORMS90_PATH in registry / default.env? Better to use default.eve for runtime environment settings.
Regards,
Arun -
This is my first attempt at a pretty in debt package. All the procedures and functions work successfully on their own. When i try and put them into a package and run the package, i get these errors?
ORA-04063: package body "mydb.PKG_ALERT" has errors
ORA-06508: PL/SQL: could not find program unit being called: "mydb.PKG_ALERT"
ORA-06512: at line 6
Here's my package:
create or replace PACKAGE pkg_alert AS
FUNCTION fcn_chck_dt(p_date date)
RETURN VARCHAR2;
FUNCTION fcn_chck_decline(p_date date)
RETURN NUMBER;
PROCEDURE sp_run_alert(p_date date);
END pkg_monitor;
Here's my package body code: Your assistance is greatly appreciated:
create or replace
PACKAGE BODY PKG_ALERT AS
FUNCTION fcn_chck_dt(p_date date) return VARCHAR2 is
--DECLARE
v_table_name VARCHAR2(35);
v_string VARCHAR2(1024);
v_result number;
v_output VARCHAR2(1024);
v_date VARCHAR2(100);
v_dt VARCHAR2(100);
CURSOR c_table is
select table_name
from user_tab_columns
where COLUMN_NAME = 'date'
and table_name NOT LIKE '%BIN%';
BEGIN
OPEN c_table;
loop
FETCH c_table into v_table_name;
exit when c_table%NOTFOUND;
v_string:='select decode(to_date(max(date),''yyyymmdd''),'''||p_date||''',1,0)'|| ' from ' || v_table_name;
execute immediate v_string into v_result;
v_date:='select max(date)'|| ' from ' || v_table_name;
execute immediate v_date into v_dt;
if v_result=0 then
v_output:=v_output||CRLF||v_table_name||': '||v_dt;
end if;
end loop;
close c_table;
return v_output;
END fcn_chck_dt;
FUNCTION fcn_chck_decline(p_date date) return NUMBER is
--DECLARE
v_dt NUMBER;
v_active NUMBER;
v_delta NUMBER;
v_perc_delta NUMBER;
v_old_s varchar2(1024);
v_old_dt number;
v_string varchar2(1024);
v_result NUMBER;
CURSOR c_prev IS
select date,daily_active,
daily_active-lag(daily_active) over(order by date),
trunc(((daily_active-lag(daily_active) over(order by date))/daily_active)*100,2)
from pop_stats
where to_date(date,'YYYYMMDD') between p_date-1 and p_date
order by date desc;
---bringing back two rows and all records on purpose.
BEGIN
OPEN c_prev;
FETCH c_prev INTO v_dt,v_active,v_delta,v_perc_delta;
close c_prev;
v_old_s := 'select max(date) from alert_stats';
execute immediate v_old_s into v_old_dt;
if v_dt!=v_old_dt then
insert into ALERT_stats(date,
daily_active,
daily_delta,
daily_delta_percent)
values(v_dt,
v_active,
v_delta,
v_perc_delta);
end if;
v_string:='select value from config_tbl where name=''decline''';
execute immediate v_string into v_result;
if v_perc_delta <= v_result then
return v_perc_delta;
end if;
END fcn_chck_decline;
PROCEDURE sp_run_alert(p_date date) IS
--DECLARE
v_result varchar2(1024);
BEGIN
insert into ALERT_stats(date)
values(p_date);
CRLF char(2) := chr(10)||chr(13);
v_result :='';
v_result := v_result||fcn_chck_dt(p_date);
v_result := v_result||fcn_chck_decline(p_date);
if v_result.length > 0 then
utl_mail.send('alerts@localhost','[email protected]',NULL,NULL,
'Alert','Alert Summary: '||v_result,'text/plain; charset=us-ascii',NULL);
end if;
END sp_run_alert;
END PKG_ALERT;Take a look at the bolded sections of your code especialy the last line of your package spec
create or replace PACKAGE pkg_alert AS
FUNCTION fcn_chck_dt(p_date date)
RETURN VARCHAR2;
FUNCTION fcn_chck_decline(p_date date)
RETURN NUMBER;
PROCEDURE sp_run_alert(p_date date);
END pkg_monitor; -
How to use one forms fields, program units in another form.
The whole proceessing and update is happening in one main form.
Main form has all the fields and a reprocess button which re-creates records if they have error. Record name is the primary key.
I have another small form, which just shows the list of record names in the system. I want a reprocess button next to each record name so that user will be able to just select any record name and press reprocess button to recreate any record data.
There are a lot of fields in main form and program units , which are used by the reprocess button.
Any suggestions like how to go for it?You can either pass all the relevant data from the Small Form to the Larger form and make it reprocess the data or you can move the Program Units to a PL/SQL Library (.pll) and attach the library to your smaller form where you can call the program units. Either option requires changes to the Larger form to enable it to process a record passed to the form as a parameter or to externalize the Forms Program Units to a library.
Personaly, I would recommend you move the Program Units to a Library. This would enable you to use the processes in any form (that has the library attached).
Hope this helps,
Craig B-)
If someone's response is helpful or correct, please mark it accordingly. -
Error while compiling program unit
Hi All,
I am working on oracle forms 10g.
I am getting an error "wrong no or types of arguments in call to 'COUNTCDRSTODELETE' ", while trying to compile my program unit.
The extract of my program unit is as written below:
PROCEDURE CALL_PCK_BACKOUT IS
-- type bmpf_id_arr is varray(100) of bmp_files.bmpf_id%type;
type bmpf_id_arr is varray(100) of integer;
id_arr bmpf_id_arr := bmpf_id_arr();
file_cnt number := 0;
BEGIN
GO_BLOCK('B_FILE');
first_record;
LOOP
-- EXIT WHEN :SYSTEM.RECORD_STATUS='NEW';
IF UPPER(:B_FILE.FILE_ON_OFF_IND) = 'Y' THEN
FOR I IN ( SELECT BMPF_ID FROM BMP_FILES
WHERE BMPF_FILENAME = :B_FILE.BMPF_FILENAME
AND BMPF_PROCESSING_STATE = 'P'
ORDER BY BMPF_ID ASC)
LOOP
if file_cnt < id_arr.limit then
id_arr.extend;
id_arr(id_arr.last) := i.bmpf_id;
INSERT INTO bmp_files_to_backout (file_id, job_id) values (i.bmpf_id,pkg_constants.gt_bat_code_bckout_cdr);
file_cnt := file_cnt + 1;
else
msg_alert('You can select maximum 100 files at a time','E',FALSE);
RAISE FORM_TRIGGER_FAILURE;
end if;
END LOOP;
END IF;
EXIT WHEN :SYSTEM.LAST_RECORD='TRUE';
NEXT_RECORD;
END LOOP;
if file_cnt = 0 then
msg_alert('Please select at least one file in order to initiate the backout','E', FALSE);
go_item('b_ctrl.file_name');
RAISE FORM_TRIGGER_FAILURE;
end if;
if file_cnt > 0 then
commit;
end if;
-- check if the backout request has been accepted or not
if pck_backout.CountCDRStodelete(id_arr,file_cnt) = 0 and pck_backout.AreallCDRSOpen(id_arr,file_cnt) = 0 then
msg_alert('Backout request can be scheduled for the selected input','E',FALSE);
elsif pck_backout.CountCDRStodelete(id_arr,file_cnt) != 0 and pck_backout.AreallCDRSOpen(id_arr,file_cnt) != 0 then
msg_alert('Backout request has been rejected due to maximum number of cdrs exceeded and not all cdrs belonging to open invoices','E',FALSE);
RAISE FORM_TRIGGER_FAILURE;
elsif pck_backout.CountCDRStodelete(id_arr,file_cnt) != 0 then
msg_alert('Backout request has been rejected due to maximum number of cdrs exceeded','E',FALSE);
RAISE FORM_TRIGGER_FAILURE;
elsif pck_backout.AreallCDRSOpen(id_arr,file_cnt) != 0 then
msg_alert('Backout request has been rejected due to not all cdrs belonging to open invoices','E',FALSE);
RAISE FORM_TRIGGER_FAILURE;
end if;
END;
pck_backout is a stored database package. The definition of two functions used above is as given below:
FUNCTION countcdrstodelete (
p_bmpf_id_array IN pkarray,
p_batch_size IN NUMBER
RETURN NUMBER;
FUNCTION areallcdrsopen (p_bmpf_id_array IN pkarray, p_batch_size IN NUMBER)
RETURN NUMBER;
where pkarray is defined as :
TYPE pkarray IS VARRAY (100) OF INTEGER;
Can anyone please tell me why i am getting wronf type or no of arguments error while calling the databse functions.
I guess, it has to do with the varray field. Can you please tell me if i am using any wrong syntax??
I request all the forms gurus to please help me with this.Hi Fabrio,
I solved my problem.
I'd to actually define pkarray as sql type rather than PL/SQL type.
It's because oracle forms wasn't able to bind the varray defined locally in program unit with the varray defined in stored PL/SQL function.
Once i created pkarray as sql type and removed the declaration of varray in program unit and PL/SQL code, it worked.
Thanks for your reply though.
Regards,
Navnit -
Hello,
EBS version : 11.5.10.2
DB version : 11.2.0.3
OS version : AIX 6.1
As a part of 11.5.10.2 to R12.1.1 upgrade, while applying merged 12.1.1 upgrade driver(u6678700.drv), we got below error :
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ATTENTION: All workers either have failed or are waiting:
FAILED: file glsupdas.ldt on worker 3.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
drix10:/fmstop/r12apps/apps/apps_st/appl/admin/FMSTEST/log>tail -20 adwork003.log
Restarting job that failed and was fixed.
Time when worker restarted job: Wed Aug 07 2013 10:36:14
Loading data using FNDLOAD function.
FNDLOAD APPS/***** 0 Y UPLOAD @SQLGL:patch/115/import/glnlsdas.lct @SQLGL:patch/115/import/US/glsupdas.ldt -
Connecting to APPS......Connected successfully.
Calling FNDLOAD function.
Returned from FNDLOAD function.
Log file: /fmstop/r12apps/apps/apps_st/appl/admin/FMSTEST/log/US_glsupdas_ldt.log
Error calling FNDLOAD function.
Time when worker failed: Wed Aug 07 2013 10:36:14
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
drix10:/fmstop/r12apps/apps/apps_st/appl/admin/FMSTEST/log>tail -20 US_glsupdas_ldt.log
Current system time is Wed Aug 7 10:36:14 2013
Uploading from the data file /fmstop/r12apps/apps/apps_st/appl/gl/12.0.0/patch/115/import/US/glsupdas.ldt
Altering database NLS_LANGUAGE environment to AMERICAN
Dumping from LCT/LDT files (/fmstop/r12apps/apps/apps_st/appl/gl/12.0.0/patch/115/import/glnlsdas.lct(120.0), /fmstop/r12apps/apps/apps_st/appl/gl/12.0.0/patch/115/import/US/glsupdas.ldt) to staging tables
Dumping LCT file /fmstop/r12apps/apps/apps_st/appl/gl/12.0.0/patch/115/import/glnlsdas.lct(120.0) into FND_SEED_STAGE_CONFIG
Dumping LDT file /fmstop/r12apps/apps/apps_st/appl/gl/12.0.0/patch/115/import/US/glsupdas.ldt into FND_SEED_STAGE_ENTITY
Dumped the batch (GL_DEFAS_ACCESS_SETS SUPER_USER_DEFAS , GL_DEFAS_ACCESS_SETS SUPER_USER_DEFAS ) into FND_SEED_STAGE_ENTITY
Uploading from staging tables
Error loading seed data for GL_DEFAS_ACCESS_SETS: DEFINITION_ACCESS_SET = SUPER_USER_DEFAS, ORA-06508: PL/SQL: could not find program unit being called
Concurrent request completed
Current system time is Wed Aug 7 10:36:14 2013
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++Below is info about file versions and INVALID packages related to GL.
PACKAGE BODY GL_DEFAS_ACCESS_SETS_PKG is invalid with error component 'GL_DEFAS_DBNAME_S' must be declared.
I can see GL_DEFAS_DBNAME_S is a VALID sequence accessible by apps user with or without specifying GL as owner.
SQL> select text from dba_source where name in ('GL_DEFAS_ACCESS_DETAILS_PKG','GL_DEFAS_ACCESS_SETS_PKG') and line=2;
TEXT
/* $Header: glistdds.pls 120.4 2005/05/05 01:23:16 kvora ship $ */
/* $Header: glistddb.pls 120.16 2006/04/10 21:28:48 cma ship $ */
/* $Header: glistdas.pls 120.4 2005/05/05 01:23:02 kvora ship $ */
/* $Header: glistdab.pls 120.5 2006/03/13 19:56:21 cma ship $ */
SQL> select * from all_objects where object_name in ('GL_DEFAS_ACCESS_DETAILS_PKG','GL_DEFAS_ACCESS_SETS_PKG')
2 ; OWNER OBJECT_NAME SUBOBJECT_NAM OBJECT_ID DATA_OBJECT_ID OBJECT_TYPE CREATED LAST_DDL_TIME TIMESTAMP STATUS T G S NAMESPACE
EDITION_NAME
APPS GL_DEFAS_ACCESS_DETAILS_PKG 1118545 PACKAGE 05-AUG-13 05-AUG-13 2013-08-05:18:54:51 VALID N N N 1
APPS GL_DEFAS_ACCESS_SETS_PKG 1118548 PACKAGE 05-AUG-13 06-AUG-13 2013-08-05:18:54:51 VALID N N N 1
APPS GL_DEFAS_ACCESS_SETS_PKG 1128507 PACKAGE BODY 05-AUG-13 06-AUG-13 2013-08-06:12:56:50 INVALID N N N 2
APPS GL_DEFAS_ACCESS_DETAILS_PKG 1128508 PACKAGE BODY 05-AUG-13 05-AUG-13 2013-08-05:19:43:51 VALID N N N 2
SQL> select * from all_objects where object_name='GL_DEFAS_DBNAME_S'; OWNER OBJECT_NAME SUBOBJECT_NAM OBJECT_ID DATA_OBJECT_ID OBJECT_TYPE CREATED LAST_DDL_TIME TIMESTAMP STATUS T G S NAMESPACE
EDITION_NAME
GL GL_DEFAS_DBNAME_S 1087285 SEQUENCE 05-AUG-13 05-AUG-13 2013-08-05:17:34:43 VALIDN N N 1
APPS GL_DEFAS_DBNAME_S 1087299 SYNONYM 05-AUG-13 05-AUG-13 2013-08-05:17:34:43 VALIDN N N 1
SQL> conn apps/apps
Connected.
SQL> SELECT OWNER, OBJECT_NAME, OBJECT_TYPE, STATUS
FROM DBA_OBJECTS
WHERE OBJECT_NAME = 'GL_DEFAS_ACCESS_SETS_PKG'; 2 3 OWNER OBJECT_NAME OBJECT_TYPE STATUS
APPS GL_DEFAS_ACCESS_SETS_PKG PACKAGE VALID
APPS GL_DEFAS_ACCESS_SETS_PKG PACKAGE BODY INVALID SQL> ALTER PACKAGE GL_DEFAS_ACCESS_SETS_PKG COMPILE; Warning: Package altered with compilation errors. SQL> show error
No errors.
SQL> ALTER PACKAGE GL_DEFAS_ACCESS_SETS_PKG COMPILE BODY; Warning: Package Body altered with compilation errors. SQL> show error
Errors for PACKAGE BODY GL_DEFAS_ACCESS_SETS_PKG: LINE/COL ERROR
39/17 PLS-00302: component 'GL_DEFAS_DBNAME_S' must be declared
drix10:/fmstop/r12apps/apps/apps_st/appl/gl/12.0.0/patch/115/odf>cat $GL_TOP/patch/115/sql/glistdab.pls|grep -n GL_DEFAS_DBNAME_S
68: SELECT GL.GL_DEFAS_DBNAME_S.NEXTVAL
81: fnd_message.set_token('SEQUENCE', 'GL_DEFAS_DBNAME_S');
SQL> show user
USER is "APPS"
SQL> SELECT GL.GL_DEFAS_DBNAME_S.NEXTVAL
FROM dual; 2 -- with GL.
NEXTVAL
1002
SQL> SELECT GL_DEFAS_DBNAME_S.NEXTVAL from dual; --without GL. or using synonym.
NEXTVAL
1003
drix10:/fmstop/r12apps/apps/apps_st/appl/gl/12.0.0/patch/115/odf>strings -a $GL_TOP/patch/115/sql/glistdab.pls|grep '$Header'
REM | $Header: glistdab.pls 120.5 2006/03/13 19:56:21 cma ship $ |
/* $Header: glistdab.pls 120.5 2006/03/13 19:56:21 cma ship $ */
drix10:/fmstop/r12apps/apps/apps_st/appl/gl/12.0.0/patch/115/odf>strings -a $GL_TOP/patch/115/sql/glistdas.pls |grep '$Header'
REM | $Header: glistdas.pls 120.4 2005/05/05 01:23:02 kvora ship $ |
/* $Header: glistdas.pls 120.4 2005/05/05 01:23:02 kvora ship $ */ -
How to reference a user parameter in program unit
I tried to define a user parameter in Oracle Report 6i and I could reference it (&p_where_clause) in the main query but I failed to reference it in one of the program units. Here is the logic:
function CF_OTHER_COURSESFormula return Char is
cnt number;
priority number;
class_code varchar2(8);
oc varchar2(100) := null;
cursor oc_cur is
select class_code, branch_priority
from nominations n, employments e
where n.hkic_no = e.hkic_no
and e.staff_status_code = 'EMP'
and &p_where_clause --> contain "n.course_code in ('A','B','C')"
and n.hkic_no = :hkic_no
and n.class_code != :class_code;
begin
cnt := 1;
open oc_cur;
loop
fetch oc_cur into class_code, priority;
if oc_cur%notfound then
exit;
end if;
if cnt = 1 then
oc := oc||class_code||'('||priority||')';
else
oc := oc||', '||class_code||'('||priority||')';
end if;
cnt := cnt + 1;
end loop;
close oc_cur;
return oc;
exception
when no_data_found then
return '';
end;
Does anyone tell me how to reference it in program unit? Does Oracle Reports 6i support this operation?There hasn't been any changes to the way lexicals and bind variables work in Reports between 2.5 and 6i. There are different versions of PL/SQL and you might be hitting some problem here.
In your case, you shouldn't be using the query lexical "&p_where_clause" just the PL/SQL bind variable syntax ":p_where_clause". Since you're creating a PL/SQL cursor, you should probably use dynamic sql creation with a concatenation of the where clause to build up the SQL for the cursor. Check out the PL/SQL documentation for this. -
Pd0-ppu017 program unit source must define a subprogram body or package
Hi
Iam new to oracle l and trying to teach myself
my problem is when I compile any function in program units of forms ,
the following error message obtained:-
pd0-ppu017 program unit source must define a subprogram body or package.
for example this ready function that I have just copied ,pasted
CREATE OR REPLACE FUNCTION TestTrig_body() RETURNS TRIGGER AS $$
DECLARE
v_TempRec temp_table%ROWTYPE;
BEGIN
INSERT INTO report_table(num_col, old_val, new_val)
VALUES (NEW.num_col, OLD.char_col, NEW.char_col);
RETURN NEW;
END;
what is the reason please?
Windows OS
Oracle 10g database
oracle 6i developer
regardsVANPERSIE,
It looks like you are mixing sytax. Some of the Syntax used in a Database trigger (such as Before Insert, After Insert, etc) is specific to database triggers. Referring to :NEW and :OLD are specific to database triggers and can't be used as you are using them, unless you have data blocks names NEW and OLD. Also, when you refer to a item in a block, you must prefix the block or item name with the colon ":". Also, as aweiden points out, you define your return data type as "TRIGGER". The return type of a Function must be a valid Oracle data type. Therefore, your function should return a BOOLEAN, NUMBER, VARCHAR, or even a Ref Cursor, just to name a few. From the looks of your code, your function would simply return a value to indicate that the INSERT was successful. Therefore, you could rewrite your function something like:
CREATE OR REPLACE FUNCTION TESTTRIG_BODY() RETURNS BOOLEAN AS
BEGIN
/* This example assumes you have data blocks in your form called: NEW_BLOCK and OLD_BLOCK. */
INSERT INTO REPORT_TABLE
(NUM_COL, OLD_VAL, NEW_VAL)
VALUES
(:NEW_BLOCK.NUM_COL, :OLD_BLOCK.CHAR_COL, :NEW_BLOCK.CHAR_COL);
RETURN TRUE;
EXCEPTION
WHEN OTHERS THEN
RETURN FALSE;
END;Also, is there a particular reason you are manually INSERTing a record versus letting Oracle Forms handle this for you?
Hope this helps.
Craig...
-- If my response or the response of another is helpful or answers your question please mark the response accordingly. Thanks! -
Freight revenue is allocated by profit center, based on the number of units
Hi SAP Gurus,
I am facing one issue in sales order processing.
The Sales order is getting created through an inbound IDOC.
The data (Condtion type and Condition value) for Freight will get populated at at the header level at will get allocated to the line Items wrt quantity.
The requirement is - "Freight revenue is allocated by profit center, based on the number of units shipped".
Please let me know how to achieve this requirement.
Regards,
BhaskarIn VOFM- Reqirements- Pricing- You need to create a new requirement- Routine.
That Routine should calculate
To check Frieght condition(i.e. ZFRT) at the header in the sales order, if tcode - "VA01"
If Freight conditon ZFRT found then transfer that reqirement to item level by data transfer,
IF Freight conditon is found at the item level then allocate revenue by = profit center XXXX to XXXXX , (based on MARC- PRCTR ) in MM03 number of units shipped .
You might also need to configure Account determination for this freight conditon to post to correct G/L A/C.
This is an Enhancement.
Good luck -
Help plss Should a cursor be created in database or program unit in forms l
Where can i create a cursor should it be in database i.e isql plus using internet explorer or should i create the cursor in forms
forms can i create the cursor so that i can use the cursor in the post item trigger of the userid item of login page
Can i create the cursor in a package specification and how can i call that cursor into a post_text item trigger
details below
Iam working on a Online exam for students Dummy project using forms
The student 1st comes to a WELCOME page i.e form which asks him if he is a new student or registered stud
If he clicks registered pushbutton it takes him to a LOGIN page where there are two items userid and password.I am using a Validate_item OR Post_item trigger to fire after the student enters his userid.
I need to compare the entered userid with the userid stored in the database STUDENTS table which i created which consists of the registered students details.
Our project Guide suggested that we create a cursor and fetch each userid everytime into the cursor and compare the entered userid with the cursor.hi Sqlstar,
Regarding to your all questions , i prefered that you search for a simple document or book in order to understand much more more about creating cursors.
however since this forum made to help people and to make a integerated community i would be glad to offer my help and going with you step bt step with your answers.
as for beginning
1) when you create the user_exists function in database , if you want to call it in the form level you would wirte a code like this
----WHEN-VALIDATE-ITEM------------user_id item---------
IF scheme_name.procedure_name(:block1.userid)!='TURE' then
message('User Name is not correct');
raise form_trigger_failure;
end if;
2) it's not a waste of recourse to make 2 validation of both userid and password
and as same you create a procedure for useris you should create a procedure for password where the user id is the outcomming of userid item in the form.
3)you have all choices to create the 2 procedures on database side or in the program unit at design time for the form it's up to you and as a small hint for you ,
when you create them in the program unit and want to call the procedures in the WHEN-VALIDATE-ITEM trigger you should denote the procedure name with the name of package first as following
-------[Package Spec Code]-------
PACKAGE user_validation IS
function user_exists (p_user_id number) return boolean;
end ;
--------------[Package Body Code]------
PACKAGE BODY user_validation IS
function user_exists (p_user_id number) return boolean
is
user_number number;
cursor c_user_id is
select user_id from <user_table>
where user_id=p_user_id;
begin
open c_user_id ;
loop
fetch user_id into user_number ;
return (true);
exit when c_user_id%NOTFOUND;
end loop;
execption when others then
return(false);
end user_exists;
end;
-----Calling at Validation level-----------
IF (user_validation.user_exists(:block1.userid))!=TURE then
message('User Name is not correct');
raise form_trigger_failure;
end if;
i hope this could be helpful engouh to start your application
Good Luck .
Regards
Omar -
Generate txt output using a program unit in web report (OAS 10g)
Hi Everyone.
I have a c/s report (6i) which generates a txt file in a program unit using TEXT_IO package. I need to move this report to web (Reports 10g) and publishing it in OAS 10g. I've done that (without the text file generation), I can see the report on the browser in PDF Format and works fine... but, I still have a problem... when I use Text_io package, the c/s version of the report in 10g runs an generates the output.txt file but when I move it to web I got an error in the before report trigger (in which I invoke the program unit sp_generate_txt)
I looked around for a solution and I just find the usage of webutil package, but as you know, webutil package is only usable in Forms.
Any Ideas on how can I solve this problem?Hello,
TEXT_IO can be used in Reports deployed on the web.
The difference with Client /Server is the fact that the file create by TEXT_IO will be created on the "Middle Tier Server" and not on the Client.
Regards -
How to create a procedure using program unit
Hai All
Ii have created a procedure like this
PROCEDURE Duty_calc
IS
procedure w_Time
is
begin
update dail_att set wtime= (select lpad((to_number(to_char(outtime,'hh24mi')-to_char(intime,'hh24mi'))),4,0) from dail_att where attend_date=f_date);
end w_time;
begin
if wtime >0830 then
update dail_att set etime= (select lpad(wtime-0830) from dail_att where attend_date=f_date);
else
null;
end if;
duty_calc;
end duty_calc;
And i have declare in the program unit as Duty_calc and while i am executing my procedure i had an error
is it must i need to declare a my inner procedure in my program unit
Regards
Srikkanth.Mthe same question you asked 2 month ago and same mistake you are doing
- Procedure name can only be one.
- Count proper BEGIN ENDs
PROCEDURE Duty_calc
IS
BEGIN
begin
update dail_att set wtime= (select lpad((to_number(to_char(outtime,'hh24mi')-to_char(intime,'hh24mi'))),4,0) from dail_att where attend_date=f_date);
end;
begin
if wtime >0830 then
update dail_att set etime= (select lpad(wtime-0830) from dail_att where attend_date=f_date);
else
null;
end if;
end;
END;
Maybe you are looking for
-
How can I set up Facetime on a deactivated Sprint iphone 4?
I bought a Sprint iphone 4 from someone who had deactivated due to he couldnt afford the extra data package; therefore the ESN is bad and not free and clear. I have a 12yr old son with Down Syndrome who had played with his sisters ipod touch and I th
-
Itunes will not install. I get the error message "Error writing to file: C:\Program Files\Common Files\Apple\Mobile Device Support\com.apple.IE.client_main.dll Verify that you have access to that directory."
-
Adobe photoshop cs5 stroke problems
Dear Adobe Team, We are using adobe Photoshop CS5 in our HP Workstation machine, but since we changed our OS in windows 7 we are facing stroke problems. Like whenever we draw a straight stroke than it does not go straight it becomes curve type. Pleas
-
Mac-with Leopard-Adobe Reader 8.1 will not open previously scanned files
Have a Intel Mac and use Leopard. When using Reader 7.1 previously scanned files (eg. recipes) always opened. Upgraded to Adobe Reader 8.1 Now, on a number of them, the icon is black, and when I attempt to open them I get the following message..for s
-
Check read/write acces to a certain folder without throwing exceptions
Hello Can somebody help me in finding a method for getting the read/write acces status to a certain location? I need to have a function wich return me true when I have acces to read inside a folder for instance. Thanks in advance, Ciprian LUPU