Results 1 to 4 of 4

Thread: Review my 1st SP, Plz

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2001
    Location
    India
    Posts
    276

    Review my 1st SP, Plz

    hi,
    This is my first step to learning to write Stored Procedures. Can some one review this and help me improve in writing more efficient code? Please correct me if there's some wrong usage or
    a better way to have programmed the same. I have attached the SP in the text file beneath.
    This SP accepts 4 input parameters and returns 2 output parameters (lOEmp and A_EMP_IVC). Of the 4 I/p parameters, only one (bUnderPaid) is mandatory. The 2 dates (dtWeekBeign and dtWeekEnd) should both be present or neither. If the dates aren't passed then the Employee Number (lOEmp) has to be passed. This validation will be taken care of at the user interface. I execute the SP as this:
    Code:
    Declare @A_EMP_IVC  INTEGER
    Declare  @O_EMP INTEGER
    EXEC hr_spX0002Q @lOemp=1313, @bUnderPaid='FALSE', @A_EMP_IVC =@A_EMP_IVC OUTPUT, @O_EMP = @O_EMP OUTPUT
    PRINT @A_EMP_IVC
    PRINT @O_EMP
    thanks,
    Jemima.

  2. #2
    rickm
    Guest

    Not bad at all...

    Only a few things that might make a difference depenging on your settings, otherwise, looks pretty good.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2001
    Location
    India
    Posts
    276
    Thanks Rick, thats encouraging. An' thanks again for taking some time thru that code...

    - Jemima.

  4. #4
    rickm
    Guest
    Originally posted by JemimaChadwick
    Thanks Rick, thats encouraging. An' thanks again for taking some time thru that code...

    - Jemima.
    Sure, any time.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width