Call to StoredProcedure returning ORA-06550
Please tell me what the following means:-
Warning: ociexecute() [function.ociexecute]: OCIStmtExecute: ORA-06550: line 1, column 7: PLS-00905: object BIG.SPPACKAGE is invalid ORA-06550: line 1, column 7: PL/SQL: Statement ignored in C:\Program Files\Apache Group\Apache2\htdocs\Events\OracleGetClientTest.php on line 44
The code around line 44 looks like:-
$SQL = "begin spPackage.spMemberDetails(:p_number, :p_recordset); end;";
$curs = OCINewCursor($conn);
$stmt = OCIParse($conn, $SQL );
if (!$stmt)
trigger_error(sprintf("Cannot parse query for [%s] ", $number), E_USER_ERROR);
die();
OCIBindByName($stmt,":p_number",&$number,15);
OCIBindByName($stmt,":p_recordset",&$curs,10,OCI_B_CURSOR);
$exec = OCIExecute($stmt);
and OCIExecute is Line 44.
I reran as follows and now get:-
SQL> @c:\temp\sppackage-Gerhard.sql;
Package created.
No errors.
Warning: Package Body created with compilation errors.
SQL> select * from all_objects where object_name = 'SPPACKAGE';
OWNER OBJECT_NAME
SUBOBJECT_NAME OBJECT_ID DATA_OBJECT_ID OBJECT_TYPE
CREATED LAST_DDL_ TIMESTAMP STATUS T G S
BIG SPPACKAGE
13676 PACKAGE
17/MAY/07 18/MAY/07 2007-05-18:13:26:16 VALID N N N
BIG SPPACKAGE
13686 PACKAGE BODY
18/MAY/07 18/MAY/07 2007-05-18:13:34:15 INVALID N N N
OWNER OBJECT_NAME
SUBOBJECT_NAME OBJECT_ID DATA_OBJECT_ID OBJECT_TYPE
CREATED LAST_DDL_ TIMESTAMP STATUS T G S
Now its only the body that is invalid, but why?
Similar Messages
-
Calling a storedprocedure returning refcursor of xmltype
Hi,
I'm having issues with stored procedure, returning a refcursor of xmltypes. Most of the examples in the docs(http://docs.oracle.com/html/E10927_01/featXML.htm#i1012109) are always a direct query and I have yet to see one using a stored procedure.
Here's a repro script:
Register an xsd:
BEGIN
dbms_xmlschema.registerschema('http://www.testing.com/person.xsd',
'<?xml version = "1.0" encoding = "utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:element name="person">
<xs:complexType>
<xs:sequence>
<xs:element name="first_name" type="xs:string"/>
<xs:element name="last_name" type="xs:string"/>
<xs:element name="gender">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="male"/>
<xs:enumeration value="female"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>',
LOCAL => FALSE, -- local
GENTYPES => FALSE, -- generate object types
GENBEAN => FALSE, -- no java beans
GENTABLES => TRUE, -- generate object tables
FORCE => FALSE,
options => dbms_xmlschema.register_binaryxml,
OWNER => USER );
END;
--create a array of int type
CREATE OR REPLACE
type int_array_type as table of number;
-- Create the table
CREATE TABLE person
ID NUMBER,
xml_document XMLTYPE
xmltype column xml_document STORE AS BINARY XML XMLSCHEMA "http://www.testing.com/person.xsd" element "person";
-- insert some data
INSERT INTO person (ID, xml_document)
VALUES (1, XMLTYPE ('<?xml version="1.0" encoding="utf-8"?>
<person xsi:noNamespaceSchemaLocation="http://www.testing.com/person.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<first_name>John</first_name>
<last_name>Doe</last_name>
<gender>male</gender>
</person>'));
INSERT INTO person (ID, xml_document)
VALUES (2, XMLTYPE ('<?xml version="1.0" encoding="utf-8"?>
<person xsi:noNamespaceSchemaLocation="http://www.testing.com/person.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<first_name>Jane</first_name>
<last_name>Doe</last_name>
<gender>female</gender>
</person>'));
Create the Package
create or replace
package test_pkg as
TYPE refcursor IS REF CURSOR;
type t_id_array is table of number index by binary_integer;
-- user procs
procedure udp_get_personlist (
p_ids IN t_id_array,
p_resultset out refcursor );
end test_pkg;
create or replace
package body test_pkg as
procedure udp_get_personlist (
p_ids IN t_id_array,
p_resultset out refcursor ) IS
v_int_array_type int_array_type := int_array_type();
begin
FOR i IN 1..p_ids.COUNT LOOP
v_int_array_type.extend(1);
v_int_array_type(i) := p_ids(i);
END LOOP;
OPEN p_resultset FOR
SELECT E.XML_DOCUMENT AS "person" FROM person E
WHERE e.ID IN ( SELECT t.COLUMN_VALUE FROM TABLE ( v_int_array_type ) t );
end udp_get_personlist;
end test_pkg;And here is my ODP.NET code
using (var con = new OracleConnection("<your oracle connection>"))
using (var cmd = con.CreateCommand())
cmd.CommandText = "test_pkg.udp_get_personlist";
cmd.CommandType = CommandType.StoredProcedure;
int[] ids = new int[] { 1, 2 };
OracleParameter param1 = cmd.Parameters.Add("p_ids", OracleDbType.Int32);
OracleParameter param2 = cmd.Parameters.Add("p_resultset", OracleDbType.RefCursor, ParameterDirection.Output);
param1.CollectionType = OracleCollectionType.PLSQLAssociativeArray;
param1.Value = ids;
param1.Size = ids.Length;
param1.ArrayBindSize = new int[] { 4, 4 };
// Setup the ArrayBind Status for param2
param1.ArrayBindStatus = new OracleParameterStatus[1] { OracleParameterStatus.Success }; //, OracleParameterStatus.Success };
try
cmd.XmlQueryProperties.MaxRows = 1;
con.Open();
XmlReader r = cmd.ExecuteXmlReader(); // this always generates invalidoperationexception
// do something with the result
catch (Exception)
throw;
// Close and Dispose OracleConnection object
con.Close();
con.Dispose();
} Server/Tools information:
Oracle is Standard - Oracle Database 11g Release 11.2.0.1.0 running on Windows Server 2003 Std
ODP.NET (ie Oracle.DataAccess.DLL is 4.112.3.0);
Visual Studio 2010 Ultimate SP1
Any pointers in what I'm (obviously doing wrong) is greatly appreciated...
thanks
Edited by: 947266 on Sep 10, 2012 9:46 AMWas able to make it work
using (var con = new OracleConnection("<your oracle connection>"))
using (var cmd = con.CreateCommand())
cmd.CommandText = "test_pkg.udp_get_personlist";
cmd.CommandType = CommandType.StoredProcedure;
int[] ids = new int[] { 1, 2 };
OracleParameter param1 = cmd.Parameters.Add("p_ids", OracleDbType.Int32);
OracleParameter param2 = cmd.Parameters.Add("p_resultset", OracleDbType.RefCursor, ParameterDirection.Output);
param1.CollectionType = OracleCollectionType.PLSQLAssociativeArray;
param1.Value = ids;
param1.Size = ids.Length;
param1.ArrayBindSize = new int[] { 4, 4 };
// Setup the ArrayBind Status for param2
param1.ArrayBindStatus = new OracleParameterStatus[1] { OracleParameterStatus.Success }; //, OracleParameterStatus.Success };
try
cmd.XmlQueryProperties.MaxRows = 1;
con.Open();
int i = cmd.ExecuteNonQuery();
OracleRefCursor curs = (OracleRefCursor)cmd.Parameters["p_resultset"].Value;
OracleDataReader dr = curs.GetDataReader();
while (dr.Read())
Console.WriteLine(dr[0].ToString());
catch (Exception)
throw;
// Close and Dispose OracleConnection object
con.Close();
con.Dispose();
} -
Entity framework-calling stored Proc to return one param returns ORA-6550
Hi There,
I am new to the VS2010/MVC3 game with ODP.net, so no abuse please .......
I have successfully inserted a record into a table via the controller/entity framework, but only by currently hard coding the id. The next logical step is to attempt to obtain the id from the Oracle DB via a stored procedure. Here is the body of the PL/SQL procedure on the Oracle side:-
create or replace package body dotnetcommon as
PROCEDURE getnextpoid ( p_to_id OUT NUMBER ) IS
BEGIN
SELECT pord_seq.nextval INTO p_to_id FROM dual;
END getnextpoid;
end dotnetcommon;
show error
I have then added this procedure to my Entity Framework Model within VS2010 , and from within the Model Browser, I now have a stored procedure of "DOTNETCOMMON_GETNEXTPOID" under my Model.Store. This has an out type parameter named p_to_id, which is a type of number.
I then added a function import, so I have a function by the name of "GETNEXTPOID" under the Function Imports folder, with a collection property of 'None'.
This function has a parameter P_TO_ID with a type of "Decimal".
From within my controller, I have the following code:-
[HttpPost]
public string Create(PURCHASEORDER po)
TasEntities tmprep = new TasEntities();
ObjectParameter poid = new ObjectParameter("poId", typeof(Int16));
var result = tmprep.GETNEXTPOID(poid);
return "Next PO Id is " + result;
Thus, on pressing the Save from my view, i am hoping to return the next logical sequence number into the poid objectparameter. However, I am presented with the following error:-
Inner Exception of:-
{"ORA-06550: line 1, column 8:\nPLS-00306: wrong number or types of arguments in call to 'GETNEXTPOID'\nORA-06550: line 1, column 8:\nPL/SQL: Statement ignored"}
It falls over , taking me to the Model.Designer.cs at :-
public int GETNEXTPOID(ObjectParameter p_TO_ID)
return base.ExecuteFunction("GETNEXTPOID", p_TO_ID);
I am assuming it is to do with the decimal/int/number conversion, but I do not have the nouse to fix it ? Does anybody know what is wrong with what I have attempted to do above ?
Please please get back to me if you need any more information, I am wanting to move on but cannot.
I have seen posts regarding setting the sequence in a before insert trigger on the table, but this is not ideal. Can the above not work instead ?
Many thanks in advance for any help you can provide.
Graeme
Edited by: user4487499 on 05-Apr-2011 08:18I have now raised this in the odp.net forum, as on looking at other posts it seems to be the best place for it.
Cheers,
Graeme
Edited by: user4487499 on 05-Apr-2011 08:18
Edited by: user4487499 on 05-Apr-2011 13:00 -
Ora-06550 returning data from Stored Procedure and Entity Data Model
Hi.
I'm creating an application that uses a WCF Service to return data. I also created a proyect with the EDMX design and mapped most of my DBModel to a classes context. I have added some of the procedures as well. One of them receive some parameters and return a Sys_RefCursor, that is populated according to the parameters.
I have declared the "<add >" tags in the Web.Config and imported the function of the Procedure. When I call the Asyncronous function I get different exceptions:
1. If I call the function, with all of the parameters i get:
Oracle.DataAccess.Client.OracleException: ORA-06550: línea 1, columna 8:
PLS-00306: número o tipos de argumentos erróneos al llamar a
'SP_HECHOSJURITER'
ORA-06550: línea 1, columna 8:
(wrong number or types of arguments in call to 'SP_HECHOSJURITER')
2. If i just set 1 parameter in the SP, returning the same type of data, I get:
Error al recibir la respuesta HTTP a
http://localhost/Procalculo.CGFM.SIGOC.DatosServices/ServiceDatos.svc.
(failed to receive http response. error 12152)
3. If I don't set any parameters in the procedure, it works fine, and return correct data.
It exclusively happen with one entity.
Any clue?
I appreciate any help.When you return result sets from stored procedures to Entity Framework, you are very likely using implicit result sets. Implicit result sets don't need to be declared as a parameter in code, only in the <add> tags to define the metadata in the .NET config file.
For example, in the EF Oracle By Example, you'll see that the stored procedure in the function import has three parameters, but only two are declared in the code. The third one was defined in the config file.
http://download.oracle.com/oll/obe/EntityFrameworkOBE/EntityFrameworkOBE.htm -
Call a storedprocedure with CLOB input parameter gives ORA-24811 error
Hi all,
I am calling a storedprocedure from VB using ADO and OraOLEDB. Calling stored procedure as mention in OraOLED documentation.
The procedure accepts a varchar and a CLOB parameter.
While executing the store procedure its throw an error as Error while trying to retrieve text for error ORA-24811
Then I executed a storeprocedure with only one CLOB out parameter. It is working fine.
Oracle version is
Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64bit Production
PL/SQL Release 9.2.0.4.0 - Production
CORE 9.2.0.3.0 Production
TNS for Linux IA64: Version 9.2.0.4.0 - Production
NLSRTL Version 9.2.0.4.0 - Production
O/S: Linux.
OLEDB version 9.0.1.0.1
But exact code working with
Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
PL/SQL Release 9.2.0.1.0 - Production
CORE 9.2.0.1.0 Production
TNS for 32-bit Windows: Version 9.2.0.1.0 - Production
NLSRTL Version 9.2.0.1.0 Production
O/S window 2003
OLEDB version 9.0.1.0.1
Can somebody help me on this?
Regards,
Mani
Sample code of stored of stored procedure and VB function pasted below.
StoreProcedure
============
create or replace procedure xmltext (EmpName varchar2,EmpDetails CLOB)
as
begin
insert into emptmp values (EmpName);
end;
VB function
=========
Dim Oracon As New ADODB.Connection
Dim cmd As New ADODB.Command
Dim param1 As New ADODB.Parameter
Dim param2 As New ADODB.Parameter
Dim empname As String
Dim empdetails As String
Set Oracon = CreateObject("ADODB.Connection")
Oracon.ConnectionString = "Provider=OraOLEDB.Oracle;Data Source=testdb;User ID=newtest;Password= newtest;PLSQLRSet=1;SPPrmsLOB=1"
Oracon.Open
empname = "Mani"
empdetails = "<EmpDet/>"
Set cmd.ActiveConnection = Oracon
cmd.CommandType = adCmdText
Set param1 = cmd.CreateParameter("param1", adVarChar, adParamOutput, 10, empname)
cmd.Parameters.Append param1
Set param2 = cmd.CreateParameter("param2", adLongVarChar, adParamInput, 10000, empdetails)
cmd.Parameters.Append param2
cmd.CommandText = "{ call xmlText(?,?)}"
cmd.Executecode for my procedure testblob is :
create or replace procedure testblob(bpic blob) as
val blob;
v_rdata blob;
v_start BINARY_INTEGER := 1;
v_buffer BINARY_INTEGER := 32767;
BEGIN
select pic into val from my_pic where no=1 for update;
DBMS_LOB.OPEN (val, DBMS_LOB.LOB_READWRITE);
FOR i IN 1..CEIL(DBMS_LOB.GETLENGTH(bpic) / v_buffer)
LOOP
v_rdata :=DBMS_LOB.SUBSTR(bpic, v_buffer, v_start) ;
DBMS_LOB.WRITEAPPEND(val, DBMS_LOB.GETLENGTH(v_rdata), v_rdata);
v_start := v_start + v_buffer;
END LOOP;
dbms_lob.close(val);
exception
when others then
raise_application_error(-20000,sqlerrm);
end; -
Issue with proc-ora-06550 wrong number or types of arguments in call to
Hi....
When i am running the flollwing procedure as
SQL> exec Prc_WA_Default_Currt_flag(15445);
the following error is thrown.......could someone help me and please let me know how this can be corrected.
BEGIN Prc_WA_Default_Currt_flag(15445); END;
ERROR at line 1:
ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to
'PRC_WA_DEFAULT_CURRT_FLAG'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
***proc code****
CREATE OR REPLACE procedure Prc_WA_Default_Currt_flag(Instance_Id_Upd_in in number,dummy1 out number) as
Instance_Id_Upd1 number;
dummy2 number;
cursor c1 is select rwid from wa_temp_default;
begin
Instance_Id_Upd1:=Instance_Id_Upd_in;
for i in c1 loop
update default_event_log set current_flag=null,Instance_id_upd=Instance_Id_Upd1
where rowid =i.rwid and load_date<(select currLoadtime from wa_batch where
jobname='Default_event_log') and current_flag='Y';
end loop;
commit;
for i in c1 loop
update default_event_log set current_flag='Y'
where load_date>=(select currLoadtime from wa_batch where
jobname='Default_event_log') and rowid=i.rwid;
end loop;
commit;
select to_number(Instance_Id_Upd1) into dummy1 from dual;
end;
/Hi,
Since it contains an out parameter it has to run this way
declare
dummy_out number;
begin
prc_wa_default_currt_flag(15445,dummy_out);
end;Regards
Anurag -
TABLE FUNCTION call - cast - InvalidType ORA-06550
hello, I keep getting the following exception: +"... PL/SQL: ORA-00902: invalid datatype ORA-06550: line 7, column 1: ..."+
I created type here:
CREATE OR REPLACE PACKAGE types
AS
TYPE TmpHiearchyMapTableType IS TABLE OF TMP_HIERARCHYMAP%ROWTYPE INDEX BY BINARY_INTEGER;
END;
Then my TABLE FUNCTION resembles...
CREATE OR REPLACE FUNCTION spGetParentsTable
ObjectId number,
ObjectClassifier varchar2
RETURN types.TmpHiearchyMapTableType
IS
TmpHierarchyMap types.TmpHiearchyMapTableType;
BEGIN
RETURN TmpHierarchyMap;
END;
I tried to invoke the table function and loop through it by:
DECLARE
oMappingTable types.TmpHiearchyMapTableType;
BEGIN
-- This OKAY!
oMappingTable := spGetParentsTable(2,'ThinkFundamentals.Util.Security.SystemUser');
-- FAILED here! "Invalid Type"!?!
select * from table(cast(oMappingtable as types.TmpHiearchyMapTableType));
dbms_output.put_line('done!');
END;
Thanks!
REF: http://www.databasejournal.com/features/oracle/article.php/3352091/CASTing-About-For-a-Solution-Using-CAST-and-Table-Functions-in-PLSQL.htmhello I managed to switched from "Associate Array" to "Nested table" but still having trouble SELECT * FROM table(...), it keep saying "Invalid DataType" - detail as follows:
-- NOTE 1: Here's how I create the object type (Be nice if I can just say "CREATE OR REPLACE TYPE TmpHierarchyMapObjType AS OBJECT (TMP_HIERACHICAL.ROWTYPE)" instead of having to duplicate column definition.
CREATE OR REPLACE TYPE TmpHierarchyMapObjType AS OBJECT
Id numeric(19,0) ,
ParentId numeric(19,0),
ChildId numeric(19,0),
TmpUID varchar2(32),
ReferencedId numeric(19,0),
-- NOTE 2: I can't put "TmpHierarchyMapObjType" inside the package but that's not crucial I suppose.
CREATE OR REPLACE PACKAGE types
AS
TYPE cursorType IS REF CURSOR;
TYPE TmpHiearchyMapTableType IS TABLE OF TmpHierarchyMapObjType; /* Use "Nested Table" instead of Associative Array */
/* TYPE TmpHiearchyMapTableType IS TABLE OF TMP_HIERARCHYMAP%ROWTYPE INDEX BY BINARY_INTEGER; */
END;
-- NOTE 3: Here's my TABLE FUNCTION which now returns a "Nested Table" as supposed to "Associative Array" (with different enumeration syntax)
CREATE OR REPLACE FUNCTION spGetParentsTable
ObjectId number,
ObjectClassifier varchar2
RETURN ty[es.TmpHiearchyMapTableType -- Now an "Nested Table", not "Associative Array"
IS
TmpHierarchyMap types.TmpHiearchyMapTableType;
ThisTempId varchar2(32);
CURSOR spGetParents_cursor IS
SELECT
ReferencedId Id,
ParentId,
ChildId,
FROM TMP_HIERARCHYMAP
WHERE TmpUID = ThisTempId;
BEGIN
SELECT sys_guid() INTO ThisTempId FROM dual;
spRecursiveGetParents(ObjectId, ObjectClassifier, ThisTempId);
-- (Commented out) TmpHierarchyMapMAX := 0;
FOR oMap in spGetParents_cursor LOOP
-- (Commented out) TmpHierarchyMapMAX := TmpHierarchyMapMAX + 1;
_TmpHierarchyMap.Extend();
TmpHierarchyMap(TmpHierarchyMap.Count) := TmpHierarchyMapObjType( oMap.Id
, oMap.ParentId
, oMap.ChildId
NOTE: *(Commented out)* Not using "Associative Array", now using "Nested table" instead.
TmpHierarchyMap(TmpHierarchyMapMAX).Id := oMap.Id;
TmpHierarchyMap(TmpHierarchyMapMAX).ParentId := oMap.ParentId;
TmpHierarchyMap(TmpHierarchyMapMAX).ChildId := oMap.ChildId;
END LOOP;
DELETE FROM TMP_HIERARCHYMAP WHERE TmpUID = ThisTempId;
RETURN TmpHierarchyMap;
END spGetParentsTable;
*-- Lastly, I want to enumerate nested table.*
DECLARE
oMappingTable types.TmpHiearchyMapTableType;
BEGIN
oMappingTable := spGetParentsTable(2,'ThinkFundamentals.Util.Security.SystemUser');
*-- NOTE 4: This is my end-goal! But still complaining "ORA-00902: invalid datatype"*
select * from table(cast(oMappingtable as types.TmpHiearchyMapTableType));
dbms_output.put_line('done!');
END;
*REF:*
http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14261/collections.htm#LNPLS005
http://www.devshed.com/c/a/Oracle/Associative-Arrays-in-Oracle-PLSQL-Introduction/2/
http://www.devshed.com/c/a/Oracle/Database-Interaction-with-PLSQL-Nested-Tables/2/ -
PLS-00306: wrong number or types of arguments in call to 'P_MAIN' ORA-06550
I have 2 environments: a development environment and a production environment. Both have the same package.
Calling the package from APEX in the production environment it gives a error:PLS-00306: wrong number or types of arguments in call to 'P_MAIN' ORA-06550.but the data is stille be saved.
But calling the package in development environment nothing happened.
What can be the problem???
regards,
ekasThat's not what he asked: is it possible that a package with the same name exists in another schema on the production server - also is it possible that an synonym for the package exists in the production server which doesn't exist in the development? =>All synonym that exist in the production database also exist in the developmenst database.
Also, you haven't provided details of how you performed these tests to establish that one works where the other doesn't. Are you testing the package within the context of an apex application or have you isolated any test case to the PL/SQL code only - could you run a test of the package within something like SQL*Plus (or your favourite IDE)? Are you feeding in identical test data? Indeed, do you have a unit test script which you can run on both development and production?
=> I have test the package in the content of a apex application, and the data in the production enviroment is not the same as in the developement enviroment due to real data in production. -
Please Help, Error:ORA-06550
I am calling a stored procedure in a package LDAP_AUTH ,this SP will take 3 input arguments which are varchar2.when I am calling the SP I am getting error.The SP is running fine in SQL * Plus. Pls help me on this.Pls mail me at [email protected]
I used cmd.ExecuteNonQuery() i am getting the following error.
ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'LOGIN'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
************ Procedure Code Start *****************
procedure login(p_user_id in varchar2, p_password in varchar2, p_client_identifier in Varchar2)
as
retval PLS_INTEGER;
ldap_host varchar2(255):=get_host;
ldap_port number:=get_port;
user_id varchar2(100):=p_user_id;
password varchar2(255) := p_password;
base_dn cmm_preference_map_entry.preference_value_1%type := get_base_dn;
username_filter cmm_preference_map_entry.preference_value_1%type := replace(get_ldap_username_filter,'%u',user_id);
group_filter cmm_preference_map_entry.preference_value_1%type := get_ldap_group_member_filter;
my_session DBMS_LDAP.session;
res_message DBMS_LDAP.MESSAGE;
res_attrs DBMS_LDAP.STRING_COLLECTION;
temp_dn VARCHAR2(512);
temp_entry DBMS_LDAP.MESSAGE;
entry_index PLS_INTEGER;
v_string_table v_string_table_ty;
i number:=1;
m number:=1;
v_user_session_id number;
pragma autonomous_transaction;
begin
DBMS_LDAP.USE_EXCEPTION := TRUE;
retval := -1;
-- Initialize the LDAP session
my_session := DBMS_LDAP.init(ldap_host,ldap_port);
--Authenticate to the directory
--retval :=DBMS_LDAP.simple_bind_s(my_session, 'uid=wayyen,ou=people,o=Enterprise Company,dc=smartchain','wayyen');
retval :=DBMS_LDAP.simple_bind_s(my_session, '','');
--res_attrs(1):='cn';
retval := DBMS_LDAP.SEARCH_S(
ld => my_session
, base => base_dn
, scope => DBMS_LDAP.SCOPE_SUBTREE
, filter => username_filter
, attrs => res_attrs
, attronly => 0
, res => res_message
temp_entry := DBMS_LDAP.FIRST_ENTRY(my_session, res_message);
temp_dn := DBMS_LDAP.GET_DN(my_session, temp_entry);
-- dbms_output.put_line('User DN: '||temp_dn);
retval :=DBMS_LDAP.simple_bind_s(my_session, TEMP_DN, p_password);
res_attrs.delete;
res_attrs(1):='*';
retval := DBMS_LDAP.SEARCH_S(
ld => my_session
, base => base_dn
, scope => DBMS_LDAP.SCOPE_SUBTREE
, filter => replace(get_ldap_group_member_filter,'%M',temp_dn)
, attrs => res_attrs
, attronly => 0
, res => res_message
-- retval := DBMS_LDAP.COUNT_ENTRIES(my_session, res_message);
-- DBMS_OUTPUT.PUT_LINE(
-- RPAD('Number of Entries ', 25, ' ') || ': ' || TO_CHAR(retval)
temp_entry := DBMS_LDAP.FIRST_ENTRY(my_session, res_message);
entry_index := 1;
while temp_entry is not null
loop
-- dbms_output.put_line('***Group DN**** '||DBMS_LDAP.get_dn(my_session, temp_entry));
v_string_table(i):=DBMS_LDAP.get_dn(my_session, temp_entry);
i := i + 1;
temp_entry := DBMS_LDAP.NEXT_ENTRY(my_session, temp_entry);
-- DBMS_OUTPUT.PUT_LINE('===================================================');
entry_index := entry_index + 1;
END LOOP;
create_user_session(p_user_id, v_string_table, v_user_session_id);
ldap_ctx_pkg.set_session_id(v_user_session_id, p_client_identifier);
dbms_output.put_line('user_session_id: '||v_user_session_id);
commit;
retval := DBMS_LDAP.UNBIND_S(my_session);
end login;
************ Procedure Code End*****************
Web.config
<appSettings>
<!--<add key="BaseURLSite" value="http://localhost/SaviReportsWebSite"/>
<add key="DataSource" value="SRIRAMA-D620"/>
<add key="UID" value="sa"/>
<add key="PWD" value="satyam"/>
<add key="DatabaseName" value="Employee"/>-->
<add key="BaseURLSite" value="http://localhost/SaviReportsWebSite"/>
<add key="UID" value="rpt$928$syn"/>
<add key="PWD" value="rpt$928$syn"/>
<add key="Data Source" value="AURORA"/>
<add key="ReportService2005WebService.ReportService2005" value="http://localhost/ReportServer/ReportService2005.asmx"/>
</appSettings>
Public Function check_Login(ByVal strLoginIDDesc As String, ByVal strPasswordDesc As String, ByVal strSessionIDDesc As String) As Boolean
Dim strSQL As String
'Dim dsHomePage As DataSet
Dim OracleParam(2) As OracleParameter
Dim blnStatus As Boolean = False
Dim gStrConnection As String = Nothing
gStrConnection = "Persist Security Info=False;"
gStrConnection += "Integrated Security=False;"
gStrConnection += "User ID=" + ConfigurationManager.AppSettings("UID") + ";"
gStrConnection += "pwd=" + ConfigurationManager.AppSettings("PWD") + ";"
gStrConnection += "Data Source=" + ConfigurationManager.AppSettings("Data Source")
Dim OracleConnection1 As New OracleConnection(gStrConnection)
Dim cmd As New OracleCommand
Dim rowsAffected As Integer
Dim index As Integer
cmd.CommandText = "ldap_auth.login"
cmd.CommandType = CommandType.StoredProcedure
cmd.Connection = OracleConnection1
OracleConnection1.Open()
OracleParam(0) = New OracleParameter("LoginIDDesc", OracleType.LongVarChar)
OracleParam(0).Direction = ParameterDirection.Input
OracleParam(0).Value = strLoginIDDesc
OracleParam(1) = New OracleParameter("PasswordDesc", OracleType.LongVarChar)
OracleParam(1).Direction = ParameterDirection.Input
OracleParam(1).Value = strPasswordDesc
OracleParam(2) = New OracleParameter("SessionIDDesc", OracleType.LongVarChar)
OracleParam(2).Direction = ParameterDirection.Input
OracleParam(2).Value = strSessionIDDesc
Dim UBound As Integer = OracleParam.Length
For index = 0 To UBound - 1
cmd.Parameters.Add(OracleParam(index))
Next
rowsAffected = cmd.ExecuteNonQuery()
OracleConnection1.Close()
If rowsAffected = -1 Then
blnStatus = True
End If
Return blnStatus
End Function
Regards,
SriRam.alter table tableName drop constraint constraintName ;
You cannot drop an index being used to enforce uniqueness. You must drop the constraint - which will also drop the index. You also cannot drop a unique constraint being used as a reference of a foreign key. Adding the keyword CASCADE will allow you to get around that, but it will destroy the FK references.
alter table tableName drop constraint constraintName CASCADE ; -
ORA-06550: line1,column7: PLS-00306: wrong number or types of arguments
Hello All,
I am getting this error:
ORA-06550: line 1, column 7: PLS-00306: wrong number or types of arguments in call to 'GETCURRENCYFROMSCENARIO' ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
Can anybody help me with this error that I am getting on VB.net: Any responses will be very helpful
ORA-06550: line 1, column 7: PLS-00306: wrong number or types of arguments in call to 'GETCURRENCYFROMSCENARIO' ORA-06550: line 1, column
7: PL/SQL: Statement ignored
The Function written in VB.net that is calling the PLSQL function is pasted below:
Public Function GetCurrencyFromScenario(ByVal DataSetType As String, ByVal DataSetName As String, ByVal CurrType As String)
Dim returnValue As String
Dim db As OracleDbHelper = GetHelper()
Dim params As New List(Of OracleParameter)
params.Add(OracleParameterFactory.CreateIn("asUserName", OracleDbType.Varchar2, _props.CurrentUser))
'params.Add(OracleParameterFactory.CreateOut("psError", OracleDbType.Varchar2, 2000))
params.Add(OracleParameterFactory.CreateIn("asDatasetName", OracleDbType.Varchar2, DataSetName))
params.Add(OracleParameterFactory.CreateIn("asDatasetType", OracleDbType.Varchar2, DataSetType))
params.Add(OracleParameterFactory.CreateIn("asCurrType", OracleDbType.Varchar2, CurrType))
params.Add(OracleParameterFactory.CreateOut("asCurrency", OracleDbType.Varchar2))
db.ExecSql_ReaderDataTable(ProcedureName(FPAGET, "GetCurrencyFromScenario"), CommandType.StoredProcedure, params)
End Function
The PL SQL code that contains the function is called as below:
Procedure GetCurrencyFromScenario (
asUserName varchar2,
DataSetType varchar2,
DataSetName varchar2,
CurrType varchar2,
asCurrency out fpa_operating_variable.value_text%type) is
begin
asCurrency := 'EUR';
return;
end;I wasnt posting duplicates. I posted the first time on PL SQL forum, but was guided to post it on ODP.net as it is more of related to VB.net. Hence I reposted it there.
Moderator: can you lock this thread if you want and activate the other thread?
As mentioned, I flipped the two variables and 'asDatasetName' and 'asDatasetType' and tried it. But is still failed.
Regarding the "fpa_operating_variable.value_text ", yes it is a varchar2. I rechecked the same.
Thanks for all the help in responding. -
Error ORA-06550, PLS-00103 in procedure launched by php page
Hi,
I have written a php page that calls a pl/sql procedure. When I launch the procedure (through the php) I receive this error
Warning: ociexecute(): OCIStmtExecute: ORA-06550: line 1, column 101: PLS-00103: Encountered the symbol "" when expecting one of the following: ( - + case mod new not null others <an identifier> <a double-quoted delimited-identifier> <a bind variable> avg count current exists max min prior sql stddev sum variance execute forall merge time timestamp interval date <a string literal with character set specification> <a number> <a single-quoted SQL string> pipe <an alternatively-quoted string literal with character set specifi in /web/findb/php/fin/SPR/nuoveEmissioni/nuoveEmissioni.class.php on line 918
bool(false) The php code that calls the procedure is the following:
$query = " declare retU number; begin ";
$query .= " retU := pkg_schedapr.UPDATE_SPR_STATUS( :isinU, :utente, :emissione_f,
:azione_f, :fondo_f, :emittenteU_f, :rischioU_f, :varU_f,
:formulaU_f, :profiloU_f); ";
$query .= ":retU_val := retU; ";
$query .= "end;";
$stmtUpdate = ociparse ($this->conn,$query);
if (!$stmtUpdate) die (var_dump(OCIError()));
ociBindByName($stmtUpdate, ":isinU", $isin_t, 12);
ociBindByName($stmtUpdate, ":utente", $userName, 20);
ociBindByName($stmtUpdate, ":emissione_f", $mod_bond, 1);
ociBindByName($stmtUpdate, ":azione_f", $mod_azione, 1);
ociBindByName($stmtUpdate, ":fondo_f", $mod_fondo, 1);
ociBindByName($stmtUpdate, ":emittenteU_f", $mod_emittente, 1);
ociBindByName($stmtUpdate, ":rischioU_f", $mod_rischio, 1);
ociBindByName($stmtUpdate, ":varU_f", $mod_var, 1);
ociBindByName($stmtUpdate, ":formulaU_f", $mod_formula, 1);
ociBindByName($stmtUpdate, ":profiloU_f", $mod_profilo, 1);
ociBindByName($stmtUpdate, ":retU_val", $retU_val, 1);
$err=OCIExecute($stmtUpdate);
if (!$err) die (var_dump(OCIError()));
ocifreestatement($stmtUpdate); The pl/sql procedure is the following:
function UPDATE_SPR_STATUS(isin_p in varchar2, utente in varchar2, mercato in varchar2,
emissione_p in number, azione_p in number, fondo_p in number, emittente_p in number,
rischio_p in number, var_p in number, formula_p in number, mercato_p in number,
profilo_p in number) return number
is
control number;
modificato number;
SQL_QUERY VARCHAR2(4000);
TYPE MOD_SUM IS REF CURSOR;
SUMM MOD_SUM;
TYPE MOD_SUM_ROW
IS RECORD(
EMISSIONE VARCHAR2(1),
AZIONE VARCHAR2(1),
FONDO VARCHAR2(1),
EMITTENTE VARCHAR2(1),
RISCHIO VARCHAR2(1),
VAR VARCHAR2(1),
FORMULA VARCHAR2(1),
PROFILO VARCHAR2(1)
MODIFICHE MOD_SUM_ROW;
EMS VARCHAR2(1);
AZI VARCHAR2(1);
FON VARCHAR2(1);
EMT VARCHAR2(1);
RSK VARCHAR2(1);
VAR VARCHAR2(1);
FRM VARCHAR2(1);
PRF VARCHAR2(1);
MKT VARCHAR(1);
begin
modificato := emissione_p + azione_p + fondo_p + emittente_p + rischio_p
+ var_p + formula_p + mercato_p + profilo_p;
select count(*)
into control
from spr_web_nuove_emissioni a
where a.ISIN=isin_p
AND A.END_DATE IS NULL;
if control > 0
then
update spr_web_nuove_emissioni a
set a.END_DATE=sysdate
where a.ISIN=isin_p
AND A.END_DATE IS NULL;
SQL_QUERY := 'SELECT A.EMISSIONE, A.AZIONE, A.FONDO, A.EMITTENTE,
A.RISCHIO, A.VAR, A.FORMULA,
A.PROFILO
FROM SPR_WEB_NUOVE_EMISSIONI A
WHERE A.ISIN='''||isin_p||' AND A.END_DATE=TRUNC(SYSDATE)';
OPEN SUMM FOR SQL_QUERY;
LOOP
FETCH SUMM INTO MODIFICHE;
EXIT WHEN SUMM%NOTFOUND;
if emissione_p < 1 THEN
EMS := MODIFICHE.EMISSIONE;
ELSE
EMS := 'Y';
end if;
if azione_p < 1 THEN
AZI := MODIFICHE.AZIONE;
ELSE
AZI := 'Y';
end if;
if fondo_p < 1 THEN
FON := MODIFICHE.FONDO;
ELSE
FON := 'Y';
end if;
if emittente_p < 1 THEN
EMT := MODIFICHE.EMITTENTE;
ELSE
EMT := 'Y';
end if;
if rischio_p < 1 THEN
RSK := MODIFICHE.RISCHIO;
ELSE
RSK := 'Y';
end if;
if var_p < 1 THEN
VAR := MODIFICHE.VAR;
ELSE
VAR := 'Y';
end if;
if formula_p < 1 THEN
FRM := MODIFICHE.FORMULA;
ELSE
FRM := 'Y';
end if;
if profilo_p < 1 THEN
PRF := MODIFICHE.PROFILO;
ELSE
PRF := 'Y';
end if;
END LOOP;
CLOSE SUMM;
ELSE
if emissione_p < 1 THEN
EMS := 'N';
ELSE
EMS := 'Y';
end if;
if azione_p < 1 THEN
AZI := 'N';
ELSE
AZI := 'Y';
end if;
if fondo_p < 1 THEN
FON := 'N';
ELSE
FON := 'Y';
end if;
if emittente_p < 1 THEN
EMT := 'N';
ELSE
EMT := 'Y';
end if;
if rischio_p < 1 THEN
RSK := 'N';
ELSE
RSK := 'Y';
end if;
if var_p < 1 THEN
VAR := 'N';
ELSE
VAR := 'Y';
end if;
if formula_p < 1 THEN
FRM := 'N';
ELSE
FRM := 'Y';
end if;
if profilo_p < 1 THEN
PRF := 'N';
ELSE
PRF := 'Y';
end if;
end if;
insert into spr_web_nuove_emissioni
values (isin_p, sysdate, utente, EMS, AZI, FON, EMT,
RSK, VAR, FRM, PRF,
SYSDATE, NULL);
begin
update spr_status a
set a.VALIDATED='Y'
where a.ISIN=isin_p
AND A.MARKET=mercato;
if modificato > 0
then
update spr_status a
set a.USER_CHANGE='Y', a.USER_LAST_MODIFIED=sysdate
where a.ISIN=isin_p and a.MARKET=mercato;
end if;
exception
when others then
dbms_output.put_line('ERROR in <PKG_SCHEDAPR.UPDATE_SPR_STATUS> Aggiornamento stato ' ||SQLCODE||'-'||SQLERRM);
return 1;
end;
commit;
return 0;
end UPDATE_SPR_STATUS;I do not succed to understand the error I receive, why? Where is the error?
Can someone help me?
Thanks, bye bye.Hi,
I have changed the php code in this way:
$query = " declare retU number; begin ";
$query .= " retU := pkg_schedapr.UPDATE_SPR_STATUS(:isinU, :utente, :emissione_f, ";
$query .= ":azione_f, :fondo_f, :emittenteU_f, :rischioU_f, :varU_f, ";
$query .= ":formulaU_f, :profiloU_f); ";
$query .= ":retU_val := retU; ";
$query .= "end;";
$stmtUpdate = ociparse ($this->conn,$query);
if (!$stmtUpdate) die (var_dump(OCIError()));
ociBindByName($stmtUpdate, ":isinU", $isin_t, 12);
ociBindByName($stmtUpdate, ":utente", $userName, 20);
ociBindByName($stmtUpdate, ":emissione_f", $mod_bond, 1);
ociBindByName($stmtUpdate, ":azione_f", $mod_azione, 1);
ociBindByName($stmtUpdate, ":fondo_f", $mod_fondo, 1);
ociBindByName($stmtUpdate, ":emittenteU_f", $mod_emittente, 1);
ociBindByName($stmtUpdate, ":rischioU_f", $mod_rischio, 1);
ociBindByName($stmtUpdate, ":varU_f", $mod_var, 1);
ociBindByName($stmtUpdate, ":formulaU_f", $mod_formula, 1);
ociBindByName($stmtUpdate, ":profiloU_f", $mod_profilo, 1);
ociBindByName($stmtUpdate, ":retU_val", $retU_val, 1);
echo "$isin_t--";echo "$userName--"; echo"$mod_bond--";
echo "$mod_azione--";echo "$mod_fondo--"; echo"$mod_emittente--";
echo "$mod_rischio--";echo "$mod_var--"; echo"$mod_formula--";
echo "$mod_profilo--";echo "$retU_val";
echo "$query";
$err=OCIExecute($stmtUpdate);
if (!$err) die (var_dump(OCIError()));
ocifreestatement($stmtUpdate); and now I receive this error:
Warning: ociexecute(): OCIStmtExecute: ORA-01756: quoted string not properly terminated ORA-06512: at "FIN.PKG_SCHEDAPR", line 6420 ORA-06512: at line 1 in /web/findb/php/fin/SPR/nuoveEmissioni/nuoveEmissioni.class.php on line 918
bool(false) But I do not understand the cause of the error.
How can I solve?
Thanks, bye bye. -
Calling stored procedure returning result set
Hi all,
i know this issue is discussed quite often. I did not find an answer in the forums, not in the manual and even not in the examples for stored procedure.
So i try it here once more :)
Description:
GET_SKS:
The GET_SKS procedure is used to generate a number of surrogate keys. It has one input parameter NUM_SKS_IN that specifies the number of keys to generate. The generated keys are returned as a result set.
So i tried:
CallableStatemant sproc_stmt = lsession.connection().prepareCall("{ call Get_SKS(?,?)}");
sproc_stmt.setInt(2,1);
sproc_stmt.registerOutParameter(1,OracleTypes.CURSOR);
sproc_stmt.execute();
ResultSet sproc_result = (ResultSet) sproc_stmt.getObject(1);
I got the exception:
java.sql.SQLException: ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'GET_SKS'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
Thanks for help! This is really getting frustrating...
Regards,
akHi there,
i could speak to our one of our admins. This is what he gave me:
CREATE OR REPLACE PROCEDURE "TCSDBOWNER"."GET_SKS"
(num_sks_in IN INTEGER,
sk_out OUT SYS_INFO.SYS_INFO_SK%TYPE)
AS
/*+
|| Procedure - GET_SKS - Oracle
||
|| Description:
|| This procedure is used to get one or more primary keys for tables with
|| surrogate keys as the primary key. This number is unique across all
|| tables and installations for a given client.
||
|| Parameters:
|| num_sks_in - INTEGER: number of surrogate keys to return
|| sk_out - sk_subtype: first key in the sequence of requested keys
||
|| History:
|| 08/30/01,dcs: Created
CURSOR request_cur IS
select DBMS_LOCK.REQUEST(170333184) from dual;
CURSOR release_cur IS
select DBMS_LOCK.RELEASE(170333184) from dual;
CURSOR dual_sk_cur IS
select SEQ_SK.NEXTVAL SK
from DUAL;
v_base_offset SYS_INFO.BASE_OFFSET%TYPE;
v_sk SYS_INFO.SYS_INFO_SK%TYPE;
v_sqlstring VARCHAR2(1000);
v_cursor_handle INTEGER;
v_return INTEGER;
BEGIN
IF num_sks_in < 1 THEN
TCS_EXC.RAISE_ERROR(TCS_EXC.num_sks_in_lt_1);
END IF;
OPEN request_cur;
FETCH request_cur INTO v_return;
CLOSE request_cur;
IF v_return <> 0 AND v_return <> 4 THEN
TCS_EXC.RAISE_ERROR(TCS_EXC.sk_gen_lock_failed);
END IF;
v_cursor_handle := DBMS_SQL.OPEN_CURSOR;
v_sqlstring := 'ALTER SEQUENCE SEQ_SK INCREMENT BY '|| TO_CHAR(num_sks_in);
DBMS_SQL.PARSE(v_cursor_handle, v_sqlstring, DBMS_SQL.V7);
v_return := DBMS_SQL.EXECUTE(v_cursor_handle);
DBMS_SQL.CLOSE_CURSOR(v_cursor_handle);
GET_BASE_OFFSET(v_base_offset);
OPEN dual_sk_cur;
FETCH dual_sk_cur INTO v_sk;
CLOSE dual_sk_cur;
sk_out := (v_base_offset * 10000000000) + v_sk - num_sks_in + 1;
v_cursor_handle := DBMS_SQL.OPEN_CURSOR;
v_sqlstring := 'ALTER SEQUENCE SEQ_SK INCREMENT BY 1';
DBMS_SQL.PARSE(v_cursor_handle, v_sqlstring, DBMS_SQL.V7);
v_return := DBMS_SQL.EXECUTE(v_cursor_handle);
DBMS_SQL.CLOSE_CURSOR(v_cursor_handle);
OPEN release_cur;
FETCH release_cur INTO v_return;
CLOSE release_cur;
IF v_return <> 0 THEN
TCS_EXC.RAISE_ERROR(TCS_EXC.sk_gen_lock_failed);
END IF;
END GET_SKS; Ok, i tried with that but even not succeded yet. Can anybody help me to code that into a java call?
Regards,
ak -
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 -- -
Call stored function return array
Hi all,
I have a function as follow:
create or replace TYPE string_table IS TABLE OF VARCHAR2(2000);
create or replace TYPE ARRAYTYPE is VARRAY(20) OF VARCHAR2(30);
create or replace FUNCTION getEmpArray(s varchar2, t varchar2, st string_table) RETURN ARRAYTYPE AS
l_data ARRAYTYPE := ARRAYTYPE();
BEGIN
l_data.extend; l_data(l_data.count) := s; l_data.extend; l_data(l_data.count) := t; l_data.extend; l_data(l_data.count) := st(1); RETURN l_data;
END;
I want to call this function by StoredFunctionCall
code:
StoredFunctionCall fun = new StoredFunctionCall();
fun.setProcedureName("getEmpArray".toUpperCase());
Object[] arr = new Object[]{"aa", "fgfg", "bbb"};
ArrayDescriptor arrDescriptor =
ArrayDescriptor.createDescriptor("string_table".toUpperCase(),
connection);
ARRAY arrayToPass = new ARRAY(arrDescriptor, connection, arr);
fun.addUnamedArgumentValue("a");
fun.addUnamedArgumentValue("b");
fun.addUnamedArgumentValue(arrayToPass);
fun.setResult("FUNCTION_RESULT"); // for get result by this name
Vector<DatabaseRecord> list = session.executeSelectingCall(fun);
But Exception
PLS-00382: expression is of wrong type
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
Error Code: 6550
Call: BEGIN ? := GETEMPARRAY(?, ?, ?); END;
bind => [=> FUNCTION_RESULT, a, b, oracle.sql.ARRAY@21fbc01]
Please help me
Edited by: fbg on 21:52 26-04-2010A few issues,
1 - JDBC does not support the PLSQL TABLE type, you must use a VARRAY type, or wrap the TABLE function call in a function that takes a VARRAY.
TopLink also has support for PLSQL types in its PLSQLStoredProcedureCall class, but no support is currently offered for StoredFunctions.
You can't pass the VARRAY type for the TABLE argument.
2 - Your function returns a VARRAY, so you need to define this type in the StoredFunctionCall result.
We don't currently expose the API to set a Array type for the result, so you would need to access the call's first parameter directly, or use a StoredProcedureCall (and convert your function to a procedure).
You may also wish to investigate returning a cursor from a stored procedure instead of the varray.
You could also access the JDBC connection directly and perform the call using JDBC code.
Feel free to log these issues in EclipseLink.
James : www.eclipselink.org -
Help on ORA-06550 & PLS-00363 Error while running a procedure from a packag
Greeting All,
I ran the following procedure from a package on a command line in sqlplus:
SQL> exec QUALITY_ASSURANCE.COPY_SW_RESOURCES(2009,2010,9508);Where '2009' is the old fiscal year, '2010' is the new fiscal year and '9508' is the error code passed from the calling program. But, I received the following error messages:
ERROR at line 1:
ORA-06550: line 1, column 53:
PLS-00363: expression '9508' cannot be used as an assignment target
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
Any thoughts, suggestions and/or advice to resolve these errors.
Thanks in advance.Orchid wrote:
Justin,
Thanks for your response and information. Yes, Theoa was correct the 3rd parameter is an OUT variable, and it is a numeric field. The procedure was called by a form as follows:
QUALITY_ASSURANCE.COPY_SW_RESOURCES(:BLK_CONTROL.FROMFY,:BLK_CONTROL.TOFY,V_ERR);But the form does not work so I am trying to isolate the problem by running the procedure by itself in sqlplus to make sure there is no problem with the procedure.
Yesterday, I was able to run the procedure in Toad for Oracle to a successful completion by providing the 3 parameters: (2009, 2010, null). Just wonder why I cannot run the same procedure with the same parameters on a command line in sqlplus as follows:
exec QUALITY_ASSURANCE.COPY_SW_RESOURCES(2009,2010,null);So, if I understand your suggestion correctly, in order to run the procedure with the 3 parameter successfully in sqlplus,
I have to declare the 3rd parameter in PL/SQL. That is to create a PL/SQL file as suggested and run the file, correct? CORRECT!
Maybe you are looking for
-
How to debug global values in UDF in a graphical mapping
Hi Every one, I got a situation in PI where i have to use global values in graphical mapping UDF. I can't able to get the values in "Display Queue " option. Can you please tell me what is the best way of debugging global variable in graphical mappin
-
How to use the Managed Review and Approval
Hi, I'm a RIA Consultant at iDA MediaFoundry, Adobe Gold Partner in Belgium. I'm trying to figure out how the new solution accelerators work and how we can use them in the solutions that we develop for clients. I'm a bit stuck though with the Managed
-
Mapping of REGUP and REGUH fields to the structure FPAYP,FPAYH, FPAYHX
Hi We use structure FPAYP, FPAYH, FPAYHX in the DMEE formats. Now the data in the payment run can be seen in table REGUP and REGUH. All the payment related data falls into the DMEE generated xml file thru the structure FPAYP,F
-
Mac Mini Server HDD raid failure help
My server has been running for years, perfectly, most of the time. It is set up as a mirrored raid set. I noted today that the second HDD is displaying a "failed" red flag in disk utility. I attempted to Rebuild and that failed. In the FIRsT aid tab
-
Resize my InDesign document?
My document size is 8.50 x 11 inches but I need it in 2 different sized. I also need it in 8.25 x 10.75. My document has a background image and a few other small snippets of images along with text so when I resize it everything within the document ne