Results 1 to 7 of 7
  1. #1
    Join Date
    Sep 2003
    Location
    charlottetown, PEI
    Posts
    5

    Unanswered: running a sql file

    Hi, been awhile since I've been using oracle but I'm trying to run a sql file with about 200 inserts into a table but I can't seem to get it to work. I did this same procedure about 2 years previous and it worked fine. Here's how my file looks...

    Insert into type_of_bldg (record_num, category, data_value, display_value)
    values ( 997, '12', 308, 'Church with Sunday School')
    /
    Insert into type_of_bldg (record_num, category, data_value, display_value)
    values ( 996, '12', 408, 'Service Station')
    /

    I type @c:\bldg_list.sql (the name of the file) at the command prompt and I either get this... Input truncated to 3 characters
    unknown command "˙žI" - rest of line ignored.

    ... or when I try to run the code from sql plus I get this error...
    ERROR at line 3:
    ORA-00933: SQL command not properly ended

    Could some please help. I would like to run the sql file from the command prompt. I've checked the file and removed any tabs or excess spaces. Even the scripts I've ran before don't work now. Is something different about the latest version of oracle

    thanks

  2. #2
    Join Date
    Jun 2003
    Location
    West Palm Beach, FL
    Posts
    2,713

    Lightbulb

    Try this:

    Open (Edit) your script with NOTEPAD and see if there are any invalid characters and remove them.

    The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb

  3. #3
    Join Date
    Sep 2003
    Location
    charlottetown, PEI
    Posts
    5
    I've checked the file and there are no invalid characters. The file is posted above. It seems to think something is in the file but I don't know what.

  4. #4
    Join Date
    Apr 2003
    Location
    Greenville, SC (USA)
    Posts
    1,155
    As mentioned... Open file in notepad... Go to the end of each line
    and backspace (remove) any "spaces".
    Change the "/" to ";" and see what happens...

    HTH
    Gregg

  5. #5
    Join Date
    Sep 2003
    Location
    charlottetown, PEI
    Posts
    5
    tried it, if I put ; at the end of each line it gives me and invalid character error. I used the forward slash before successfully. I removed all spaces but still same error...

  6. #6
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1

    Re: running a sql file

    Originally posted by temacc
    Hi, been awhile since I've been using oracle but I'm trying to run a sql file with about 200 inserts into a table but I can't seem to get it to work. I did this same procedure about 2 years previous and it worked fine. Here's how my file looks...

    Insert into type_of_bldg (record_num, category, data_value, display_value)
    values ( 997, '12', 308, 'Church with Sunday School')
    /
    Insert into type_of_bldg (record_num, category, data_value, display_value)
    values ( 996, '12', 408, 'Service Station')
    /

    I type @c:\bldg_list.sql (the name of the file) at the command prompt and I either get this... Input truncated to 3 characters
    unknown command "˙žI" - rest of line ignored.

    ... or when I try to run the code from sql plus I get this error...
    ERROR at line 3:
    ORA-00933: SQL command not properly ended

    Could some please help. I would like to run the sql file from the command prompt. I've checked the file and removed any tabs or excess spaces. Even the scripts I've ran before don't work now. Is something different about the latest version of oracle

    thanks
    The file is probably in UNICODE (UTF-8). Try this: open it using Notepad and "Save As" using "ANSI" encoding option.
    ---
    "It does not work" is not a valid problem statement.

  7. #7
    Join Date
    Sep 2003
    Location
    charlottetown, PEI
    Posts
    5
    bingo, thanks for the help

Posting Permissions

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