plsql - PLS-00103 error when creating object type -
i trying create , assign variables using following code create object types in plsql (11g) facing errors:
begin execute immediate 'drop type picu_obj force'; execute immediate 'drop type picu_obj_tab force'; execute immediate 'create type picu_obj object(customer_id varchar2(32767),customer_name varchar2(32767),server_name varchar2(32767),time_stamp varchar2(32767))'; execute immediate 'create type picu_obj_tab table of picu_obj;'; picu_var picu_obj_tab; picu_var := picu_obj_tab(picu_obj('101','xyz','pro-ssr-qr','12:13')); end; above code gives following errors: error @ line 6: ora-06550: line 6, column 10: pls-00103: encountered symbol "picu_obj_tab" when expecting 1 of following: := . ( @ % ; symbol ":=" substituted "picu_obj_tab" continue.
please suggest doing wrong here.
there 2 problems code:
first: in oracle 11g can not use varchar2(32767)
maximum length 4000 varchar
there. if code did run, wouldn't create types.
secondly: pl/sql code validated/compiled when run it. use dynamic sql create types, pl/sql compiler can't see types when tries compile lines:
picu_var picu_obj_tab; picu_var := picu_obj_tab(picu_obj('101','xyz','pro-ssr-qr','12:13'));
and that's error seeing.
you have create types before run pl/sql code uses them.
Comments
Post a Comment