How to list dependencies of stored procedure in a package in oracle
hi gurus,
can any body help me to solve the below issue?
how to list dependencies of stored procedure in a package in oracle?
advanced thanks...
It sounds like you're going to have trouble because you're trying to track dependencies at a more fine-grained level than Oracle does (at least prior to 11g, which I know does finer-grained dependency tracking for columns, so there may be something that would help you there).
In Oracle, the entity is the package body. The procedure within the package does not have dependencies and does not depend on anything, it is part of the package body, which does have dependencies. You can see what tables are used by the package body via DBA_DEPENDENCIES. But if you're trying to track the dependencies for a particular procedure in a package, you'd either have to manually examine the code or you'd have to write your own PL/SQL parser.
Justin
Similar Messages
-
How to list all tables/stored procedures used by the report
All the reports i create are getting data from stored procedure(s). Is there a way to obtaining a listing of all the stored procedures without having to open report by report and check under Database > Set Datasource Location > Properties > Table Name?
Finding this info it would be extremely valuable, as it would help me to judge the impact of any changes that i might be considering to one or more of the stored proc.
So far i maintained a manual listing but it is not up-to-date and reliable. I would rather prefer to get an updated listing every time i want to change/drop a stored procedure.
Thanks so much for your help.
RickDell can you be a little bit more specific about the SDK solution. I could ask one of the developers to help me but i need to gather more details.
I took a look .rpt inspector Pro but it does not do what i need. All i need is the the listing of all the database tables (in my case stored procs) used in my reports. No need to replace or change anything. I need to scan the directory where i have all the reports for the different applications and get report names and table/stored procs used. i can export the txt file to excel and that's all. -
How to convert SQL server stored procedures to Oracle 11g
Hi Experts,
In SQL server 30 stored procedures are there how to convert all the stored procedure
from SQL server to Oracle 11g.
Please help me,
Thanks.ramya_162 wrote:
In SQL server 30 stored procedures are there how to convert all the stored procedure
from SQL server to Oracle 11g.
The single most fundamental concept you need to understand (grok in its fullness) is:
ORACLE IS NOT SQL-SERVER
There is very little, to NOTHING, in common between T-SQL (a language extension to SQL) and PL/SQL (integration of SQL with the language Ada, part of ALGOL family of languages that includes Pascal and C++).
So taking a T-SQL procedure and porting it as is to PL/SQL is plain stupid.
Why?
Oracle sucks at trying to be SQL-Server.
So how do you migrate from SQL-Server to Oracle?
By taking the REQUIREMENTS that the T-SQL procedures address, and addressing these requirements using Oracle SQL and PL/SQL. -
Calling a stored procedure within a package
We have a number of packages containing stored procedures. In an existing production application, we used embedded SQL in C programs to call these stored procs
e.g.
EXEC SQL EXECUTE
BEGIN owner.fees_calc.some_fee(:parm1,...);
END;
END-EXEC;
Now, I am trying to use SQLJ to call this same stored proc in the package. However, I am getting a compilation error from sqlj saying that it cannot find a stored procedure or function of that name. It works fine if I use a stored proc that is not in a package.
So how do I call a stored procedure within a package? Or is this not currently possible with sqlj?
I am also getting a warning just before the error and I'm wondering if the error is being caused by this:
Warning: You are using an Oracle JDBC driver, but connecting to a non-Oracle database. SQLJ will perform JDBC-generic SQL checking.
I am connecting to an Oracle 7.3.3 database using an Oracle 7.3.4 JDBC driver. I also tried using the Oracle 8.0.5 JDBC driver for the same database but I get the same warning message.I used the following code to call a stored
procedure via SQLJ:
try {
#sql [iCtx] {
CALL ibs.cvs_validate.validate_port_id(:IN record_id ,:IN poe_pod_flag,:IN port_id,:OUT error_code,:OUT error_message) };
where
"ibs" is the schema
"cvs_validate" is the package
"validate_port_id" is the procedure
The code runs fine, but to get it to compile
in JDeveloper 2.0, I had to disable the "Check SQL semantics against database schema" option on the Project Properties (SQLJ) property sheet.
null -
How to select from a stored procedure?
Lets say I have a simple stored procedures
Create Procedure stp_test
As
Begin
Select * from tbl1
End
Go
I would like to be able to do this in SSMS (actually, I want to do this from ADODB)
Select top 10 * from ...stp_test... Order By rowID
It looks like I want to use OpenQuery on the stored Procedure, but I have not been able to do it correctly. How can I query my stored procedure?
Rich PIt looks like I want to use OpenQuery on the stored Procedure, but I have not been able to do it correctly. How can I query my stored procedure?
If you want to use the OPENQUERY method , use the following.. follow this link...
http://stackoverflow.com/questions/209383/select-columns-from-result-set-of-stored-procedure
Please mark as answer, if this has helped you solve the issue.
Good Luck :) visit www.sqlsaga.com for more t-sql code snippets and BI related how to articles. -
How to output value from stored procedure
Hi folks, I need to output the OrderFK from a stored procedure not really sure how to achieve this any help or tips much appreciated.
Sql code below
USE [TyreSanner]
GO
/****** Object: StoredProcedure [dbo].[AddCustomerDetails] Script Date: 11/12/2014 20:56:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[AddCustomerDetails]
/***********************Declare variables ***********************/
/******tblCustomer******/
@Forename nvarchar(50),
@Surname nvarchar(50),
@HouseNo nvarchar(50),
@CustAddress nvarchar(50),
@Town nvarchar(50),
@Postcode nvarchar(50),
@ContactNo nvarchar(50),
@EmailAddress nvarchar(50),
/******tblLink_OrderProduct******/
@ProductQuantity int,
@TotalProductSaleCost decimal,
@ProductFK int,
@FittingDate date,
@FittingTime Time
As
DECLARE @CustomerFK int;
DECLARE @OrderFK int;
Begin TRANSACTION
SET NOCOUNT ON
INSERT INTO [TyreSanner].[dbo].[Customer](Forename, Surname, HouseNo, CustAddress, Town, Postcode, ContactNo, EmailAddress)
VALUES (@Forename,@Surname,@HouseNo,@CustAddress,@Town,@Postcode,@ContactNo,@EmailAddress)
Set @CustomerFK = SCOPE_IDENTITY()
INSERT INTO [TyreSanner].[dbo].[Order] (CustomerFK)
VALUES (@CustomerFK)
SET @OrderFK = SCOPE_IDENTITY()
INSERT INTO [TyreSanner].[dbo].[Link_OrderProduct](OrderFK, ProductFK, ProductQuantity, TotalProductSaleCost, FittingDate, FittingTime)
VALUES
(@OrderFK, @ProductFK, @ProductQuantity, @TotalProductSaleCost, @FittingDate, @FittingTime)
COMMIT TRANSACTIONHi brucey54,
There’re several ways to capture the value from a Stored Procedure. In you scenario, I would suggest 2 options, by an output parameter or by a table variable.
By an output Parameter, you need to make a little bit modification on your code as below:
USE [TyreSanner]
GO
ALTER PROCEDURE [dbo].[AddCustomerDetails]
@Forename nvarchar(50),
@FittingDate date,
@FittingTime Time,
@OrderFK int output
As
DECLARE @CustomerFK int;
--DECLARE @OrderFK int;
Run the following code, Then @OrderFKvalue holds the value you’d like.
DECLARE @OrderFKvalue int;
EXEC AddCustomerDetails(your parameters,@OrderFKvalue output)
Anyway if you don’t like to add one more parameter, you can get the value by a table variable as well. Please append “SELECT @OrderFK;” to your Procedure as below:
USE [TyreSanner]
GO
ALTER PROCEDURE [dbo].[AddCustomerDetails]
SET @OrderFK = SCOPE_IDENTITY()
INSERT INTO [TyreSanner].[dbo].[Link_OrderProduct](OrderFK, ProductFK, ProductQuantity, TotalProductSaleCost, FittingDate, FittingTime)
VALUES
(@OrderFK, @ProductFK, @ProductQuantity, @TotalProductSaleCost, @FittingDate, @FittingTime);
SELECT @OrderFK;
Then you can call the Stored Procedure as below:
DECLARE @T TABLE (OrderFK INT);
INSERT @T EXEC AddCustomerDetails(your parameters) ;
SELECT OrderFK FROM @T;
There’re more options to achieve your requirement, please see the below link:
How to Share Data between Stored Procedures
If you have any question, feel free to let me know.
Best Regards,
Eric Zhang -
How to call pl/sql stored procedure in JDBC query dialogbox
Hi,
how to call pl/sql stored procedure in JDBC query dialogbox(reports 9i) .
Cheers,
Raghuplease refer : Re: problem If you have more doubts, please ask in that question.
-
How to check performance for Stored procedure or Package.
Hi ,
Can any one please tell me , how to check performance for Stored procedure or Function or Package
Thanks&Regards,
Sanjeev.user13483989 wrote:
Hi ,
Can any one please tell me , how to check performance for Stored procedure or Function or Package
Thanks&Regards,
Sanjeev.Oracle has provided set of Tools to monitor the Performance.
Profilers being one of them; If you wish to understand more on PL/SQL Optimization, please read PL/SQL Optimization and Tuning.
See example of DBMS_PROFILER.
See example of PLSQL Hierarchial Profiler -
How to call PL-SQL/stored procedure in Creator
Anybody can tell how to call PL-SQL/Stored procedures inside creator...
Hi!!!
You can see this topic http://forum.sun.com/jive/thread.jspa?threadID=106046
There is how to call oracle stored procedures. Also I put a lot of links in these topic doing reference stored procedures. I have one that it tells specially how to call oracle stored procedures from java, is in spanish but you can understand the code.;-)
http://yoprogramador.vampisol.com/index.php?title=pl_sql_oracle_desde_java&more=1&c=1&tb=1&pb=1
Byeee -
How to execute the parametered stored procedure in sql *plus ?
how to execute the parametered stored procedure in sql *plus ?
my storedprocedure format
CREATE OR REPLACE PROCEDURE SMS_SELECTMPLOYEE
(empDOB out date, empEmpName out varchar2)
thanks & regards
mk_murOh, sorry... making many reading-too-fast mistakes today...
You can't declare date variables in SQL*Plus (seel help var), but you can cast to varchar2:
TEST> CREATE OR REPLACE PROCEDURE SMS_SELECTMPLOYEE (empDOB out date, empEmpName out varchar2) IS
2 d date := sysdate;
3 e varchar2(10) := 'bob';
4 begin
5 empdob := d;
6 empempname := e;
7 end;
8 /
Procedure created.
TEST> var d varchar2(30)
TEST> var n varchar2(30)
TEST> call SMS_SELECTMPLOYEE(:d,:n);
Call completed.
TEST> print d n
D
11/07/06
N
bobYoann. -
How to query DDL locks on stored procedures/functions and packages?
Hi!
The subject says it all: How do I see existing DDL locks on stored procedures/functions and packages?
While a procedure is executed it can't be deleted or replaced, so there has to be a DDL lock on it. The information does not seem to be in V$LOCK or V$LOCKED_OBJECTS.
Thanks!
Marcus
Edited by: MMarcus on Nov 21, 2009 3:43 PMHello,
Here you can find an article about the view DBA_DDL_LOCKS:
[http://www.praetoriate.com/int_40.htm]
If you don't have this view on the Data Dictionary, you may have
to execute the "OH/rdbms/admin/catblock.sql" script first.
Hope it can help.
Best regards,
Jean-Valentin -
How to customize events, execute stored procedures using JSF and ADF BC
As a java beginner, I started with developing simple web application using JSF and ADF business component through visual and declarative approach. I need to know how to customize events, execute stored procedures, invoke functions on triggering events associated with rich controls. for eg. how to write customized functions on button click or checkbox click events to achieve business requirement and can be modified whenever required.
Edited by: 792068 on Aug 31, 2010 9:40 PMWhich business layer is prefered to create interactive data model: 1. ADF business components or 2. Enterprise JavaBeans using Java persistance API (JPA) or 3. Toplink 4. Portlets
which minimizes writing low level codes and how much OOPS knowledge is required for creating above business layer binding data to viewcontroller layer? -
Oracle stored procedure in a package
Hello,
I'm working on a Web service -> XI -> Oracle scenario.
In the receiver side I'm using JDBC Adapter to call to stored procedure.
I have stored procedure in a package.
For example: package "price_list_pk" and stored procedure "is_pl".
When I try to enter the stored procedure path to XML tags I need to separate between the package and the stored procedure with dot "." and dot is not allowed in XML tag.
I want to now if you have answer for this problem
Have other way to work with stored procedure in packages?
EladHey everyone,
What Elad means is that in the XML structure of JDBC there are 2 places you define the DB\SP name:
1. Defined in the structure itself as an element name. (DT)
2. Mapped with a constant to a subelement called TABLE. (MM)
The MM shouldn't be a problem as a value can get the dot character.
But, in the DT structure, because you define here a XSD (XML structure) there is a problem naming the element with the dot character being part of the name as this character is not accepted in a XML tagname.
The right question is if anyone knows of a special XML attribute with which you could define that the element name would contain a dot character? Or else a creative way to call a Stored Procedure inside a Package despite the disabilities above?
Ben -
We are writing a J2EE application and using Weblogic 5.1 on Unix machine. We are
considering writing some Stored Procedures or Triggers on Oracle DBMS. Hence our
Stateless Session Beans / Data Access Objects (DAOs) would be calling those stored
procedures, which would reside on Oracle 8.1.7 (on Windows 2000). (These Data
Access Objects are running under the umbrella of a Stateless Session Beans). We
are using WebLogic's Connection Pooling.
Our question is: Would we get reliable rollbacks from our stored procedures. I
mean would the Transaction Management process of the EJB container work. Remember
the SQL is written in the Database (Oracle in this case) in the form of Stored
Procedures / Triggers through PL/SQL.
Any ideas or tips would help.
I would agree with Cameron Purdy. Be very cautious to use Oracle specific
Triggers / Stored Procedures. Consider following, (apart from what he said):
1. Unreliable behaviour of the Oracle JDBC drivers, specially 8.1.6 family..
(You may visit the Oracle's web site and see the newsgroups for the JDBC drivers).
This is enough of a reason to stop right there.
However for interest sake you may consider following issues:
2. By use of Oracle specific Triggers / SPs the application will not be portable.
Vendor Lock In. Remember your choice for J2EE compliant Server (WebLogic in this
case). The whole purpose would be defeated by going for this option.
3. There are issues related to the extensibility of the application. I have
my reservations and would hold my breath on two phase commit protocol transactions
being reliable in this scenario.
Have fun...
Terry
"Cameron Purdy" <[email protected]> wrote:
>Yes, the work performed by the SPs and the triggers would be in the same
>tx.
>
>What would NOT work is if the data has been read into WebLogic and then
>it
>gets affected by a trigger or SP on the RDBMS, the data in WebLogic is
>not
>automatically re-read within that same tx so you need to be careful.
>
>Peace,
>
>--
>Cameron Purdy
>Tangosol Inc.
>Tangosol Coherence: Clustered Coherent Cache for J2EE
>Information at http://www.tangosol.com/
>
>
>"Ahmad" <[email protected]> wrote in message
>news:[email protected]...
>>
>> We are writing a J2EE application and using Weblogic 5.1 on Unix machine.
>We are
>> considering writing some Stored Procedures or Triggers on Oracle DBMS.
>Hence our
>> Stateless Session Beans / Data Access Objects (DAOs) would be calling
>those stored
>> procedures, which would reside on Oracle 8.1.7 (on Windows 2000). (These
>Data
>> Access Objects are running under the umbrella of a Stateless Session
>Beans). We
>> are using WebLogic's Connection Pooling.
>> Our question is: Would we get reliable rollbacks from our stored
>procedures. I
>> mean would the Transaction Management process of the EJB container
>work.
>Remember
>> the SQL is written in the Database (Oracle in this case) in the form
>of
>Stored
>> Procedures / Triggers through PL/SQL.
>> Any ideas or tips would help.
>
>
-
SSRS with Oracle Stored Procedures, Functions and Packages
Hi,
I am working on a BI project. Here we are using PowerPivot to access data from Oracle DB and generate reports. Currently Client generates Few reports using Oracle Stored Procedures, Functions and Packages. We need to move everything to PowerPivot, so
that user can generate all reports using same platform. But PowerPivot doesn'e support Oracle Stored Procedures, Functions and Packages. So we have decided to try those reports using SSRS.
I have no knowledge about using SSRS which will call Oracle function/stored procedures/packages for generating reports.
Can anybody help me in getting exact steps?
Please let me know if my question is not clear enough.
Thanks and Regards,
SSHi Visakh,
Thanks for the detailed steps. My next question is:
Is there any other way to develop such reports without using any development tool like Visual Studio? Our aim is to provide a self-serviced reporting platform where user don't need any technical knowledge.
I am sorry I have no knowledge about SSRS and Oracle DB.Can you please have a look at my Oracle function and let me know whether it's possible to execute this using SSRS? (I am pasting one by one as there is a character limit.
CREATE OR REPLACE TYPE obj_special_pass_cases
AS OBJECT
CLAIM_ID NUMBER(12),
claim_ref_no VARCHAR2(20),
OFFICER_NAME VARCHAR2(201),
SUBMIT_DT VARCHAR2(10),
ACC_DT VARCHAR2(10),
SP_ISSUE_DT VARCHAR2(10),
STATUS VARCHAR2(30),
SUB_STATUS VARCHAR2(30),
STATUS_LAST_UPDATE_DATE VARCHAR2(10),
SP_EXP_DT VARCHAR2(10),
INDUSTRY_CODE VARCHAR2(8),
EMP_SSIC VARCHAR2(8),
rel VARCHAR2(4),
WPNo VARCHAR2(20),
FIN VARCHAR2(9),
PASSPORT_NO VARCHAR2(16),
SPNo VARCHAR2(20),
VictimName VARCHAR2(100),
SP_EXT_PURPOSE VARCHAR2(100),
ISSUE_SYSTEM VARCHAR2(4),
REPATRIATION_DATE VARCHAR2(10),
SP_STATUS VARCHAR2(30),
SP_ISSUE_PURPOSE VARCHAR2(500)
CREATE OR REPLACE TYPE tbl_special_pass_cases
AS TABLE OF obj_special_pass_cases
CREATE OR REPLACE TYPE obj_special_pass_casesNew
AS OBJECT
CLAIM_ID NUMBER(12),
claim_ref_no VARCHAR2(20),
OFFICER_NAME VARCHAR2(201),
SUBMIT_DT VARCHAR2(10), /*Case Registration Date*/
ACC_DT VARCHAR2(10),
SP_ISSUE_DT VARCHAR2(10),
calc_sp_issue_dt VARCHAR2(10),
calc_sp_issue_dt_month VARCHAR2(2),
calc_sp_issue_dt_year VARCHAR2(4),
calc_Duration_Of_Stay VARCHAR2(4),
STATUS VARCHAR2(30),
SUB_STATUS VARCHAR2(30),
STATUS_LAST_UPDATE_DATE VARCHAR2(10),
lastUpdateDtMonth varchar2(2),
lastUpdateDtYear varchar2(4),
DurationOfUpdateDt VARCHAR2(4),
SP_EXP_DT VARCHAR2(10),
INDUSTRY_CODE VARCHAR2(8),
EMP_SSIC VARCHAR2(8),
rel VARCHAR2(4),
WPNo VARCHAR2(20), /* New columns from here - SR */
FIN VARCHAR2(9),
PASSPORT_NO VARCHAR2(16),
SPNo VARCHAR2(20),
VictimName VARCHAR2(100),
workerNationality VARCHAR2(20),
employName VARCHAR2(200),
reportType VARCHAR2(10),
SP_EXT_PURPOSE VARCHAR2(100),
ISSUE_SYSTEM VARCHAR2(4), /*IWPS, EIDS*/
REPATRIATION_DATE VARCHAR2(10),
SP_STATUS VARCHAR2(30),
SP_ISSUE_PURPOSE VARCHAR2(500)
CREATE OR REPLACE TYPE tbl_special_pass_casesNew
AS TABLE OF obj_special_pass_casesNew
FUNCTION getListOfSpecialPassCases(
vRepatriationDateFrom VARCHAR2,
vRepatriationDateTo VARCHAR2,
vIncludeRepatriationDate VARCHAR2)
RETURN tbl_special_pass_cases
IS
TYPE cur_typ IS REF CURSOR;
SPECIAL_PASS_CASES_CUR cur_typ;
vSQL1 VARCHAR2(4000);
--vSQL1 VARCHAR2(4000) := 'SELECT DISTINCT(A.CLAIM_ID), A.CLAIM_REF_NO, A.STATUS, A.SUB_STATUS, A.OFFICER_NAME, A.SUBMIT_DT, A.ACC_DT, A.vLatestUpdatedDate, A.INDUSTRY_CODE, A.ID_NO, A.vWorkerName, B.vSPWPNO, B.vFIN, B.vSPPassportNo,
B.vSPIssueDate, B.vSPExpiryDate, B.vSPNo, DECODE(B.vSPExtensionPurpose,''1'',''WICB'',''2'',''RE-APPLICATION'',''3'',''POLICE'',''4'',''REPATRIATION'',''5'',''LRD'',''6'',''LATE RENEWAL'',''9'',''OTHERS'',''10'',''LATE EISSUANCE'',''13'',''FMMD'',''14'',''TMB
PENDING REPATRIATION'',''15'',''TMB REPATRIATION'',''16'',''PENDING REPATRIATION (SB-F)'',''17'',''REPATRIATION (SB-F)'') vSPExtensionPurpose, B.vIssueSystem, B.vSPActualDepartDate, B.vSPStatus, DECODE(B.vSPIssuePurpose,''1'',''WICB'',''2'',''RE-APPLICATION'',''3'',''POLICE'',''4'',''REPATRIATION'',''5'',''LRD'',''6'',''LATE
RENEWAL'',''9'',''OTHERS'',''10'',''LATE EISSUANCE'',''11'',''PENDING DOCUMENT VERIFICATION'',''12'',''LATE ERENEWAL'',''13'',''FMMD'',''14'',''TMB PENDING REPATRIATION'',''15'',''TMB REPATRIATION'',''16'',''PENDING REPATRIATION (SB-F)'',''17'',''REPATRIATION
(SB-F)'') vSPIssuePurpose FROM (SELECT vSPWPNO, vFIN, vSPPassportNo, vSPIssueDate, vSPExpiryDate, vSPNo, vSPExtensionPurpose, vIssueSystem, vSPActualDepartDate, vSPStatus, vSPIssuePurpose FROM TABLE(IOSH_WIC_EXT_INTERFACE_PKG.getIWPSActiveSpecialPass) WHERE
(vSPWPNO IS NOT NULL OR vFIN IS NOT NULL)) B JOIN (SELECT WC.CLAIM_ID CLAIM_ID, WC.CLAIM_REF_NO CLAIM_REF_NO, WC.STATUS STATUS, WC.SUB_STATUS SUB_STATUS, TAS.LAST_NAME ||'' ''|| TAS.FIRST_NAME OFFICER_NAME, to_char(trunc(IRN.SUBMIT_DT), ''dd/MM/yyyy'')
SUBMIT_DT, TO_CHAR(trunc(decode(wc.assessmt_type,''OD-PI'',EV.OD_CONSULT_DT,''OD-TI'',ev.od_consult_dt,ECASE.acc_dt)), ''dd/MM/yyyy'') ACC_DT, (SELECT TO_CHAR(MAX(WCS.STATUS_START_DT), ''dd/MM/yyyy'') STATUS_LAST_UPDATE_DATE FROM WIC_CLAIM_STATUS WCS WHERE
WCS.CLAIM_ID=WC.CLAIM_ID) vLatestUpdatedDate, EC.INDUSTRY_CODE INDUSTRY_CODE, EP.ID_NO ID_NO, EP.NAME vWorkerName FROM EVENT_PERSON EP, WIC_CLAIMS WC, TBL_AA_SUBJECT TAS, EVENT_COMPANY EC,EVENT_CASE ECASE,event_victim ev WHERE EP.ID_NO IS NOT NULL AND EP.DELETE_IND
= ''F'' AND EP.INVOLVEMENT = ''VICTIM'' AND WC.EVENT_CASE_NO = EP.EVENT_CASE_NO AND WC.EVENT_PERSON_ID = EP.EVENT_PERSON_ID AND ep.event_person_id = ev.event_person_id (+) AND WC.ASSIGN_OFFICER_ID = TAS.SUBJECT_ID AND EC.EVENT_CASE_NO=WC.EVENT_CASE_NO AND
EC.INVOLVEMENT in (''EMPLOYER'',''EMPLOYER_OCCUPIER'') AND ECASE.EVENT_CASE_NO=WC.EVENT_CASE_NO AND EC.DELETE_IND = ''F'') A ON (B.vFIN = A.ID_NO OR B.vSPPassportNo = A.ID_NO)';
vSQL2 VARCHAR2(4000);
--vSQL2 VARCHAR2(4000) := 'SELECT DISTINCT(A.CLAIM_ID),A.CLAIM_REF_NO,A.STATUS,A.SUB_STATUS,A.OFFICER_NAME,A.SUBMIT_DT,A.ACC_DT,A.vLatestUpdatedDate,A.INDUSTRY_CODE,A.ID_NO,A.vWorkerName,B.vSPWPNO,B.vFIN,B.vSPPassportNo,B.vSPIssueDate,B.vSPExpiryDate,B.vSPNo,DECODE(B.vSPExtensionPurpose,''1'',''WICB'',''2'',''RE-APPLICATION'',''3'',''POLICE'',''4'',''REPATRIATION'',''5'',''LRD'',''6'',''LATE
RENEWAL'',''9'',''OTHERS'',''10'',''LATE EISSUANCE'',''13'',''FMMD'',''14'',''TMB PENDING REPATRIATION'',''15'',''TMB REPATRIATION'',''16'',''PENDING REPATRIATION (SB-F)'',''17'',''REPATRIATION (SB-F)'') vSPExtensionPurpose,B.vIssueSystem,B.vSPActualDepartDate,B.vSPStatus,DECODE(B.vSPIssuePurpose,''1'',''WICB'',''2'',''RE-APPLICATION'',''3'',''POLICE'',''4'',''REPATRIATION'',''5'',''LRD'',''6'',''LATE
RENEWAL'',''9'',''OTHERS'',''10'',''LATE EISSUANCE'',''11'',''PENDING DOCUMENT VERIFICATION'',''12'',''LATE ERENEWAL'',''13'',''FMMD'',''14'',''TMB PENDING REPATRIATION'',''15'',''TMB REPATRIATION'',''16'',''PENDING REPATRIATION (SB-F)'',''17'',''REPATRIATION
(SB-F)'') vSPIssuePurpose FROM (SELECT vSPWPNO,vFIN,vSPPassportNo,vSPIssueDate,vSPExpiryDate,vSPNo,vSPExtensionPurpose,vIssueSystem,vSPActualDepartDate,vSPStatus,vSPIssuePurpose FROM TABLE(IOSH_WIC_EXT_INTERFACE_PKG.getIWPSDepartedSpecialPass(''' || vRepatriationDateFrom
|| ''', ''' || vRepatriationDateTo || ''')) WHERE (vSPWPNO IS NOT NULL OR vFIN IS NOT NULL)) B JOIN (SELECT WC.CLAIM_ID CLAIM_ID, WC.CLAIM_REF_NO CLAIM_REF_NO, WC.STATUS STATUS,WC.SUB_STATUS SUB_STATUS, TAS.LAST_NAME ||'' ''|| TAS.FIRST_NAME OFFICER_NAME,
to_char(trunc(IRN.SUBMIT_DT), ''dd/MM/yyyy'') SUBMIT_DT,TO_CHAR(trunc(decode(wc.assessmt_type,''OD-PI'',EV.OD_CONSULT_DT,''OD-TI'',ev.od_consult_dt,ECASE.acc_dt)), ''dd/MM/yyyy'') ACC_DT, (SELECT TO_CHAR(MAX(WCS.STATUS_START_DT), ''dd/MM/yyyy'') STATUS_LAST_UPDATE_DATE
FROM WIC_CLAIM_STATUS WCS WHERE WCS.CLAIM_ID=WC.CLAIM_ID) vLatestUpdatedDate, EC.INDUSTRY_CODE INDUSTRY_CODE, EP.ID_NO ID_NO, EP.NAME vWorkerName FROM EVENT_PERSON EP, WIC_CLAIMS WC, TBL_AA_SUBJECT TAS, EVENT_COMPANY EC,EVENT_CASE ECASE, IR_NOTIFICATION IRN,event_victim
ev WHERE EP.ID_NO IS NOT NULL AND EP.DELETE_IND = ''F'' AND EP.INVOLVEMENT = ''VICTIM'' AND WC.EVENT_CASE_NO = EP.EVENT_CASE_NO AND WC.EVENT_PERSON_ID = EP.EVENT_PERSON_ID and ep.event_person_id = ev.event_person_id (+) AND WC.ASSIGN_OFFICER_ID = TAS.SUBJECT_ID
AND EC.EVENT_CASE_NO=WC.EVENT_CASE_NO AND EC.INVOLVEMENT in (''EMPLOYER'',''EMPLOYER_OCCUPIER'') AND ECASE.EVENT_CASE_NO=WC.EVENT_CASE_NO AND IRN.REF_NO(+) = ECASE.IR_REF_NO AND IRN.SUBMIT_TYPE IN (''SI'',''SE'') AND EC.DELETE_IND = ''F'') A ON (B.vFIN = A.ID_NO
OR B.vSPPassportNo = A.ID_NO)';
SPECIAL_PASS_CASES_TBL tbl_special_pass_cases := tbl_special_pass_cases();
cursor sp_pass_settle_cur is
SELECT DISTINCT (A.CLAIM_ID),
A.CLAIM_REF_NO,
A.STATUS,
A.SUB_STATUS,
A.OFFICER_NAME,
A.SUBMIT_DT,
A.ACC_DT,
A.vLatestUpdatedDate,
A.INDUSTRY_CODE,
A.ID_NO,
A.vWorkerName,
B.vSPWPNO,
B.vFIN,
B.vSPPassportNo,
B.vSPIssueDate,
B.vSPExpiryDate,
B.vSPNo,
DECODE(B.vSPExtensionPurpose,
'1',
'WICB',
'2',
'RE - APPLICATION',
'3',
'POLICE',
'4',
'REPATRIATION',
'5',
'LRD',
'6',
'LATE RENEWAL',
'9',
'OTHERS',
'10',
'LATE EISSUANCE',
'13',
'FMMD',
'14',
'TMB PENDING REPATRIATION',
'15',
'TMB REPATRIATION',
'16',
'PENDING REPATRIATION(SB - F)',
'17',
'REPATRIATION(SB - F)') vSPExtensionPurpose,
B.vIssueSystem,
B.vSPActualDepartDate,
B.vSPStatus,
DECODE(B.vSPIssuePurpose,
'1',
'WICB',
'2',
'RE - APPLICATION',
'3',
'POLICE',
'4',
'REPATRIATION',
'5',
'LRD',
'6',
'LATE RENEWAL',
'9',
'OTHERS',
'10',
'LATE EISSUANCE',
'11',
'PENDING DOCUMENT VERIFICATION',
'12',
'LATE ERENEWAL',
'13',
'FMMD',
'14',
'TMB PENDING REPATRIATION',
'15',
'TMB REPATRIATION',
'16',
'PENDING REPATRIATION(SB - F)',
'17',
'REPATRIATION(SB - F)') vSPIssuePurpose
FROM (SELECT vSPWPNO,
vFIN,
vSPPassportNo,
vSPIssueDate,
vSPExpiryDate,
vSPNo,
vSPExtensionPurpose,
vIssueSystem,
vSPActualDepartDate,
vSPStatus,
vSPIssuePurpose
FROM TABLE(IOSH_WIC_EXT_INTERFACE_PKG.getIWPSActiveSpecialPass)
WHERE (vSPWPNO IS NOT NULL OR vFIN IS NOT NULL)) B
JOIN (SELECT WC.CLAIM_ID CLAIM_ID,
WC.CLAIM_REF_NO CLAIM_REF_NO,
WC.STATUS STATUS,
WC.SUB_STATUS SUB_STATUS,
TAS.LAST_NAME ||''|| TAS.FIRST_NAME OFFICER_NAME,
'' SUBMIT_DT,
TO_CHAR(trunc(decode(wc.assessmt_type,
'OD-PI',
EV.OD_CONSULT_DT,
'OD-TI',
ev.od_consult_dt,
ECASE.acc_dt)),
'dd/MM/yyyy') ACC_DT,
(SELECT TO_CHAR(MAX(WCS.STATUS_START_DT), 'dd/MM/yyyy') STATUS_LAST_UPDATE_DATE
FROM WIC_CLAIM_STATUS WCS
WHERE WCS.CLAIM_ID = WC.CLAIM_ID) vLatestUpdatedDate,
EC.INDUSTRY_CODE INDUSTRY_CODE,
EP.ID_NO ID_NO,
EP.NAME vWorkerName
FROM EVENT_PERSON EP,
WIC_CLAIMS WC,
TBL_AA_SUBJECT TAS,
EVENT_COMPANY EC,
EVENT_CASE ECASE,
event_victim ev
WHERE EP.ID_NO IS NOT NULL
AND EP.DELETE_IND = 'F'
AND EP.INVOLVEMENT = 'VICTIM'
AND WC.EVENT_CASE_NO = EP.EVENT_CASE_NO
AND WC.EVENT_PERSON_ID = EP.EVENT_PERSON_ID
AND ep.event_person_id = ev.event_person_id(+)
AND WC.ASSIGN_OFFICER_ID = TAS.SUBJECT_ID
AND EC.EVENT_CASE_NO = WC.EVENT_CASE_NO
AND EC.INVOLVEMENT in ('EMPLOYER', 'EMPLOYER_OCCUPIER')
AND ECASE.EVENT_CASE_NO = WC.EVENT_CASE_NO
AND EC.DELETE_IND = 'F') A ON (B.vFIN = A.ID_NO OR B.vSPPassportNo = A.ID_NO);
sp_pass_settle_rec sp_pass_settle_cur%rowtype;
cursor sp_details_with_dt_cur is
SELECT DISTINCT (A.CLAIM_ID),
A.CLAIM_REF_NO,
A.STATUS,
A.SUB_STATUS,
A.OFFICER_NAME,
A.SUBMIT_DT,
A.ACC_DT,
A.vLatestUpdatedDate,
A.INDUSTRY_CODE,
A.ID_NO,
A.vWorkerName,
B.vSPWPNO,
B.vFIN,
B.vSPPassportNo,
B.vSPIssueDate,
B.vSPExpiryDate,
B.vSPNo,
DECODE(B.vSPExtensionPurpose,'1','WICB', '2','RE - APPLICATION','3','POLICE','4','REPATRIATION','5','LRD','6','LATE RENEWAL','9','OTHERS','10','LATE EISSUANCE',
'13','FMMD','14','TMB PENDING REPATRIATION','15','TMB REPATRIATION','16','PENDING REPATRIATION(SB - F)','17','REPATRIATION(SB
- F)') vSPExtensionPurpose,
B.vIssueSystem,
B.vSPActualDepartDate,
B.vSPStatus,
DECODE(B.vSPIssuePurpose,
'1','WICB','2','RE - APPLICATION','3','POLICE','4','REPATRIATION','5','LRD','6','LATE RENEWAL','9','OTHERS', '10', 'LATE EISSUANCE','11','PENDING
DOCUMENT VERIFICATION',
'12','LATE ERENEWAL','13','FMMD','14','TMB PENDING REPATRIATION','15','TMB REPATRIATION','16','PENDING REPATRIATION(SB - F)','17','REPATRIATION(SB
- F)') vSPIssuePurpose
FROM (SELECT vSPWPNO,
vFIN,
vSPPassportNo,
vSPIssueDate,
vSPExpiryDate,
vSPNo,
vSPExtensionPurpose,
vIssueSystem,
vSPActualDepartDate,
vSPStatus,
vSPIssuePurpose
FROM TABLE(IOSH_WIC_EXT_INTERFACE_PKG.getIWPSDepartedSpecialPass(''|| vRepatriationDateFrom ||'', ''|| vRepatriationDateTo ||''))
WHERE (vSPWPNO IS NOT NULL OR vFIN IS NOT NULL)) B
JOIN (SELECT WC.CLAIM_ID CLAIM_ID,
WC.CLAIM_REF_NO CLAIM_REF_NO,
WC.STATUS STATUS,
WC.SUB_STATUS SUB_STATUS,
TAS.LAST_NAME ||''|| TAS.FIRST_NAME OFFICER_NAME,
to_char(trunc(IRN.SUBMIT_DT), 'dd/MM/yyyy') SUBMIT_DT,
TO_CHAR(trunc(decode(wc.assessmt_type,
'OD - PI',
EV.OD_CONSULT_DT,
'OD - TI',
ev.od_consult_dt,
ECASE.acc_dt)),
'dd/MM/yyyy') ACC_DT,
(SELECT TO_CHAR(MAX(WCS.STATUS_START_DT), 'dd/MM/yyyy') STATUS_LAST_UPDATE_DATE
FROM WIC_CLAIM_STATUS WCS
WHERE WCS.CLAIM_ID = WC.CLAIM_ID) vLatestUpdatedDate,
EC.INDUSTRY_CODE INDUSTRY_CODE,
EP.ID_NO ID_NO,
EP.NAME vWorkerName
FROM EVENT_PERSON EP,
WIC_CLAIMS WC,
TBL_AA_SUBJECT TAS,
EVENT_COMPANY EC,
EVENT_CASE ECASE,
IR_NOTIFICATION IRN,
event_victim ev
WHERE EP.ID_NO IS NOT NULL
AND EP.DELETE_IND = 'F'
AND EP.INVOLVEMENT = 'VICTIM'
AND WC.EVENT_CASE_NO = EP.EVENT_CASE_NO
AND WC.EVENT_PERSON_ID = EP.EVENT_PERSON_ID
and ep.event_person_id = ev.event_person_id(+)
AND WC.ASSIGN_OFFICER_ID = TAS.SUBJECT_ID
AND EC.EVENT_CASE_NO = WC.EVENT_CASE_NO
AND EC.INVOLVEMENT in ('EMPLOYER', 'EMPLOYER_OCCUPIER')
AND ECASE.EVENT_CASE_NO = WC.EVENT_CASE_NO
AND IRN.REF_NO(+) = ECASE.IR_REF_NO
AND IRN.SUBMIT_TYPE IN ('SI', 'SE')
AND EC.DELETE_IND = 'F') A ON (B.vFIN = A.ID_NO OR B.vSPPassportNo = A.ID_NO);
sp_details_with_dt_rec sp_details_with_dt_cur%rowtype;
/*vSQL VARCHAR2(4000);
vFIN VARCHAR2(9);
vSPPassportNo VARCHAR2(16);
vSPWPNO VARCHAR2(20);
vSPIssueDate VARCHAR2(10);
vSPExpiryDate VARCHAR2(10);
vSPNo VARCHAR2(20);
vSPExtensionPurpose VARCHAR2(100);
vIssueSystem VARCHAR2(4);
vSPActualDepartDate VARCHAR2(10);
vSPStatus VARCHAR2(30);
vSPIssuePurpose VARCHAR2(500);
CLAIM_ID NUMBER(12);
CLAIM_REF_NO VARCHAR2(20);
STATUS VARCHAR2(30);
SUB_STATUS VARCHAR2(30);
OFFICER_NAME VARCHAR2(201);
SUBMIT_DT VARCHAR2(10);
ACC_DT VARCHAR2(10);
vLatestUpdatedDate VARCHAR2(10);
INDUSTRY_CODE VARCHAR2(8);
ID_NO VARCHAR2(50);
vWorkerName VARCHAR2(100);*/
BEGIN
if vIncludeRepatriationDate = 'Y' then
for sp_details_with_dt_rec in sp_details_with_dt_cur
loop
SPECIAL_PASS_CASES_TBL.EXTEND;
SPECIAL_PASS_CASES_TBL(SPECIAL_PASS_CASES_TBL.LAST) := obj_special_pass_cases(sp_details_with_dt_rec.CLAIM_ID,sp_details_with_dt_rec.CLAIM_REF_NO,sp_details_with_dt_rec.OFFICER_NAME,sp_details_with_dt_rec.SUBMIT_DT,sp_details_with_dt_rec.ACC_DT,sp_details_with_dt_rec.vSPIssueDate,sp_details_with_dt_rec.STATUS,sp_details_with_dt_rec.SUB_STATUS,sp_details_with_dt_rec.vLatestUpdatedDate,sp_details_with_dt_rec.vSPExpiryDate,sp_details_with_dt_rec.INDUSTRY_CODE,sp_details_with_dt_rec.INDUSTRY_CODE,'a',sp_details_with_dt_rec.vSPWPNO,sp_details_with_dt_rec.vFIN,sp_details_with_dt_rec.vSPPassportNo,sp_details_with_dt_rec.vSPNo,sp_details_with_dt_rec.vWorkerName,sp_details_with_dt_rec.vSPExtensionPurpose,sp_details_with_dt_rec.vIssueSystem,sp_details_with_dt_rec.vSPActualDepartDate,sp_details_with_dt_rec.vSPStatus,sp_details_with_dt_rec.vSPIssuePurpose);
end loop;
else
for sp_pass_settle_rec in sp_pass_settle_cur
loop
SPECIAL_PASS_CASES_TBL.EXTEND;
SPECIAL_PASS_CASES_TBL(SPECIAL_PASS_CASES_TBL.LAST) := obj_special_pass_cases(sp_pass_settle_rec.CLAIM_ID,sp_pass_settle_rec.CLAIM_REF_NO,sp_pass_settle_rec.OFFICER_NAME,sp_pass_settle_rec.SUBMIT_DT,sp_pass_settle_rec.ACC_DT,sp_pass_settle_rec.vSPIssueDate,sp_pass_settle_rec.STATUS,sp_pass_settle_rec.SUB_STATUS,sp_pass_settle_rec.vLatestUpdatedDate,sp_pass_settle_rec.vSPExpiryDate,sp_pass_settle_rec.INDUSTRY_CODE,sp_pass_settle_rec.INDUSTRY_CODE,'a',sp_pass_settle_rec.vSPWPNO,sp_pass_settle_rec.vFIN,sp_pass_settle_rec.vSPPassportNo,sp_pass_settle_rec.vSPNo,sp_pass_settle_rec.vWorkerName,sp_pass_settle_rec.vSPExtensionPurpose,sp_pass_settle_rec.vIssueSystem,sp_pass_settle_rec.vSPActualDepartDate,sp_pass_settle_rec.vSPStatus,sp_pass_settle_rec.vSPIssuePurpose);
end loop;
end if ;
RETURN SPECIAL_PASS_CASES_TBL;
END getListOfSpecialPassCases;
Thanks,
SS
Maybe you are looking for
-
The screenshot below illustrates a annoying problem I'm having with previews in Camera Raw /Bridge CS5 fully updated. This is intermittent while adjusting 200+ images. Purging CR cache doesn't do much to fix the situation. And yes this is a calibrate
-
I have written 2 posts and 2 replies in regard to my Compaq Presario Laptop computer. I have had no response to any of them. My patience is being stretched. I tried the customer care centre to no avail. The stupid robot wanted me to book in the compu
-
Hi Experts , I have a requirement wherein i need to update a file in kept in a KM repository . This file contains a numeric value that we need to change . Can anyone please provide the code for same . I went through KM API's and found that the updat
-
I have a question for JButton object
JButton myButton = new JButton("a"); if (myButton.getText()=="a"){ myButton.setText("b"); When event take place Text's value will become "b" on the myButton, but try again myButton.getText() method get hold of value as has of is "a". FtpFrame.java im
-
Total open tasks count by week
Hello, I was wondering if someone is able and willing to help me with a code to calculate something in MS SQL server (me being at the start of learning SQL myself). I apologize in advance if this is not the section I should post on, or the type of qu