Nagendra Nigade February 2016

Error While Initializing Record Value

I have create a record in the package and declare variables of the type in one of the procedures of the package and when I try to initialize some value of the record I get the following error:

[Error] PLS-00103 (372: 14): PLS-00103: Encountered the symbol "." when expecting one of the following:constant exception <an identifier>
   <a double-quoted delimited-identifier> table long double ref
   char time timestamp

The Package Body As follows :

CREATE OR REPLACE PACKAGE BODY package_a
AS

TYPE location_details IS RECORD
(region_id VARCHAR(40),
lat VARCHAR2(10),
ranges VARCHAR2(5)
) ;


PROCEDURE do_actions (p_action_id IN NUMBER)
   AS

variable_1  location_details 

BEGIN
variable_1.ranges := '5';

END;
END package_a;

I am not able to identify the cause of error here.

Answers


vishnu sable February 2016

add ; after

variable_1  location_details;

in do_actions procedure.


Prashant Mishra February 2016

    CREATE OR REPLACE PACKAGE BODY APP.package_a
AS
TYPE location_details IS RECORD
(region_id VARCHAR(40),
lat VARCHAR2(10),
ranges VARCHAR2(5)
) ;

    enter code here

PROCEDURE do_actions (p_action_id IN NUMBER)
   AS
variable_1  location_details ;
BEGIN
variable_1.ranges := '5';
END;
END package_a;

Post Status

Asked in February 2016
Viewed 2,580 times
Voted 6
Answered 2 times

Search




Leave an answer