Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

PLS-00103 error after declare in oracle procedure

719719Aug 27 2009 — edited Aug 28 2009
Hi, guys.

I have a simple stored proc. which got me PLS-00103 error. Try to search a solution, but not found.

24/12 PLS-00103: Encountered the symbol "LOOP" when expecting one of
the following:
:= . ( @ % ; not null range default character

If move BEGIN after declare: error will be:
9/1 PLS-00103: Encountered the symbol "DECLARE" when expecting one
of the following:
begin function package pragma procedure subtype type use
<an identifier> <a double-quoted delimited-identifier> form
current cursor external language
The symbol "begin" was substituted for "DECLARE" to continue.

156/4 PLS-00103: Encountered the symbol "end-of-file" when expecting
one of the following:
begin case declare end exception exit for goto if loop mod
null pragma raise return select update while with

LINE/COL ERROR
-------- -----------------------------------------------------------------
<an identifier> <a double-quoted delimited-identifier>
<a bind variable> << close current delete fetch lock insert
open rollback savepoint set sql execute commit forall merge
pipe



Here is:

CREATE OR REPLACE PROCEDURE my_SCHEMA.proc_purge_all_ned
(
bld_tran_type_cd IN VARCHAR2 DEFAULT NULL,
v_purge_age IN NUMBER DEFAULT NULL,
row_count IN INTEGER DEFAULT NULL
)
AS

DECLARE
TYPE PKG_RECORD IS RECORD
(
pkg_trkng_nbr VARCHAR2(12) DEFAULT NULL,
pkg_trkng_unique_id VARCHAR2(10) DEFAULT NULL
);

TYPE pkg_record_table IS TABLE OF PKG_RECORD
index by binary_integer;

stage_item_status pkg_record_table;

rec_nbr INTEGER := 0;

BEGIN
WHILE TRUE LOOP
INSERT INTO stage_item_status
SELECT DISTINCT sis.pkg_trkng_nbr,
FROM EC_NRB_SCHEMA.staging_item_status sis,
EC_NRB_SCHEMA.staging_control sc,
EA_SCHEMA.code cd
WHERE sis.pkg_trkng_nbr = sc.pkg_trkng_nbr
AND sis.pkg_trkng_unique_id = sc.pkg_trkng_unique_id
AND sc.cmplt_flg = 'Y'
AND sis.bld_tran_type_cd = cd.cd_id
AND sis.last_updt_dt <= TO_DATE(SYSDATE - CAST(cd.decode_desc AS INTEGER))
UNION
SELECT DISTINCT sis.pkg_trkng_nbr,
sis.pkg_trkng_unique_id
FROM EC_NRB_SCHEMA.staging_item_status sis,
EC_NRB_SCHEMA.staging_control sc,
EA_SCHEMA.code cd
WHERE sis.pkg_trkng_nbr = sc.pkg_trkng_nbr
... ....

rec_nbr := stage_item_status.COUNT;

IF ( rec_nbr < 1 ) THEN EXIT;
END IF;

...
...
-- CLEAR ALL RECORD IN temp table stage_item_status
stage_item_status.DELETE;
END LOOP;
END;
/

Comments

Ian G Clough

Hi James,
If you make the office's location the identifying attribute for the office (delete the other attribute as it's no longer required) and then your rules can look like this:
Screenshot 2022-04-28 at 10.07.09.pngScreenshot 2022-04-28 at 10.10.07.pngI'm not sure how you might infer other details about the office unless those could be shared rules.
Best regards
Ian

James Woon - Monad

Thanks for that suggestion!
In this case, I have used 'the office location' as an example entity attribute that needs to be populated. But unfortunately, the actually attribute are dates. So maybe something like the office's opening date. We also do need to maintain the identifier (XYZ1, ABC2, etc.).
Therefore, don't think the proposed solution would work :(

Richard Napier

Hello James,
Personally I wouldn't use inclusions. I would use Decision Services. Then I can create two separate decision services, in separate Workspaces, give users permissions, use the Viewer role or the Author role to let people view or edit the Decision Services. Generally I have much more control over them.
image.pngimage.pngI would create references in the OPM project to each of the decision services
image.png
image.png
And create entities to support ABC, XYZ and then the master entity to contain both
image.png
Then I would merge the two entities into one and copy over the location to the master entity.
image.png
image.pngJust my two cents
Have a lovely day

James Woon - Monad

Ah... Decision Services! Sad to say we're on Private Cloud 20C. 
Yes, this is probably the best solution for anyone looking to solve this issue.
(I tried to mark this as answered but it seems I chose 'Discussion' instead of 'Question' for this post)
As always, appreciate your contributions to the community, Richard!

Richard Napier

Ah, I see. I was confused by you saying you had a test project in 21D. Happy to help, James. Whether it be a discussion or a question :)

1 - 5
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Sep 25 2009
Added on Aug 27 2009
9 comments
37,051 views