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!

initialize to null a varchar2 variable

EZGmsMay 22 2012 — edited May 22 2012
Hi,
I've developed the SP that I describe below:
  
CREATE OR REPLACE PROCEDURE P_INS_OPE       
  (
    NAME VARCHAR2
  , GROUP_ VARCHAR2
  , RESULT_ OUT NUMBER
  ) AS
  BEGIN
  DECLARE
    v_name VARCHAR2(50);
    v_group VARCHAR2(100);
    v_result NUMBER := 0;
  BEGIN
    v_name := NAME;
    v_group := GROUP_;
    
    INSERT INTO mr_ope(name, group_) VALUES (v_name, v_group)
    RETURNING id 
    INTO v_result;
    COMMIT;
    
    RESULT_ := v_result;
  END;
  END P_INS_OPE;
and I would like to know if is necessary to initialize in declare section the varchar2 variables
with a blank space like this?
 v_name VARCHAR2(50) := ' ';
 v_group VARCHAR2(100) := ' ';
thanks in advanced
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 19 2012
Added on May 22 2012
7 comments
2,706 views