• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

Varchar & Varchar2 in Stored procedure

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have created this stored procedure in Oracle:

CREATE OR REPLACE PROCEDURE get_product_code(prod_number IN VARCHAR) IS
CURSOR Get_code IS
<my_query_goes_here>
BEGIN
For Get_code_cur IN Get_code LOOP
DBMS_OUTPUT.PUT_LINE(Get_code_cur.name);
END LOOP;
END;


However, when i use SQL*Plus to view my stored procedure (command-->desc get_product_code'), i encountered the following:

Argument Name Type In/Out Default?
-------------------------- ------------------ ------ --------
PROD_NUMBER VARCHAR2 IN

I am curious why the type of the input parameter has been changed from VARCHAR to VARCHAR2?
 
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
may be it is deprecated. applying guess
 
author & internet detective
Posts: 42163
937
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As of Oracle 8, VARCHAR and VARCHAR2 are the same. However Oracle recommends using VARCHAR2 because VARCHAR may change in the future.

I'm not sure why it is changing it automatically for you though.
 
reply
    Bookmark Topic Watch Topic
  • New Topic