coverting lower to upper case program in sql server 2000

  • declare

    type v_arr is varray(10) of varchar empy.ename%type

    x_arr v_arr=v_arr()

    begin

    x_arr.extend

    x_arr(1)='hello'

    for i in 1..x_arr loop

    if(x_arr<=97 and x_arr>=122) then

    x_arr=x_arr-32

    end if

    end loop

    end

    expecting output:

    HELLO

    but the code showing error of:

    Server: Msg 155, Level 15, State 2, Line 2

    'v_arr' is not a recognized CURSOR option.

    Server: Msg 156, Level 15, State 1, Line 8

    Incorrect syntax near the keyword 'then'.

    what is the code ?????

  • What language is this that you are coding in?

    The absence of evidence is not evidence of absence.
    Martin Rees

    You can lead a horse to water, but a pencil must be lead.
    Stan Laurel

  • oracle plsql using on ms sql

  • Well you will need to change the PLSQL into T-SQL, but is there a reason you cant just use the UPPER function?

    SELECT UPPER('hello')

  • anthony.green (8/23/2012)


    Well you will need to change the PLSQL into T-SQL, but is there a reason you cant just use the UPPER function?

    SELECT UPPER('hello')

    At least he didn't try to write a CLR to do it. 😛

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply