ORA-06521:PL/SQL:Error mapping function :ORA-06522:undefined :ODCIAggregate
Hi,
I am getting the following error :
SQL> select MinDistance(TT) from egg1;
select MinDistance(TT) from egg1
ERROR at line 1:
ORA-06521: PL/SQL: Error mapping function
ORA-06522: /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/lib/custagg.so:
undefined symbol: ODCIAggregateInitialize
I am compiling my C program with OCI using the following command :
g++ -Wall -c custagg.c -o custagg.o -I$ORACLE_HOME/rdbms/public -I/usr/lib
I am linking to get a shared library custagg.so file with following command :
ld -shared -o custagg.so custagg.o $ORACLE_HOME/lib/l*.so ../../usr/lib/libstdc++.s*
I am not getting any errors during these two phases.
And when i am calling the extproc custagg(Mindistance) which i implemented using ODCI(oracle data catridge interface) ...I am getting the error undefined symbol : ODCIAggregateInitialize
So can any one please let me know what shared libraries are required to access the ODCI services and also am I compiling and linking it the right way or am I missing any libraries.
I have the oci.h & odci.h and several other header files in my :
$ORACLE_HOME/rdbms/public
And while linking i am using : $ORACLE_HOME/lib/*.so files.
So I don't know whether my directory is missing some shared files related to ODCI : can any one please let me know which files or shared libraries I am missing :
Below are list of files in my : $ORACLE_HOME/lib :
custagg123.o libclntsh.so libdbcfg10.so libjox10.so libocci.so.10.1 liborasdkbase.so libskgxpd.so libunwind.so.5
custagg.so libclntsh.so.10.1 libemmas10.so libldapjclnt10.so libocijdbc10.so liborasdkbase.so.10.2 libskgxpu.so libxdb.so
facility.lis libclsra10.so libhasgen10.so libnjni10.so libocr10.so liborasdk.so libsqlplus.so shell.so
hsdb_odbc.so libcorejava.so libheteroxa10.so libnjssl10.so libocrb10.so liborasdk.so.10.2 libsqora.so.10.1 sysliblist
hsdb_ora.so libcoresh10.so libhsbase.so libnnz10.so libocrutl10.so libqsmashr.so libsrvm10.so
lclasses12.zip libcprts.so.5 libhsnav.so libnque10.so libodm10.so libskgxn2.so libsrvmhas10.so
libagtsh.so libcxa.so.3 libimf.so libntcpaio10.so libodmd10.so libskgxns.so libsrvmocr10.so
libagtsh.so.1.0 libcxa.so.5 libirc.a libocci.so libons.so libskgxp10.so libuini10.so
Please reply to my queries.
Please let me know if you want to have a look at the symbols of my object file
Thanks & Regards,
-NN
It's only a quick guess but have you checked your tnsnames.ora file to ensure you've opened the environment to find the libraries? If you set the EXTPROC_DLLS=ANY, you open the database to security issues but it should tell you if this cause because you can't access the library that contains the symbol.
SID_LIST_CALLOUT_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = <oracle_home_directory>)
(PROGRAM = extproc)
(ENV = "EXTPROC_DLLS=ONLY:
<oracle_home_directory>/customlib/writestr1.so
,LD_LIBRARY_PATH=<oracle_home_directory>/lib")
)
Similar Messages
-
Hi,
I am getting the following error :
SQL> select MinDistance(TT) from egg1;
select MinDistance(TT) from egg1
ERROR at line 1:
ORA-06521: PL/SQL: Error mapping function
ORA-06522: /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/lib/custagg.so:
undefined symbol: ODCIAggregateInitialize
I am compiling my C program with OCI using the following command :
g++ -Wall -c custagg.c -o custagg.o -I$ORACLE_HOME/rdbms/public -I/usr/lib
I am linking to get a shared library custagg.so file with following command :
ld -shared -o custagg.so custagg.o $ORACLE_HOME/lib/l*.so ../../usr/lib/libstdc++.s*
I am not getting any errors during these two phases.
And when i am calling the extproc custagg(Mindistance) which i implemented using ODCI(oracle data catridge interface) ...I am getting the error undefined symbol : ODCIAggregateInitialize
So can any one please let me know what shared libraries are required to access the ODCI services and also am I compiling and linking it the right way or am I missing any libraries.
I have the oci.h & odci.h and several other header files in my :
$ORACLE_HOME/rdbms/public
And while linking i am using : $ORACLE_HOME/lib/*.so files.
So I don't know whether my directory is missing some shared files related to ODCI : can any one please let me know which files or shared libraries I am missing :
Below are list of files in my : $ORACLE_HOME/lib :
custagg123.o libclntsh.so libdbcfg10.so libjox10.so libocci.so.10.1 liborasdkbase.so libskgxpd.so libunwind.so.5
custagg.so libclntsh.so.10.1 libemmas10.so libldapjclnt10.so libocijdbc10.so liborasdkbase.so.10.2 libskgxpu.so libxdb.so
facility.lis libclsra10.so libhasgen10.so libnjni10.so libocr10.so liborasdk.so libsqlplus.so shell.so
hsdb_odbc.so libcorejava.so libheteroxa10.so libnjssl10.so libocrb10.so liborasdk.so.10.2 libsqora.so.10.1 sysliblist
hsdb_ora.so libcoresh10.so libhsbase.so libnnz10.so libocrutl10.so libqsmashr.so libsrvm10.so
lclasses12.zip libcprts.so.5 libhsnav.so libnque10.so libodm10.so libskgxn2.so libsrvmhas10.so
libagtsh.so libcxa.so.3 libimf.so libntcpaio10.so libodmd10.so libskgxns.so libsrvmocr10.so
libagtsh.so.1.0 libcxa.so.5 libirc.a libocci.so libons.so libskgxp10.so libuini10.so
Please reply to my queries.
Please let me know if you want to have a look at the symbols of my object file
Thanks & Regards,
-NNYour issue may relate to XE and it may relate to OCI but it does not relate to SQL and PL/SQL. Consider posting your question in a forum where it will be on topic.
When you do include full version information (3 decimal places) and the code that is generating the exception. -
ORA-06521: PL/SQL: Error mapping function
Hi folks,
I am trying to run gather_table_stats for a particular table but am getting the below error. Any ideas?
SQL> execute DBMS_STATS.gather_table_stats( ownname=>'DBO',tabname=>'CD_JOURNAL_CHANGE_REG',method_opt=>'FOR ALL INDEXED COLUMNS',cascade=>TRUE);
BEGIN DBMS_STATS.gather_table_stats( ownname=>'DBO',tabname=>'CD_JOURNAL_CHANGE_REG',method_opt=>'FOR ALL INDEXED COLUMNS',cascade=>TRUE); END;
ERROR at line 1:
ORA-06521: PL/SQL: Error mapping function
ORA-06512: at "SYS.DBMS_STATS", line 10301
ORA-06512: at "SYS.DBMS_STATS", line 10315
ORA-06512: at line 1
I have runt utlrp.sql as sys but with no avail.
Kindest Regards,
WillYou did not mention if the applicable table contains an ADT columns, nested tables and so on.
You can also do a basic test to determine if the problem is potentially with the table, or with dbms_stats itself. Create a plain table, e.g.
create table foo( id number, foo_char varchar2(100), constraint pk_foo primary key( id ) using index );
Using the exact same dbms_stats parameters, do this table. If it works, it points to a potential problem with the other table - some data structure/data type issue maybe. If it does not, then you have a problem with dbms_stats itself.
You can also drop the indexes on the DBO table and try dbms_stats with different parameters. I.e. change the conditions to see if the error still occur in order to isolate the problem.
You also could log an iTar/SR for this with Oracle Support. -
Call to ldap server fails ORA-06521: PL/SQL: Error mapping function
I am getting this error(s)
ORA-06521: PL/SQL: Error mapping function
ORA-06512: at "SYS.DBMS_LDAP_API_FFI", line 0
ORA-06512: at "SYS.DBMS_LDAP", line 1338
ORA-06512: at "SYS.DBMS_LDAP", line 1273
ORA-06512: at "SYS.DBMS_LDAP", line 529
ORA-06512: at line 127
after binding and searching an ldap directory.
Line 127 is:
my_dn := DBMS_LDAP.get_dn(my_session, my_entry);
Both of the 'my_xx' parameters have been successfully set earlier in the script I believe as they produce no errors and DBMS_LDAP.count_entries(my_session, my_message) returns = 1.
I am following the example at:
http://download-west.oracle.com/docs/cd/B10501_01/network.920/a96577/smplcode.htm#636994
In fact any of the functions used in the 'while loop' in the above example give a similar error.
Apparently SYS.DBMS_LDAP_API_FFI is a call to an external C program, but this would be a standard Oracle one, not one I have written.
I am connecting to a non-Oracle ldap server, and have tried several (OpenLDAP 2.X, & Windows 2000 AD), with same results.
Any suggestions gratefully received.
Cheers
KIMFixed by running the catldap.sql script (ORACLE_HOME/rdbms/admin/catldap.sql) as SYS user and recreated the dbms_ldap packages. I am not sure why some of the functions worked OK and others did not.
KIM -
Ldap problem, ORA-06521: PL/SQL: Error mapping function
I am getting this error(s)
ORA-06521: PL/SQL: Error mapping function
ORA-06512: at "SYS.DBMS_LDAP_API_FFI", line 0
ORA-06512: at "SYS.DBMS_LDAP", line 1338
ORA-06512: at "SYS.DBMS_LDAP", line 1273
ORA-06512: at "SYS.DBMS_LDAP", line 529
ORA-06512: at line 127
after binding and searching an ldap directory.
Line 127 is:
my_dn := DBMS_LDAP.get_dn(my_session, my_entry);
Both of the 'my_xx' parameters have been successfully set earlier in the script I believe as they produce no errors and DBMS_LDAP.count_entries(my_session, my_message) returns = 1.
I am following the example at:
http://download-west.oracle.com/docs/cd/B10501_01/network.920/a96577/smplcode.htm#636994
In fact any of the functions used in the 'while loop' in the above example give a similar error.
Apparently SYS.DBMS_LDAP_API_FFI is a call to an external C program, but this would be a standard Oracle one, not one I have written.
I am connecting to a non-Oracle ldap server, and have tried several (OpenLDAP 2.X, & Windows 2000 AD), with same results.
Any suggestions gratefully received.
Cheers
KIMScott,
Thanks for your concern. I should have explained. I am working in HTMLdb, successfully using ldap to authenticate, but now need to get the logged-in user's name and other details. All my attemps to use the wwv_flow_ldap functions have failed, and I am no resorting to DBMS_LDAP to get what I want. I am hoping thatsome helpful person can shed some light on this problem
Cheers
KIM -
We have an external procedure running fine on 8.1.7 on VMS. After compiling and linking succesfully under 10.1.0, I get ORA-06521 PL/SQL: Error mapping function and ORA-06522: ERROR - vms_dlsym for file x, where x in the filename of the linked executable. Another external procedure that does not connect to the 10.1.0 database runs fine. What could be causing this error in Server 10.1.0 on VMS?
Thanks,
DaveHere is the code to create the function:
CREATE OR REPLACE FUNCTION f1
(h_file_name IN VARCHAR2)
RETURN BINARY_INTEGER
IS EXTERNAL
LIBRARY l1
NAME "f1"
LANGUAGE C
WITH CONTEXT
PARAMETERS
(CONTEST,
h_file_name string);
Here is the beginning of the Pro*C:
int f1(epctx, h_file_name)
OCIExtProcContext *epctx;
char h_file_name[70];
char h_line_txt [251];
int lineno;
FILE *fptr;
/* register the connection context ... */
EXEC SQL REGISTER CONNECT USING :epctx;
The function loads a flat file into the database. It is probably not related but are unable to SQLPLUS/ or SQLLDR/ into the database from an OS autheniticated account (get ORA-12547: TNS:lost contact.) Thanks for taking the time to look at this. There aren't many people trying this on VMS, I'd bet. -
ORA-06521: PL/SQL: Error mapping function while writting into a text file
Hi,
I'm getting an errror ORA-06521: PL/SQL: Error mapping function while trying to write data into a text file.
I'm using the following code:
--To create a new directory
create or replace directory temp as 'C:/temp';
declare
l_str varchar2(1000);
output_file utl_file.file_type;
cursor test_write_cur is
select EMPNO,ENAME,JOB,SAL,HIREDATE
from EMP
where DEPTNO=30;
begin
output_file := utl_file.fopen('TEMP','TESTFILE.txt','w');
for test_write_rec IN test_write_cur
loop
l_str := test_write_rec.EMPNO||'^'||test_write_rec.ENAME||'^'||test_write_rec.JOB||'^'||
test_write_rec.HIREDATE||'^'||test_write_rec.SAL||chr(10);
utl_file.put_line(output_file,l_str);
end loop;
utl_file.fclose(output_file);
end;Please suggest me if i'm wrong.
Thanks & Regards,
Sanket MishraDear Sanket,
I think you are need use TO_CHAR() function
to_char(test_write_rec.EMPNO) ,
to_char(test_write_rec.HIREDATE,'DD.MM.YYYY')
to_char(test_write_rec.SAL) -
DBMS_LDAP call fails with ORA-06512 Error Mapping function
Hi,
I am facing a problem with workflow integration with LDAP.
I receive
ORA-6512 Error Mapping Function on one particular line within the WF_LDAP.get_cfg_val procedure.
WHILE my_entry IS NOT NULL
LOOP
my_vals := DBMS_LDAP.get_values (p_session,
my_entry,
p_name);
The documentation says:
ORA-06521 PL/SQL: Error mapping function
Cause: An error was detected by PL/SQL trying to map the mentioned
function dynamically.
Action: Check the stacked error (if any) for more details.
This is the trace of the error:
ORA-06521 PL/SQL Error mapping Function
ORA-06512 at SYS.DBMS_LDAP_API_FFI line 0
ORA-06512 at SYS.DBMS_LDAP line 1332
ORA-06512 at SYS.DBMS_LDAP line 1302
ORA-06512 at SYS.DBMS_LDAP line 582
This is the header of the catldap.sql file
Rem
Rem $Header: catldap.sql 07-jan-2000.19:15:20 akolli Exp $
Rem
Rem catldap.sql
Rem
Rem $Header: dbmsldap.sql 14-dec-2001.23:25:22 rbollu Exp $
Rem
Rem dbmsldap.sql
Rem
This is the output while running it (No errors):
Library created.
Package created.
Package created.
Package created.
Package body created.
Package body created.
Package body created.
Synonym created.
Grant succeeded.
Synonym created.
Grant succeeded.
Database is :
compatible 9.2.0.0.0
Am I missing something?
I have searched all the forums and although there are many references to "Error Mapping Function", noone has reported it in the context of WF - LDAP Integration. So I am not sure how to proceed.
Please help.
thanks in advance,
LibinHi Libin,
Can you please explain to me the parameters that you put in the Global Preferences, the LDAP_port,LDAP_user,and the others, because I don�t know where I need to search in the server this parameters and I don�t understand su much of OID.
if you can give to me and little description of that parameters,this would thank for much.
anticipated thanks
Arlet -
ORA-06502: PL/SQL error with dimensions and roles
Hi everyone,
When executing a mapping that loads a cube we are always getting that ORA-06502: PL/SQL error character string buffer too small
The cube contains a number of dimensions, some of them with roles. We've checked that the error appears when we use two different lookup operators to fill dimension atributtes in the cube and its correspondent role. If we map dimension attributes with lookup operator, and the role attributes with constants, the mapping executes without any error. Moreover, even thought it doesnt make any sense, if we map the role dimension attributes with a lookup operator linked to a different dimension, it works too.
We think that this could be due to attributes names, maybe they are too long, but we have tried to make them shorter and still getting the same error.
Any ideas of what could be happening?
Thank you so much in advance.The return datatype in a PLSQL function is unconstrained. Which means it does not have a size.
The size is declared on the receiving end.
What size variable are you trying to return your value into?
Here is an example...
SQL>create or replace function my_func
2 return varchar2
3 is
4 begin
5 return USER;
6 end;
7 /
Function created.
SQL>declare
2 my_string varchar2(30);
3 begin
4 my_string := my_func;
5 end;
6 /
PL/SQL procedure successfully completed.
SQL>declare
2 my_string varchar2(3);
3 begin
4 my_string := my_func;
5 end;
6 /
declare
ERROR at line 1:
ORA-06502: PL/SQL: numeric or value error: character string buffer too small
ORA-06512: at line 4 -
REP-1401 'beforereport' Fatal PL/SQL error occurred. ORA 00000 normal.
Hi,
I am running the report Journals - General (132 char)- file name GLRGNJ.rdf from
Oracle Report Builder 6.0.8.11.3.
I have commented all the (srw.user_exit) in the Before Report trigger but i still
get the message:
REP-1401 'beforereport' Fatal PL/SQL error occurred. ORA 00000 normal,
successful completion.
Can anyone suggest a solution please?
Thanks,
FarisDear sir, i am created one formula column in Reports6i and the following error has come. Could u please find out a solution. Thanks in advance.
my function is below
function CF_Branch_NameFormula return Char is
lc_branch_name varchar2(100);
begin
SELECT rtrim(substr(FVT.DESCRIPTION
,instr(FVT.DESCRIPTION,'-',1)+1
,100)) INTO lc_branch_name
FROM FND_FLEX_VALUES FFV, FND_FLEX_VALUES_TL FVT
WHERE FFV.flex_value_Set_id = 1007956
AND FFV.FLEX_VALUE_ID = FVT.FLEX_VALUE_ID
AND FFV.FLEX_VALUE = FVT.FLEX_VALUE_MEANING
AND FVT.DESCRIPTION <> 'xxx'
and rownum<=1
AND SUBSTR(FVT.FLEX_VALUE_MEANING,3,2) = :P_BRANCH;
return (lc_branch_name);
end; -
REP-1401: Fatal PL/SQL error occurred. ORA-01403: no data found
Hi guys,
I am getting error 'REP-1401: Fatal PL/SQL error occurred. ORA-01403: no data found ' when run the report
and i m also use formula column in my report.
can any body help me why it's coming.
following code is used in formula column plz check and verify:
function CF_3Formula return Char is
T1 VARCHAR2(100);
begin
SELECT
VAT_REG_NO INTO T1
FROM
JA_IN_HR_ORGANIZATION_UNITS JIHOU,
HR_LOCATIONS HL--,
--MTL_TXN_REQUEST_HEADERS MTLH
WHERE
JIHOU.ORGANIZATION_ID=HL.INVENTORY_ORGANIZATION_ID AND
JIHOU.LOCATION_ID=HL.LOCATION_ID AND
--Jihou.ORGANIZATION_ID = Mtlh.Organization_Id AND
-- Hl.INVENTORY_ORGANIZATION_ID =Mtlh.Organization_Id AND
-- MTLH.ATTRIBUTE10=SUBSTR(HL.LOCATION_CODE,1,3) AND
SUBSTR(HL.LOCATION_CODE,1,3)= :TO_ORG1 ;
RETURN (T1);
end;
plz help me out.Hi;
What is EBS version? Is it custom report or not?
See below which is mention similar errors
Autoinvoice Error: ORA-1403: no data found [ID 1209403.1]
APXIIMPT - Payable Open Interface Import Fails on "REP-1401: 'cf_source_nameformula': Fatal PL/SQL error occurred. ORA-01403: no data found" [ID 222058.1]
Regard
Helios -
Hi Team,
I am running one conc programme.
After running I am getting below error. I checked the issue on metalink and other, seems that it is an size related issue. I have increased the size of formula columns and placeholdder too.
But still getting issue.
My requirement is to get comma seperated values using SQL query itself. Neither i wanted to create layout of the report , since it is a XML publisher report and nor I am including it on RTF template.
I want the CF_10 formula column to be populated with comma seperated values.
MSG-00187: From Date 01-Sep-2014
REP-1401: 'cf_10formula': Fatal PL/SQL error occurred.
ORA-06502: PL/SQL: numeric or value error
And Here is my code for CF_10
function CF_10Formula return Number is
begin
SELECT NVL(TO_CHAR(sum(Amount),'99,99,99,999'),0) into :CP_5 --NVL(ROUND(sum(Amount)),0) into :CP_5
-- xxhw_Coll_cat(category) "Intercat Catg"
FROM hhxw_Region_col_v
WHERE Category IN ('Intercompany - CATV')
AND trunc(gl_date) BETWEEN TO_DATE(:P_FROM_DATE, 'DD/MM/RRRR') AND TO_DATE(:P_TO_DATE, 'DD/MM/RRRR');
RETURN ROUND(:CP_5);
end;
Anyone please suggest me.
Regards,
SachinHi,
1)Why are you selecting the value into a report item? Select into a local variable and return that
RETURN :CP_5 --> This one!!
2)And you should avoid applying functions to DB columns in where clauses wherever possible, so oracle can use indexes on them if applicable:
AND gl_date >= To_date(:P_FROM_DATE, 'DD/MM/RRRR')
AND gl_date < To_date( :P_TO_DATE, 'DD/MM/RRRR') + 1;
I think you are taking 2 column in the Layout CF_10 and CP_5 right? if so, then use below Query.
FUNCTION cf_10formula
RETURN NUMBER
IS
v_amount NUMBER:null;
IS
BEGIN
BEGIN
SELECT nvl(round(SUM(amount)), 0)
INTO v_amount --> Retruns the value for CF_10 column
FROM hhxw_region_col_v
WHERE category IN ( 'Intercompany - CATV' )
AND gl_date >= to_date(:P_FROM_DATE, 'DD/MM/RRRR')
AND gl_date < to_date( :P_TO_DATE, 'DD/MM/RRRR') + 1;
:CP_5 := nvl(trunc(v_amount),0); --> Retruns the value for CP_5 column
EXCEPTION
WHEN OTHERS THEN
v_amount := 0;
srw.message(1003,'Error in Getting :' ||p_from_date);
END;
END;
And
If you've got a number function returning into a number field then all you should need to do to make the comma appear is to change the number format mask in field.
From 40000 to 40,000 -
ORA-06502: PL/SQL: error TABLE OF BOOLEAN INDEX BY BINARY_INTEGER;
Hi,
I've a Compiled Body Package which code I described below:
create or replace
PACKAGE body emp_pkg
IS
TYPE boolean_tabtype2
IS
TABLE OF BOOLEAN INDEX BY BINARY_INTEGER;
valid_jobs boolean_tabtype2;
PROCEDURE add_employee(
first_name employees.first_name%TYPE,
last_name employees.last_name%TYPE,
deptid employees.department_id%TYPE,
jobid employees.job_id%type)
IS
BEGIN
IF valid_deptid(deptid) THEN
if valid_jobid(jobid) then
INSERT
INTO employees
employee_id,
first_name,
last_name,
email,
hire_date,
job_id,
department_id
VALUES
employees_seq.NEXTVAL,
first_name,
last_name,
SUBSTR(first_name,1,1)
||SUBSTR(last_name,1,7)
||'@buongio.com',
sysdate,
'SA_REP',
deptid
ELSE
RAISE_APPLICATION_ERROR (-20204, 'Invalid job ID. Try again.');
END IF;
END add_employee;
PROCEDURE init_jobs
is
begin
FOR rec IN
(SELECT job_id FROM jobs
LOOP
valid_jobs(rec.job_id):=true;
END LOOP;
END init_jobs;
function valid_jobid(
jobid employees.job_id%type)
return boolean
is
BEGIN
return valid_jobs.exists(jobid);
EXCEPTION
WHEN no_data_found THEN
dbms_output.put_line('no valid');
RETURN FALSE;
END valid_jobid ;
BEGIN
init_jobs;
END emp_pkg;and the server gives me the next output
ORA-06502: PL/SQL: error : error de conversión de carácter a número numérico o de valorI suspect that the problem is the procedure init_jobs but I don't Know what could I do to resolve it.
Thanks in advance...sorry
I forget to remove it,
the code:
create or replace
PACKAGE body emp_pkg
IS
TYPE boolean_tabtype2
IS
TABLE OF BOOLEAN INDEX BY BINARY_INTEGER;
valid_jobs boolean_tabtype2;
PROCEDURE add_employee(
first_name employees.first_name%TYPE,
last_name employees.last_name%TYPE,
deptid employees.department_id%TYPE,
jobid employees.job_id%type)
IS
BEGIN
if valid_jobid(jobid) then
INSERT
INTO employees
employee_id,
first_name,
last_name,
email,
hire_date,
job_id,
department_id
VALUES
employees_seq.NEXTVAL,
first_name,
last_name,
SUBSTR(first_name,1,1)
||SUBSTR(last_name,1,7)
||'@buongio.com',
sysdate,
'SA_REP',
deptid
ELSE
RAISE_APPLICATION_ERROR (-20204, 'Invalid job ID. Try again.');
END IF;
END add_employee;
PROCEDURE init_jobs
is
begin
FOR rec IN
(SELECT job_id FROM jobs
LOOP
valid_jobs(rec.job_id):=true;
END LOOP;
END init_jobs;
function valid_jobid(
jobid employees.job_id%type)
return boolean
is
BEGIN
return valid_jobs.exists(jobid);
EXCEPTION
WHEN no_data_found THEN
dbms_output.put_line('no valid');
RETURN FALSE;
END valid_jobid ;
BEGIN
init_jobs;
END emp_pkg; -
The following is the error msg, I am trying to run the stored procedure to insert data into few tables.
Pls suggest any solution to this error msg: Thanks.
08/05/2005 11:27:41-> Level:1, UpLoader: SQL Error Messge: [SERVERERROR] ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'ENTPRFMAN'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
PROCEDURE ENTPRFMAN
p_source_acct_id char, /*1*/
p_source_system char, /*2*/
p_entity_name char, /*3*/
p_entity_legal_name char, /*4*/
p_entity_long_name char, /*5*/
p_associated_entity_id char, /*6*/
p_entity_type char, /*7*/
p_list_order char, /*8*/
p_tax_id_number char, /*9*/
p_inception_date char, /*10*/
p_fiscal_end_date char, /*11*/
p_marketing_open_date char, /*12*/
p_base_currency char, /*13*/
p_account_status char, /*14*/
p_entity_code char, /*15*/
p_orig_source_system char, /*16*/
p_account_legal_form char, /*17*/
p_business_sector char, /*18*/
p_direct_account_ind char, /*19*/
p_portfolio_type_code char, /*20*/
p_target_dict_name char, /*21*/
p_dict_level char, /*22*/
p_cust_indx_type char, /*23*/
p_blnd_source char, /*24*/
p_ml_interpolate_yn char, /*25*/
p_source_level1 char, /*26*/
p_source_entity_xref1 char, /*27*/
p_source_entity_xref1_type char, /*28*/
p_source_dict_name1 char, /*29*/
p_weight1 char, /*30*/
p_source_level2 char, /*31*/
p_source_entity_xref2 char, /*32*/
p_source_entity_xref2_type char, /*33*/
p_source_dict_name2 char, /*34*/
p_weight2 char, /*35*/
p_source_level3 char, /*36*/
p_source_entity_xref3 char, /*37*/
p_source_entity_xref3_type char, /*38*/
p_source_dict_name3 char, /*39*/
p_weight3 char, /*40*/
p_source_level4 char, /*41*/
p_source_entity_xref4 char, /*42*/
p_source_entity_xref4_type char, /*43*/
p_source_dict_name4 char, /*44*/
p_weight4 char, /*45*/
p_source_level5 char, /*46*/
p_source_entity_xref5 char, /*47*/
p_source_entity_xref5_type char, /*48*/
p_source_dict_name5 char, /*49*/
p_weight5 char, /*50*/
p_source_level6 char, /*51*/
p_source_entity_xref6 char, /*52*/
p_source_entity_xref6_type char, /*53*/
p_source_dict_name6 char, /*54*/
p_weight6 char, /*55*/
p_source_level7 char, /*56*/
p_source_entity_xref7 char, /*57*/
p_source_entity_xref7_type char, /*58*/
p_source_dict_name7 char, /*59*/
p_weight7 char, /*60*/
p_source_level8 char, /*61*/
p_source_entity_xref8 char, /*62*/
p_source_entity_xref8_type char, /*63*/
p_source_dict_name8 char, /*64*/
p_weight8 char, /*65*/
p_source_level9 char, /*66*/
p_source_entity_xref9 char, /*67*/
p_source_entity_xref9_type char, /*68*/
p_source_dict_name9 char, /*69*/
p_weight9 char, /*70*/
p_source_level10 char, /*71*/
p_source_entity_xref10 char, /*72*/
p_source_entity_xref10_type char, /*73*/
p_source_dict_name10 char, /*74*/
p_weight10 char, /*75*/
p_OUT OUT char
AS
v_date rulesdbo.entity.upd_date%TYPE:= SYSDATE;
v_update_source rulesdbo.entity.upd_user%TYPE:= 'PRFENT';
v_entity_id rulesdbo.entity.entity_id%type;
b_valid BOOLEAN;
/* Supported Entity Types - Index Index */
v_sb_entity_type rulesdbo.entity.entity_type%type:= 'INDX';
v_bb_entity_type rulesdbo.entity.entity_type%type:= 'CIDX';
v_bb_dict_l1_cv rulesdbo.dictionary_detail.dict_l1_code_value%type := 'TOTAL';
na_outparam EagleGen.t_outparam;
/* Constants */
g_prf_intfc rulesdbo.entity.src_intfc_inst%type:= -1;
v_src_intfc_inst rulesdbo.entity.src_intfc_inst%type:= -1;
/* Business Groups */
v_group_name1 pace_masterdbo.pace_user_groups.group_name%type := 'ASP Reporting Grp';
v_group_name2 pace_masterdbo.pace_user_groups.group_name%type := 'Client Rptg Grp';
v_group_name3 pace_masterdbo.pace_user_groups.group_name%type := 'Client Rptg Mgr Grp';
v_group_name4 pace_masterdbo.pace_user_groups.group_name%type := 'Client Srvc Grp';
v_group_name5 pace_masterdbo.pace_user_groups.group_name%type := 'Client Srvc Mgr Grp';
v_group_name6 pace_masterdbo.pace_user_groups.group_name%type := 'Data Mgmt Grp';
v_group_name7 pace_masterdbo.pace_user_groups.group_name%type := 'Data Services Grp';
v_group_name8 pace_masterdbo.pace_user_groups.group_name%type := 'Dom Operations (FDS)';
v_group_name9 pace_masterdbo.pace_user_groups.group_name%type := 'QA Portfolio Mgr Grp';
v_group_name10 pace_masterdbo.pace_user_groups.group_name%type := 'SRS (LPS) Group';
v_group_name11 pace_masterdbo.pace_user_groups.group_name%type := 'LG Cap Val PM Group';
v_group_name12 pace_masterdbo.pace_user_groups.group_name%type := 'APL Large Cap Value';
v_group_name13 pace_masterdbo.pace_user_groups.group_name%type := 'Small Cap PM Grp';
v_group_name14 pace_masterdbo.pace_user_groups.group_name%type := 'Client Rptg Dev Grp';
v_entity_name rulesdbo.entity.entity_name%type; -- HX 17MAR05
** Checks to see if entity exists
PROCEDURE validate_entityid(p_acctid IN rulesdbo.entity_xreference.xref_account_id%TYPE,
p_acctid_type IN rulesdbo.entity_xreference.xref_account_id_type%TYPE,
l_entity_id OUT rulesdbo.entity_xreference.entity_id%TYPE,
b_valid OUT BOOLEAN)
IS
BEGIN
select ex.entity_id into l_entity_id
from rulesdbo.entity_xreference ex, rulesdbo.entity e
where ex.xref_account_id = trim(p_acctid)
and ex.xref_account_id_type = trim(p_acctid_type)
and ex.entity_id = e.entity_id;
b_valid:=TRUE;
EXCEPTION
WHEN NO_DATA_FOUND THEN
b_valid:=TRUE;
l_entity_id:=null;
dbms_output.put_line('IN ENTITY VALIDATE no data');
WHEN OTHERS THEN
dbms_output.put_line('IN ENTITY VALIDATE ERROR');
b_valid:=FALSE;
END; -- validate entity id func ends here
** Checks to see if entity xref exists, if not then add xref
FUNCTION entity_xref(p_acctid rulesdbo.entity_xreference.xref_account_id%TYPE,
p_acctid_type rulesdbo.entity_xreference.xref_account_id_type%TYPE,
p_entity_id rulesdbo.entity_xreference.entity_id%TYPE)
RETURN BOOLEAN
AS
l_count NUMBER:=0;
v_entity_xref_id rulesdbo.entity_xreference.instance%type;
BEGIN
select count(*) into l_count
from rulesdbo.entity_xreference
where xref_account_id = trim(p_acctid)
and xref_account_id_type = trim(p_acctid_type);
if l_count > 0 then
UPDATE rulesdbo.entity_xreference
SET update_date = v_date,
update_source = v_update_source,
entity_id = p_entity_id
WHERE xref_account_id = trim(p_acctid)
AND xref_account_id_type = trim(p_acctid_type);
RETURN TRUE;
else
pace_masterdbo.getnextinstance('RULESDBO.ENTITY_XREFERENCE',1,v_entity_xref_id);
INSERT INTO rulesdbo.entity_xreference
instance, update_date, update_source, entity_id, xref_account_id, xref_account_id_type
VALUES
v_entity_xref_id, v_date, v_update_source, p_entity_id, trim(p_acctid), trim(p_acctid_type)
RETURN TRUE;
end if;
EXCEPTION
WHEN OTHERS THEN
RETURN FALSE;
END; -- entity_xref func ends here
** Finds dictionary_id given dictionary_name
FUNCTION getDictionaryId(p_dict_name IN rulesdbo.dictionaries.dictionary_name%TYPE,
p_dict_id OUT rulesdbo.dictionaries.dictionary_id%TYPE)
RETURN BOOLEAN
AS
v_dict_id rulesdbo.dictionaries.dictionary_id%type;
v_dict_name rulesdbo.dictionaries.dictionary_name%type;
BEGIN
dbms_output.put_line('dictionary_name = '||p_dict_name);
--trim input
v_dict_name := trim(p_dict_name);
select dictionary_id into v_dict_id
from rulesdbo.dictionaries
where dictionary_name = v_dict_name;
dbms_output.put_line('dictionary_id = '||v_dict_id);
if v_dict_id is not null then
p_dict_id := v_dict_id;
RETURN TRUE;
else
p_dict_id := NULL;
RETURN FALSE;
end if;
EXCEPTION
WHEN OTHERS THEN
RETURN FALSE;
END; -- getDictionaryId func ends here
** Finds dictionary_detail_id given dictionary_name
FUNCTION getDictionaryItemId(p_dict_id IN rulesdbo.dictionary_detail.dictionary_id%TYPE,
p_dict_l1_code_value IN rulesdbo.dictionary_detail.dict_l1_code_value%TYPE,
p_dict_l2_code_value IN rulesdbo.dictionary_detail.dict_l2_code_value%TYPE,
p_dict_item_id OUT rulesdbo.dictionary_detail.dictionary_item_id%TYPE)
RETURN BOOLEAN
AS
v_dict_item_id rulesdbo.dictionary_detail.dictionary_item_id%type;
v_dict_l1 rulesdbo.dictionary_detail.dict_l1_code_value%TYPE;
v_dict_l2 rulesdbo.dictionary_detail.dict_l2_code_value%TYPE;
BEGIN
--trim input
v_dict_l1 := trim(p_dict_l1_code_value);
v_dict_l2 := trim(p_dict_l2_code_value);
/* Total Level Only dictionary custom logic */
if v_dict_l2 <> 'TOTAL' then
select dictionary_item_id into v_dict_item_id
from rulesdbo.dictionary_detail
where dictionary_id = p_dict_id
and dict_l1_code_value = v_dict_l1
and dict_l2_code_value = v_dict_l2;
else
select dictionary_item_id into v_dict_item_id
from rulesdbo.dictionary_detail
where dictionary_id = p_dict_id
and dict_l1_code_value = v_dict_l1
and dict_l2_code_value is null;
end if;
if v_dict_item_id is not null then
p_dict_item_id := v_dict_item_id;
RETURN TRUE;
else
p_dict_item_id := NULL;
RETURN FALSE;
end if;
EXCEPTION
WHEN OTHERS THEN
RETURN FALSE;
END; -- getDictionaryDetailId func ends here
** Finds instance for given source short_desc
FUNCTION getSourceId(p_source_name IN pace_masterdbo.interfaces.short_desc%TYPE,
p_source_id OUT pace_masterdbo.interfaces.instance%TYPE)
RETURN BOOLEAN
AS
v_source_id pace_masterdbo.interfaces.instance%TYPE;
v_source_name pace_masterdbo.interfaces.short_desc%TYPE;
BEGIN
--trim input
v_source_name := trim(p_source_name);
select instance into v_source_id
from pace_masterdbo.interfaces
where short_desc = v_source_name;
if v_source_id is not null then
p_source_id := v_source_id;
RETURN TRUE;
else
p_source_id := NULL;
RETURN FALSE;
end if;
EXCEPTION
WHEN OTHERS THEN
RETURN FALSE;
END; -- getSourceId func ends here
** Finds entity_id given xref_account_id
FUNCTION getEntityId( p_account_id IN rulesdbo.entity_xreference.xref_account_id%TYPE,
p_account_id_type IN rulesdbo.entity_xreference.xref_account_id_type%TYPE,
p_entity_id OUT rulesdbo.entity_xreference.entity_id%TYPE)
RETURN BOOLEAN
AS
v_entity_id rulesdbo.entity_xreference.entity_id%TYPE;
v_account_id rulesdbo.entity_xreference.xref_account_id%TYPE;
v_account_id_type rulesdbo.entity_xreference.xref_account_id_type%TYPE;
BEGIN
--trim input
v_account_id := trim(p_account_id);
v_account_id_type := trim(p_account_id_type);
select entity_id into v_entity_id
from rulesdbo.entity_xreference
where xref_account_id = v_account_id
and xref_account_id_type = v_account_id_type;
if v_entity_id is not null then
p_entity_id := v_entity_id;
RETURN TRUE;
else
p_entity_id := NULL;
RETURN FALSE;
end if;
EXCEPTION
WHEN OTHERS THEN
RETURN FALSE;
END; -- getEntityId func ends here
** FOR BLENDED BENCHMARKS ONLY
FUNCTION processLevel( p_level_id IN NUMBER,
p_blend_entity_id IN rulesdbo.entity.entity_id%TYPE,
p_target_dict_id IN rulesdbo.dictionaries.dictionary_id%TYPE,
p_dict_level IN rulesdbo.custom_index_attributes.dict_level%TYPE,
p_dict_l2_code_value1 IN rulesdbo.dictionary_detail.dict_l2_code_value%TYPE,
p_entity_xref1 IN rulesdbo.entity_xreference.xref_account_id%TYPE,
p_entity_xref1_type IN rulesdbo.entity_xreference.xref_account_id_type%TYPE,
p_source_dictname1 IN rulesdbo.dictionaries.dictionary_name%TYPE,
p_weight1 IN rulesdbo.custom_index_attributes.weight%TYPE
RETURN BOOLEAN
AS
l_count NUMBER:=0;
v_instance rulesdbo.custom_index_attributes.instance%TYPE;
v_source_dict_id rulesdbo.custom_index_attributes.source_dict_id%TYPE;
v_entity_id rulesdbo.entity.entity_id%TYPE;
v_src_intfc_inst rulesdbo.custom_index_attributes.src_intfc_inst%TYPE;
v_target_dict_item_id rulesdbo.custom_index_attributes.target_dict_item_id%TYPE;
b_valid BOOLEAN;
BEGIN
b_valid := getSourceId('EAGLE PACE', v_src_intfc_inst);
dbms_output.put_line('Source Id = '||v_src_intfc_inst);
b_valid := getEntityId(p_entity_xref1, p_entity_xref1_type, v_entity_id);
dbms_output.put_line('Level Entity Xref = '||p_entity_xref1);
dbms_output.put_line('Level Entity Id = '||v_entity_id);
IF NOT b_Valid THEN
na_outparam(na_outparam.COUNT+1) := EagleGen.GetErrEdit(p_Src => v_src_intfc_inst,
p_ShortDesc => 'ENTITY NF');
p_OUT := EagleGen.simf_table_to_varchar(na_outparam);
RETURN FALSE;
END IF;
b_valid := getDictionaryId(p_source_dictname1, v_source_dict_id);
dbms_output.put_line('Level Dictionary Id = '||v_source_dict_id);
IF NOT b_Valid THEN
na_outparam(na_outparam.COUNT+1) := EagleGen.GetErrEdit(p_Src => v_src_intfc_inst,
p_ShortDesc => 'DICT ID NF');
p_OUT := EagleGen.simf_table_to_varchar(na_outparam);
RETURN FALSE;
END IF;
b_valid := getDictionaryItemId(p_target_dict_id, v_bb_dict_l1_cv, p_dict_l2_code_value1, v_target_dict_item_id);
dbms_output.put_line('Dictionary Item Id = '||v_target_dict_item_id);
IF NOT b_Valid THEN
na_outparam(na_outparam.COUNT+1) := EagleGen.GetErrEdit(p_Src => v_src_intfc_inst,
p_ShortDesc => 'DIR NF');
p_OUT := EagleGen.simf_table_to_varchar(na_outparam);
RETURN FALSE;
END IF;
/* initial delete */
if p_level_id = 1 then
dbms_output.put_line('Deleting ALL prior blend info');
DELETE FROM rulesdbo.custom_index_attributes
WHERE entity_id = p_blend_entity_id
and target_dict_id = p_target_dict_id
and source_dict_id = v_source_dict_id
and dict_level = p_dict_level;
end if;
/* verify level */
if p_dict_l2_code_value1 is not null then
if (v_entity_id is not null) then
if (v_source_dict_id is not null) then
if (p_weight1 is not null) then
dbms_output.put_line('*** LEVEL '||p_level_id||' - INSERTING NEW RECORD INTO RULESDBO.CUSTOM_INDEX_ATTRIBUTES');
pace_masterdbo.getnextinstance('RULESDBO.CUSTOM_INDEX_ATTRIBUTES',1,v_instance);
dbms_output.put_line('Retrieved instance number = '||v_instance);
/* insert row */
INSERT INTO rulesdbo.custom_index_attributes (
instance, effective_date, entity_id, entity_detail_id, target_dict_id, source_dict_id,
dict_level, dict_level_value, weight, cust_indx_type, src_intfc_inst, update_date,
update_source, target_dict_item_id
VALUES (
v_instance, trunc(v_date), p_blend_entity_id, v_entity_id, p_target_dict_id, v_source_dict_id,
p_dict_level, substr(p_dict_l2_code_value1, 1, 30), p_weight1, substr(p_cust_indx_type, 1, 4),
v_src_intfc_inst, v_date, v_update_source, v_target_dict_item_id
b_valid := TRUE;
RETURN TRUE;
end if;
end if;
end if;
end if;
RETURN FALSE;
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line('ERRROR - '||sqlerrm);
RETURN NULL;
END; -- processLevel func ends here
FUNCTION customIndexAttributes(
p_blend_entity_id IN rulesdbo.entity.entity_id%TYPE,
p_target_dictname IN rulesdbo.dictionaries.dictionary_name%TYPE,
p_dict_l2_code_value1 IN rulesdbo.dictionary_detail.dict_l2_code_value%TYPE,
p_entity_xref1 IN rulesdbo.entity_xreference.xref_account_id%TYPE,
p_entity_xref1_type IN rulesdbo.entity_xreference.xref_account_id_type%TYPE,
p_source_dictname1 IN rulesdbo.dictionaries.dictionary_name%TYPE,
p_weight1 IN rulesdbo.custom_index_attributes.weight%TYPE,
p_dict_l2_code_value2 IN rulesdbo.dictionary_detail.dict_l2_code_value%TYPE,
p_entity_xref2 IN rulesdbo.entity_xreference.xref_account_id%TYPE,
p_entity_xref2_type IN rulesdbo.entity_xreference.xref_account_id_type%TYPE,
p_source_dictname2 IN rulesdbo.dictionaries.dictionary_name%TYPE,
p_weight2 IN rulesdbo.custom_index_attributes.weight%TYPE,
p_dict_l2_code_value3 IN rulesdbo.dictionary_detail.dict_l2_code_value%TYPE,
p_entity_xref3 IN rulesdbo.entity_xreference.xref_account_id%TYPE,
p_entity_xref3_type IN rulesdbo.entity_xreference.xref_account_id_type%TYPE,
p_source_dictname3 IN rulesdbo.dictionaries.dictionary_name%TYPE,
p_weight3 IN rulesdbo.custom_index_attributes.weight%TYPE,
p_dict_l2_code_value4 IN rulesdbo.dictionary_detail.dict_l2_code_value%TYPE,
p_entity_xref4 IN rulesdbo.entity_xreference.xref_account_id%TYPE,
p_entity_xref4_type IN rulesdbo.entity_xreference.xref_account_id_type%TYPE,
p_source_dictname4 IN rulesdbo.dictionaries.dictionary_name%TYPE,
p_weight4 IN rulesdbo.custom_index_attributes.weight%TYPE,
p_dict_l2_code_value5 IN rulesdbo.dictionary_detail.dict_l2_code_value%TYPE,
p_entity_xref5 IN rulesdbo.entity_xreference.xref_account_id%TYPE,
p_entity_xref5_type IN rulesdbo.entity_xreference.xref_account_id_type%TYPE,
p_source_dictname5 IN rulesdbo.dictionaries.dictionary_name%TYPE,
p_weight5 IN rulesdbo.custom_index_attributes.weight%TYPE,
p_dict_l2_code_value6 IN rulesdbo.dictionary_detail.dict_l2_code_value%TYPE,
p_entity_xref6 IN rulesdbo.entity_xreference.xref_account_id%TYPE,
p_entity_xref6_type IN rulesdbo.entity_xreference.xref_account_id_type%TYPE,
p_source_dictname6 IN rulesdbo.dictionaries.dictionary_name%TYPE,
p_weight6 IN rulesdbo.custom_index_attributes.weight%TYPE,
p_dict_l2_code_value7 IN rulesdbo.dictionary_detail.dict_l2_code_value%TYPE,
p_entity_xref7 IN rulesdbo.entity_xreference.xref_account_id%TYPE,
p_entity_xref7_type IN rulesdbo.entity_xreference.xref_account_id_type%TYPE,
p_source_dictname7 IN rulesdbo.dictionaries.dictionary_name%TYPE,
p_weight7 IN rulesdbo.custom_index_attributes.weight%TYPE,
p_dict_l2_code_value8 IN rulesdbo.dictionary_detail.dict_l2_code_value%TYPE,
p_entity_xref8 IN rulesdbo.entity_xreference.xref_account_id%TYPE,
p_entity_xref8_type IN rulesdbo.entity_xreference.xref_account_id_type%TYPE,
p_source_dictname8 IN rulesdbo.dictionaries.dictionary_name%TYPE,
p_weight8 IN rulesdbo.custom_index_attributes.weight%TYPE,
p_dict_l2_code_value9 IN rulesdbo.dictionary_detail.dict_l2_code_value%TYPE,
p_entity_xref9 IN rulesdbo.entity_xreference.xref_account_id%TYPE,
p_entity_xref9_type IN rulesdbo.entity_xreference.xref_account_id_type%TYPE,
p_source_dictname9 IN rulesdbo.dictionaries.dictionary_name%TYPE,
p_weight9 IN rulesdbo.custom_index_attributes.weight%TYPE,
p_dict_l2_code_value10 IN rulesdbo.dictionary_detail.dict_l2_code_value%TYPE,
p_entity_xref10 IN rulesdbo.entity_xreference.xref_account_id%TYPE,
p_entity_xref10_type IN rulesdbo.entity_xreference.xref_account_id_type%TYPE,
p_source_dictname10 IN rulesdbo.dictionaries.dictionary_name%TYPE,
p_weight10 IN rulesdbo.custom_index_attributes.weight%TYPE
RETURN BOOLEAN
AS
l_count NUMBER:=0;
v_instance rulesdbo.custom_index_attributes.instance%TYPE;
v_target_dict_id rulesdbo.custom_index_attributes.target_dict_id%TYPE;
v_source_dict_id rulesdbo.custom_index_attributes.source_dict_id%TYPE;
v_entity_id rulesdbo.entity.entity_id%TYPE;
v_entity_detail_id rulesdbo.entity_detail.entity_detail_id%TYPE;
b_valid BOOLEAN;
BEGIN
dbms_output.put_line('TRYING TO INSERT NEW RECORD INTO RULESDBO.CUSTOM_INDEX_ATTRIBUTES');
b_valid := getDictionaryId(p_target_dictname, v_target_dict_id);
dbms_output.put_line('Target Dictionary Id = '||v_target_dict_id);
-- process level 1
if p_dict_l2_code_value1 is not null then
dbms_output.put_line('Trying to process level 1');
b_valid := processLevel(1,p_blend_entity_id,v_target_dict_id,p_dict_level,
p_dict_l2_code_value1,p_entity_xref1,p_entity_xref1_type,
p_source_dictname1,p_weight1);
end if;
-- process level 2
if p_dict_l2_code_value2 is not null then
dbms_output.put_line('Trying to process level 2');
b_valid := processLevel(2,p_blend_entity_id,v_target_dict_id,p_dict_level,
p_dict_l2_code_value2,p_entity_xref2,p_entity_xref2_type,
p_source_dictname2,p_weight2);
end if;
-- process level 3
if p_dict_l2_code_value3 is not null then
dbms_output.put_line('Trying to process level 3');
b_valid := processLevel(3,p_blend_entity_id,v_target_dict_id,p_dict_level,
p_dict_l2_code_value3,p_entity_xref3,p_entity_xref3_type,
p_source_dictname3,p_weight3);
end if;
-- process level 4
if p_dict_l2_code_value4 is not null then
dbms_output.put_line('Trying to process level 4');
b_valid := processLevel(4,p_blend_entity_id,v_target_dict_id,p_dict_level,
p_dict_l2_code_value4,p_entity_xref4,p_entity_xref4_type,
p_source_dictname4,p_weight4);
end if;
-- process level 5
if p_dict_l2_code_value5 is not null then
dbms_output.put_line('Trying to process level 5');
b_valid := processLevel(5,p_blend_entity_id,v_target_dict_id,p_dict_level,
p_dict_l2_code_value5,p_entity_xref5,p_entity_xref5_type,
p_source_dictname5,p_weight5);
end if;
-- process level 6
if p_dict_l2_code_value6 is not null then
dbms_output.put_line('Trying to process level 6');
b_valid := processLevel(6,p_blend_entity_id,v_target_dict_id,p_dict_level,
p_dict_l2_code_value6,p_entity_xref6,p_entity_xref6_type,
p_source_dictname6,p_weight6);
end if;
-- process level 7
if p_dict_l2_code_value7 is not null then
dbms_output.put_line('Trying to process level 7');
b_valid := processLevel(7,p_blend_entity_id,v_target_dict_id,p_dict_level,
p_dict_l2_code_value7,p_entity_xref7,p_entity_xref7_type,
p_source_dictname7,p_weight7);
end if;
-- process level 8
if p_dict_l2_code_value8 is not null then
dbms_output.put_line('Trying to process level 8');
b_valid := processLevel(8,p_blend_entity_id,v_target_dict_id,p_dict_level,
p_dict_l2_code_value8,p_entity_xref8,p_entity_xref8_type,
p_source_dictname8,p_weight8);
end if;
-- process level 9
if p_dict_l2_code_value9 is not null then
dbms_output.put_line('Trying to process level 9');
b_valid := processLevel(9,p_blend_entity_id,v_target_dict_id,p_dict_level,
p_dict_l2_code_value9,p_entity_xref9,p_entity_xref9_type,
p_source_dictname9,p_weight9);
end if;
-- process level 10
if p_dict_l2_code_value10 is not null then
dbms_output.put_line('Trying to process level 10');
b_valid := processLevel(10,p_blend_entity_id,v_target_dict_id,p_dict_level,
p_dict_l2_code_value10,p_entity_xref10,p_entity_xref10_type,
p_source_dictname10,p_weight10);
end if;
RETURN b_valid;
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line('ERRROR - '||sqlerrm);
RETURN NULL;
END; -- customIndexAttributes func ends here
** if record in entity Detail exists add else update master entity id
** benchmark entity_id = p_mast_entity_id
** portfolio entity_id = p_feed_entity_id
FUNCTION entityDetail( p_mast_entity_id rulesdbo.entity_detail.entity_detail_id%TYPE,
p_feed_entity_id rulesdbo.entity_detail.entity_id%TYPE,
p_entity_type rulesdbo.entity_detail.entity_type%TYPE,
p_list_order rulesdbo.entity_detail.list_order%TYPE)
RETURN BOOLEAN
AS
l_count NUMBER:=0;
a_count NUMBER:=0;
BEGIN
/* if blended benchmark don't need record in ENTITY_DETAIL */
if (p_entity_type = v_bb_entity_type) then
return TRUE;
end if;
select count(*) into l_count
from rulesdbo.entity_detail
where entity_id = p_feed_entity_id
and entity_type = p_entity_type
and entity_detail_id = p_mast_entity_id;
if l_count > 0 then
dbms_output.put_line('UPDATING EXISTING RECORD IN RULESDBO.ENTITY_DETAIL');
UPDATE rulesdbo.entity_detail
SET
update_date = v_date,
update_user = v_update_source,
src_intfc_inst = v_src_intfc_inst,
list_order = p_list_order
WHERE
entity_detail_id = p_mast_entity_id
AND entity_id = p_feed_entity_id
AND entity_type = p_entity_type;
RETURN TRUE;
else
/* validate associated entity_id */
dbms_output.put_line('VALIDATING ASSOCIATED ENTITY_ID');
dbms_output.put_line('p_feed_entity_id ' || p_feed_entity_id);
select count(*) into a_count
from rulesdbo.entity
where entity_id = p_feed_entity_id;
if a_count > 0 then
dbms_output.put_line('INSERTING NEW RECORD INTO RULESDBO.ENTITY_DETAIL');
INSERT INTO rulesdbo.entity_detail
entity_detail_id, entity_id, entity_type, update_date, update_user, src_intfc_inst, list_order
VALUES
p_mast_entity_id, p_feed_entity_id, p_entity_type, v_date, v_update_source, v_src_intfc_inst, p_list_order
RETURN TRUE;
else
IF p_feed_entity_id is not null then
--For invalid, non-null associated_entity_id
RETURN FALSE;
END IF;
--For invalid, null associate_entity_id
return TRUE;
end if;
return TRUE;
end if;
EXCEPTION
WHEN OTHERS THEN
RETURN FALSE;
END; -- entityDetail func ends here
** FOR BUSINESS GROUPS
FUNCTION setBusinessGroup
( p_group_name pace_masterdbo.pace_user_groups.group_name%TYPE,
p_entity_id rulesdbo.entity.entity_id%TYPE,
p_upd_user pace_masterdbo.pace_user_groups.upd_user%TYPE,
p_upd_datetime pace_masterdbo.pace_user_groups.upd_datetime%TYPE
RETURN BOOLEAN
AS
g_count NUMBER:=0;
v_group_id pace_masterdbo.pace_user_groups.group_id%TYPE;
BEGIN
/* validate that business group is found */
select count(*) into g_count
from pace_masterdbo.pace_user_groups
where group_name = p_group_name;
if g_count <= 0 then
dbms_output.put_line('BUSINESS GROUP NOT FOUND - ' || p_group_name);
return FALSE;
end if;
/* get group_id for given group name */
select group_id into v_group_id
from pace_masterdbo.pace_user_groups
where group_name = p_group_name;
/* check if record already exists in group_entities */
select count(*) into g_count
from pace_masterdbo.group_entities
where group_id = v_group_id
and entity_id = p_entity_id;
if g_count > 0 then
/* update record */
UPDATE pace_masterdbo.group_entities
SET upd_user = p_upd_user,
upd_datetime = p_upd_datetime
WHERE group_id = v_group_id
AND entity_id = p_entity_id;
dbms_output.put_line('UPDATED RECORD FOR BUSINESS GROUP - ' || p_group_name);
else
/* insert record */
INSERT INTO pace_masterdbo.group_entities
( group_id, entity_id, upd_user, upd_datetime )
VALUES
( v_group_id, p_entity_id, p_upd_user, p_upd_datetime );
dbms_output.put_line('INSERTED NEW RECORD FOR BUSINESS GROUP - ' || p_group_name);
end if;
RETURN TRUE;
EXCEPTION
WHEN OTHERS THEN
RETURN FALSE;
END; -- setBusinessGroup func ends here
** MAIN
BEGIN
-- HX 17MAR05
v_entity_name := substr(p_entity_name,1,30);
v_entity_name := translate(v_entity_name,'/\:*?"<>~`!^|;,.''',' ');
b_valid := getSourceId('EAGLE PACE', g_prf_intfc);
dbms_output.put_line('Global Source Id = '||g_prf_intfc);
validate_entityid(p_source_acct_id,p_source_system,v_entity_id, b_valid);
IF NOT b_Valid THEN
na_outparam(na_outparam.COUNT+1) := EagleGen.GetErrEdit(p_Src => g_prf_intfc,
p_ShortDesc => 'INV ENTITY');
p_OUT := EagleGen.simf_table_to_varchar(na_outparam);
RETURN;
END IF;
if v_entity_id is not null then
dbms_output.put_line('ENTITY ID EXISTS - ' || v_entity_id);
/*Update Record in Entity Table */
UPDATE rulesdbo.entity
SET entity_type = p_entity_type,
entity_name = v_entity_name,
entity_long_name = substr(p_entity_long_name,1,60),
legal_name = p_entity_legal_name,
inception_date = to_date(p_inception_date, 'YYYYMMDD'),
marketing_open_date = to_date(p_marketing_open_date, 'YYYYMMDD'),
fiscal_end_date = to_date(p_fiscal_end_date, 'YYYYMMDD'),
tax_id_number = p_tax_id_number,
upd_date = v_date,
upd_user = v_update_source,
base_currency = p_base_currency,
account_status = p_account_status,
entity_code = p_entity_code,
orig_source_system = p_orig_source_system,
account_legal_form = p_account_legal_form,
business_sector = p_business_sector,
direct_account_ind = p_direct_account_ind,
portfolio_type_code = p_portfolio_type_code,
ml_interpolate_yn = p_ml_interpolate_yn
WHERE entity_id = v_entity_id;
dbms_output.put_line('UPDATED EXISTING RULESDBO.ENTITY RECORD');
b_valid := entityDetail(v_entity_id, p_associated_entity_id, p_entity_type, p_list_order);
else
pace_masterdbo.getnextinstance('RULESDBO.ENTITY',1,v_entity_id);
/*Insert Record into Entity Table */
INSERT INTO rulesdbo.entity
entity_id, entity_type, entity_name,entity_long_name,legal_name,inception_date,marketing_open_date,
upd_date, upd_user, tax_id_number, fiscal_end_date, base_currency, account_status,
entity_code, orig_source_system, account_legal_form, business_sector, direct_account_ind,
portfolio_type_code, ml_interpolate_yn
VALUES
( v_entity_id, p_entity_type,v_entity_name,substr(p_entity_long_name,1,60),p_entity_legal_name,
to_date(p_inception_date, 'YYYYMMDD'),to_date(p_marketing_open_date, 'YYYYMMDD'),v_date, v_update_source, p_tax_id_number, to_date(p_fiscal_end_date, 'YYYYMMDD'),
p_base_currency, p_account_status, p_entity_code, p_orig_source_system, p_account_legal_form, p_business_sector,
p_direct_account_ind, p_portfolio_type_code, p_ml_interpolate_yn
dbms_output.put_line('ENTITY ID CREATED - ' || v_entity_id);
/*Insert Record into Entity_Detail Table */
b_valid := entityDetail(v_entity_id, p_associated_entity_id, p_entity_type, p_list_order);
end if;
/* Insert/Update CUSTOM_INDEX_ATTRIBUTES if blended benchmark */
if (p_entity_type = v_bb_entity_type) then
b_valid := customIndexAttributes(
v_entity_id,
p_target_dict_name,
p_source_level1,
p_source_entity_xref1,
p_source_entity_xref1_type,
p_source_dict_name1,
p_weight1,
p_source_level2,
p_source_entity_xref2,
p_source_entity_xref2_type,
p_source_dict_name2,
p_weight2,
p_source_level3,
p_source_entity_xref3,
p_source_entity_xref3_type,
p_source_dict_name3,
p_weight3,
p_source_level4,
p_source_entity_xref4,
p_source_entity_xref4_type,
p_source_dict_name4,
p_weight4,
p_source_level5,
p_source_entity_xref5,
p_source_entity_xref5_type,
p_source_dict_name5,
p_weight5,
p_source_level6,
p_source_entity_xref6,
p_source_entity_xref6_type,
p_source_dict_name6,
p_weight6,
p_source_level7,
p_source_entity_xref7,
p_source_entity_xref7_type,
p_source_dict_name7,
p_weight7,
p_source_level8,
p_source_entity_xref8,
p_source_entity_xref8_type,
p_source_dict_name8,
p_weight8,
p_source_level8,
p_source_entity_xref9,
p_source_entity_xref9_type,
p_source_dict_name9,
p_weight9,
p_source_level10,
p_source_entity_xref10,
p_source_entity_xref10_type,
p_source_dict_name10,
p_weight10
end if;
/* Insert/Update Business Groups */
b_valid := setBusinessGroup(v_group_name1, v_entity_id, v_update_source, v_date);
b_valid := setBusinessGroup(v_group_name2, v_entity_id, v_update_source, v_date);
b_valid := setBusinessGroup(v_group_name3, v_entity_id, v_update_source, v_date);
b_valid := setBusinessGroup(v_group_name4, v_entity_id, v_update_source, v_date);
b_valid := setBusinessGroup(v_group_name5, v_entity_id, v_update_source, v_date);
b_valid := setBusinessGroup(v_group_name6, v_entity_id, v_update_source, v_date);
b_valid := setBusinessGroup(v_group_name7, v_entity_id, v_update_source, v_date);
b_valid := setBusinessGroup(v_group_name8, v_entity_id, v_update_source, v_date);
b_valid := setBusinessGroup(v_group_name9, v_entity_id, v_update_source, v_date);
b_valid := setBusinessGroup(v_group_name10, v_entity_id, v_update_source, v_date);
b_valid := setBusinessGroup(v_group_name11, v_entity_id, v_update_source, v_date);
b_valid := setBusinessGroup(v_group_name12, v_entity_id, v_update_source, v_date);
b_valid := setBusinessGroup(v_group_name13, v_entity_id, v_update_source, v_date);
b_valid := setBusinessGroup(v_group_name14, v_entity_id, v_update_source, v_date);
/* Insert/Update entity xref */
b_valid := entity_xref(p_source_acct_id, p_source_system, v_entity_id);
IF NOT b_Valid THEN
dbms_output.put_line('INV ENT XREF 1');
na_outparam(na_outparam.COUNT+1) := EagleGen.GetErrEdit(p_Src => g_prf_intfc,
p_ShortDesc => 'INV ENT XREF');
p_OUT := EagleGen.simf_table_to_varchar(na_outparam);
RETURN;
END IF;
COMMIT;
/* Pass back any warning messages */
p_out := EagleGen.simf_table_to_varchar(na_outparam);
END; -- End of ProcedureThe PLS-00306 error is normally a runtime error. It is telling you that the call to procedure ENTPRFMAN had either too few or too many parameters passed to it or that one or more of the parameters were of the wrong datatype.
HTH -- Mark D Powell -- -
ORA-06520: PL/SQL: Error loading external library
Hi
I am trying to use an external C program from sql using following steps.
copy the dll in dir ORACLE/806/BIN
create or replace library outs as
'e$/ORACLE/806/BIN/SmlCrcChecking.dll'
create or replace FUNCTION plsCheck_File_CRC (fname Varchar2)
return boolean
AS LANGUAGE C
library outs
name "Check_File_CRC";
and call the dll using
select plsCheck_File_CRC('c:\mttest.txt') from dual;
The dll is notc alled the message is
ERROR at line 1:
ORA-06520: PL/SQL: Error loading external library
ORA-06522: Unable to load DLL
Please help
PrashantI am trying to create a Pl/SQL test env using
create or replace procedure file_test
(fname in varchar2,
status out number)
is
begin
If Check_File_CRC (fname) then
status:=0;
else
status:=1;
end if;
end;
However the following errros are displayed
Errors for PROCEDURE FILE_TEST
6/1 PL/SQL: Statement ignored
6/4 PLS-00382: expression is of wrong type
mY TNSNAMES.ORA contains following
additions
EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
(CONNECT_DATA = (SID = PLSExtProc)(PRESENTATION = RO))
extproc_connection_data.world =
(DESCRIPTION =
(ADDRESS =
(PROTOCOL = IPC)
(KEY = extproc))
(CONNECT_DATA =
(SID = extproc)
AND LISTNER.ORA
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = D:\oracle\ora81)
(PROGRAM = extproc)
Message was edited by:
prashant13
Maybe you are looking for
-
Hi, my macBook pro is taking a lot of time ( used to be 10-15 sec now 50 sec ) to boot (while in kernel boot mode). These are my logs after the "BOOT_TIME" message: 10/13/14 12:30:01.000 AM syslogd[19]: Configuration Notice: ASL Module "com.apple.app
-
J2EE Engine doesn't start on ABAP+Java stack Release 700
Hallo Gurus, I am not able to start J2EE engine. We have J2EE 700 with SP10. I have gone through documentation and sdn threads and other possible help but couldn't succeed. Need your help in resolving this issue. Here is output of <u><b>std_boots
-
Adobe Bridge and CS5 open when iPad connected
Why does Adobe Bridge and Downloader open when I connect my iPad? I cannot find in Preferences any way to toggle this off. HJZ Message was edited by: Harry Zemel1
-
Whitespace problem with embedded tables
I have a datastructure with embedded groups. In my RTF template, I am using a table for each of these groups, and embedding them likewise. When I load my data, however, and view it, there is a random, undesirable amount of whitespace between where on
-
ORA-12899 when recreating materialized view
Hi All, I have a PL/SQL procedure to load data in partitioned base tables and a refreh force meterilized view to compute data from base partition table. I just droped the materialized view and try to recreate it. I am facing an issue with Ora-12899 v