#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2010
    Posts
    10
    Rep Power
    0

    Assign Local variable values to Global variable


    Hi Every body,

    Can anyone show me how to assign a local variable value to a global variable....
    Thank you
  2. #2
  3. Come play with me!
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    13,754
    Rep Power
    9397
    Do you have any intention of being more specific than that?
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2010
    Posts
    10
    Rep Power
    0
    Sure,

    I am writing a shell script that executes an sql query in a block.
    After execution the values are assigned to local variables with in the block.
    Now, I wanted to assign these local variables to Global variables.


    QUERY:

    select
    sum(case when b.product_license_id = 20 then 1 else 0 end) INTO MONTHLY_500_PLUS,
    sum(case when b.product_license_id = 21 then 1 else 0 end) INTO ANNUAL_500_PLUS,
    sum(case when b.product_license_id in(20,21) then 1 else 0 end) INTO TOTAL_PlusActive
    from tb_sub_option a

    Now I will get some values into MONTHLY_500_PLUS,ANNUAL_500_PLUS,TOTAL_PlusActive

    Now I wanted to assign these values to some GLOBAL variables.
    Is it possible

IMN logo majestic logo threadwatch logo seochat tools logo