473,396 Members | 1,970 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

PL/SQL to Dynamic Method 2 conversion of 3 files (Convert.zip) Pro*COBOL Oracle 10g

1
Need to convert this PL/SQL script to Dynamic SQL Method 2

* copybook - celg02u3.sql SIR 24265 *
* updates dt_deny for all rows in *
* the removal_eligibility_link table for all persons *
* in all stages associated with the victim who has *
* has had a specific legal status change *

EXEC SQL EXECUTE

BEGIN
/* This cursor returns all removal events associated
with a specific list of legal status codes for
victim where eligibility has not already been denied */

:PLSQL-PROCEDURE-NAME :='CELG01U3';
:PLSQL-BLOCK-NUMBER :='Finding legal status rows';

DECLARE CURSOR DENY_LEGAL IS
Select
/*+ INDEX (rem IND_REMOVAL_ELIGIBILITY_LINK_4)
INDEX (ls IND_LEGAL_STATUS_1) */
distinct pe.id_pers_elig_person, ls.id_case,
ls.dt_legal_stat_status_dt, id_removal_event,
pe.dt_pers_elig_start
from person_eligibility pe, legal_status ls,
removal_eligibility_link rem
where pe.id_pers_elig = rem.id_pers_elig
and pe.id_pers_elig_person = ls.id_person
and rem.dt_deny is null
and rem.ind_pers_removed = 'Y'
and ls.cd_legal_stat_status in ('030', '040',
'050', '070', '100', '120', '130', '150')
and ((ls.dt_legal_stat_status_dt > pe.dt_pers_elig_start
or
ls.dt_legal_stat_status_dt = pe.dt_pers_elig_start)
and ls.dt_legal_stat_status_dt < pe.dt_pers_elig_end);

v_deny_cntr number:=0;
v_commit_cntr number:=0;

BEGIN
FOR dl IN DENY_LEGAL
LOOP
UPDATE REMOVAL_ELIGIBILITY_LINK REL
SET REL.DT_DENY = dl.dt_legal_stat_status_dt
WHERE REL.ID_REMOVAL_EVENT = dl.id_removal_event;

DECLARE CURSOR ELIG_PERSON IS
select DISTINCT ID_PERS_ELIG /*added distinct*/
from REMOVAL_ELIGIBILITY_LINK
where ID_REMOVAL_EVENT = dl.id_removal_event;

BEGIN
FOR i IN ELIG_PERSON
LOOP
BEGIN
UPDATE PERSON_ELIGIBILITY
SET DT_DENY = dl.dt_legal_stat_status_dt
WHERE ID_PERS_ELIG = i.id_pers_elig
AND
((dl.dt_legal_stat_status_dt > DT_PERS_ELIG_START
or
dl.dt_legal_stat_status_dt = DT_PERS_ELIG_START)
AND
dl.dt_legal_stat_status_dt < DT_PERS_ELIG_END)
AND
(DT_DENY is Null
or DT_DENY > dl.dt_legal_stat_status_dt);

v_deny_cntr:=v_deny_cntr+SQL%ROWCOUNT;

END;
END LOOP;
END;
v_commit_cntr:=v_commit_cntr+1;
IF v_commit_cntr > 50000 THEN
COMMIT;
v_commit_cntr := 0;
END IF;
END LOOP;
:CELG02U-DENIED :=v_deny_cntr;
END;

EXCEPTION
WHEN OTHERS THEN
:PLSQL-SQL-ERROR-NUMBER :=SQLCODE;
:PLSQL-SQL-ERROR-MESSAGE :=SQLERRM;
:PLSQL-FATAL-ERROR :='Y';
ROLLBACK;
END;

END-EXEC.

If someone can do for me as an example I can do the others I need to do.

More Details:

I need this .sql file to be Dynamic Method SQL Method 2 per Oracle's instructions "Use a Dynamic Method 2 to execute the PL/SQL block. For information on dynamic method 2 please see the Pro*Cobol Precompiler manual."

Here is error when running a .sh that uses these .sql:

Business Case:
this is a known bug in the oracle precompiler for 10g. this problem affects only celg02b cause it is the only program that uses hints in a plsql compiled into a batch program. It may need to be re-written to use dynamic method 2 or use a different precompiler.
PCB-S-00576, PLS-103: Encountered the symbol "INDEX" when expecting one of the following:

( * - + all case mod new null <an identifier>

<a double-quoted delimited-identifier> <a bind variable>

table avg count current distinct max min prior sql stddev sum

unique variance execute the 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 specification>

<an alternatively-quoted SQL string>



celg02u3.sql -

/*+ INDEX (rem IND_REMOVAL_ELIGIBILITY_LINK_4) INDEX (ls IND_LEGAL_STATUS_1) */

celg02i2.sql -

/*+ INDEX (CR IND_CNSRVTRSHP_REMOVAL_2) */

celg02u2.sql -

I believe this describes the problem in detail. We are upgrading to Oracle 10g client and started to experience this problem.
Mar 13 '08 #1
0 2688

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: VictorReinhart | last post by:
Hi, For Oracle 9i, the sample make file for the Oracle Pro*COBOL precompiler has a hard-coded list of programs in it. Has anyone created a generic make file (ie, without a hardcoded list of...
2
by: Chris | last post by:
I have tableA, defined as: field1 varchar2(10), field2 varchar2(10), field3 varchar2(10) I have host variables defined as: v1 pic x(10) varying v2 pic x(10) varying
1
by: Jim Shank | last post by:
I am adding support to my application for Oracle 10g and using Enterprise Library Data Access Application Blocks and trying to determine the best way to convert the GUID's which are stored as...
4
by: Kalpesh Parikh | last post by:
We have 'C' routine calls Pro COBOL routine...... Data passed back to the C program is shifted by 4 bytes. We are trying to understand and fix this. p.s. COBOL to COBOL is working fine! Any...
0
by: alok | last post by:
i having problem in oracle 9i dataBase------ i want to convert my oracle data to sql 2000.....but i cant convert the hindi data from oracle to sql 2000... means...... i having table in...
3
by: Sascha.Moellering | last post by:
Hi, I've got a complex Oracle-SQL-statement and I want to convert it to DB/ 2: INSERT INTO TBZL2000CSFLQ_AGG( Solve_Name, Scenario, Korrektur_KZ, EventDate,
1
by: thupham | last post by:
Hi all, For converting Oracle to SQL, I convert a table and all index in that table, but in SQL, if we have 4 columns, we can only create maximum 3 indexes, in Oracle is not, if we have 4...
1
by: hergele | last post by:
Hello all.. I am trying to convert an application which is working on Oracle to postgreSql.. I've seen a query in code something like this... select * from table1 a1 , table1 a2, table2 a3, ...
1
by: atp2k3 | last post by:
Hello all, I am new to convert PLSQL to TSQL. Any expertise in SQL, please help me to do convert the belowed PLSQL procedure to SP in SQL server. I really appreciate your time. Thanks in advance....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.