6 Replies Latest reply: Dec 13, 2012 7:43 AM by 971895 RSS

    SQL*loader error

    969952
      Hi ALl I am getting below error while executing control file.Please have a look.

      SQL*LOADER - 350 syntax error at line 11

      please have a look into the code.
      ---   Data Load ---
      LOAD DATA
      INFILE 'C:\Users\Desktop\States.csv'
      --BADFILE  'C:\Users\Desktop\States.bad'
      --DISCARDFILE 'C:\Users\Desktop\States.dsc'
      INTO TABLE <Table_name>
      fields terminated by ','
      optionally enclosed by '"'
      (
      Territory,
      State Name,
      State Code,
      State Grade ,  ( this is Number data type)
      City Name,
      City GLC, --Number data type ( here I mentioned the data types for your reference)
      County GLC  ---Number
      )
      
      COMMIT;
      
      {code}
      
      Please have a look and do needful.
      
      Thanks.
      
      commit;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
        • 1. Re: SQL*loader error
          stratmo
          Hi,

          shouldn't you comment this
          ...
          ...
          State Grade ,  ( this is Number data type)
          ...
          ...
          better like
          ...
          ...
          State Grade ,  -- this is Number data type
          ...
          ...
          as you did further down.

          Bye

          stratmo
          • 2. Re: SQL*loader error
            969952
            for your reference Here I mentioned... after executing the SQL*Loader Control file getting the below error..
            SQL*Loader-350: Syntax error at line 12.
            Expecting "," or ")", found "Name".
            State Name,
                  ^
            Thanks.
            • 3. Re: SQL*loader error
              John Spencer
              Ther may be other erros, but you definitely need to get rid of the spaces in the field names.

              John
              • 4. Re: SQL*loader error
                stratmo
                Hi,

                if you really want spaces in your column-names, then you have to enclose those column names with ".
                The problem with the missing "--" should remain.

                And we both learned: It is important to post the whole error-message.

                Bye

                stratmo

                PS: Sorry John, hadn't seen your post as I started mine.

                Edited by: stratmo on Dec 12, 2012 7:20 PM
                added "PS:"
                • 5. Re: SQL*loader error
                  971895
                  below columns contain space, that's why it's not reconigezed the fields... instead of space add the under and try...
                  State Name,
                  State Code,
                  State Grade ,  ( this is Number data type)
                  City Name,
                  City GLC, --Number data type ( here I mentioned the data types for your reference)
                  County GLC  ---Number
                  • 6. Re: SQL*loader error
                    971895
                    Typo error
                    instead of space add under score character..