Understanding pl/sql syntax Oracle 11g

Asked

Viewed 57 times

1

I have an Oracle PROC 11g. Inside proc has something like this:

v_prazo_subs_ans         ts_odo.odo_controle_sistema.val_parametro%type;

Where:

v_prazo_subs_ans is a variable

ts_odo.odo_controle_sistema is the table

val_parametro a field in the table

But I don’t know what that means: %type after the field name.

What the above line does or means?

1 answer

3


This %Type creates a variable with the same Type (type and size) as the field passed , in the val_parameter case of the table ts_odo.odo_controle_system , the advantage of this call and that if the type or size is changed the variable is automatically changed in the next routine execution avoiding truncation or type errors.

Classic example a field that was VARCHAR2(30) needed to pass to VARCHAR2(40) with the call by "%type" objects so defidos do not need to be reviewed.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.