• I think you're misunderstanding what is going on. The DECLARE CURSOR does use the variable as it's defined at the time when the DECLARE is issued. Meaning - in programmer terminology - the DECLARE CURSOR sets up and initializes the cursor in one statement. There's no deferred resolution going on. The only thing that hasn't happened yet is that the cursor hasn't been materialized (which occurs with the OPEN statement).

    In this case you get nothing, since at the time of the declare - the variable is NULL.

    This is normal behavior and to be expected.

    ----------------------------------------------------------------------------------
    Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?