We help IT Professionals succeed at work.

Oracle

gupshup
gupshup asked
on
4,579 Views
Last Modified: 2013-11-05
(part1)
CREATE OR REPLACE
PROCEDURE G_L (p_job          in integer,
                        p_f_             in varchar2,
                        p_sysid     in varchar2,
                        p_aperiod          in varchar2,
                        p_nk              out varchar2,
                        p_count out number,
                        p_unt  out number,
                        p_ out number,
                        p_cefm  out number,
                        p_user_id             out varchar2  )

IS
(part2)
link                  varchar2(20)                       := null ;
k_status           varchar2(2000)                    := 'UNAVAILABLE' ;
atement           varchar2(2000)                     := null ;
_id               integer                            := null ;
xecuted           integer                            := null ;
serted           number                             := 0 ;
ode                STATUS.FODE%type               := null ;
  ode                GENERAL_LEDGERS.FSN_CODE%type      := null ;
  report_id        STATUS.SYSTEM_REPORT_ID%type       := null ;

(part1 - can you please tell me what the out number refers to and the in varchar.  Aslo the create or replace and IS.  What is the difference in the code in part1 and part2, my understand is that both are initializing variables however they look different.  Also what is the :=null refer to.
Comment
Watch Question

CERTIFIED EXPERT
Most Valuable Expert 2012
Distinguished Expert 2019

Commented:
Part 1:
Create or replace is the designation to do just that:  create the procedure if it doesn't exist or replace it if is does.

The variables in between the parenthesis like p_job are the arguments for the procedure.  These parameters can be input, output or both.  Hence the 'IN' and 'OUT' that you are asking about.

Part2:
These are declaring local variables for use in the procedure.  the ":= null" is setting a DEFAULT value of NULL for the variable (this is kinda redundant since that is the default value).

Author

Commented:
Can you please tell me the differnece in the variables in paranthes when you say arguments versus the local variables.  I am familiar with variables in general however not with arguments vs. local variables.  Thanks.
Senior Oracle DBA
CERTIFIED EXPERT
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
johnsoneSenior Oracle DBA
CERTIFIED EXPERT

Commented:
Arguments are basically variables that are passed into the procedure.  Local variables only exist within the procedure.

Author

Commented:
Sorry I meant the split the points.  Both solutions were helpful.  Does anyone know how to change this?  I did not notice the new suggestion was a differnet person.  
CERTIFIED EXPERT
Most Valuable Expert 2012
Distinguished Expert 2019

Commented:
No problem.  We both said basically the same thing.  I'll let johnsone have this one.
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.