www.webdeveloper.com
Results 1 to 4 of 4

Thread: SQL command not properly ended

  1. #1
    Join Date
    Mar 2013
    Posts
    2

    SQL command not properly ended

    Trying to run an update SQL statement to update students roommate information for the current semester and next semester and it throws a "ORA-00933: SQL command not properly ended" at me...

    Here is the statement that is failing:

    DECLARE
    current_semester varchar (4);

    BEGIN

    current_semester := '2131';

    update hawaii.a
    set user_def_text06 = ' ';

    UPDATE hawaii.a set user_def_text06 =
    (select my_bed FROM hawaii.b
    WHERE hawaii.b.unique_id = hawaii.a.special_id
    AND hawaii.b.termid = current semester)
    WHERE EXISTS
    (select my_bed FROM hawaii.b
    WHERE hawaii.b.unique_id = hawaii.a.special id
    AND hawaii.b.termid = current_semester)

    commit;
    end;
    .
    run;


    Can someone help me identify why is oracle giving the error:

    Thanks.

  2. #2
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,617
    I think you left out an underscore on this line?
    Code:
    WHERE hawaii.b.unique_id = hawaii.a.special id
                                               ^
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  3. #3
    Join Date
    Apr 2013
    Posts
    135
    I agree with nogdog,
    there is missing of underscore.
    WHERE hawaii.b.unique_id = hawaii.a.special id
    and here is missing of semi colon.
    AND hawaii.b.termid = current_semester)

    thank u

  4. #4
    Join Date
    Mar 2013
    Posts
    2

    Thank you

    Quote Originally Posted by NogDog View Post
    I think you left out an underscore on this line?
    Code:
    WHERE hawaii.b.unique_id = hawaii.a.special id
                                               ^
    Thank you...that was the fix...I got that after reviewing it again...

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles