3 Replies Latest reply: Jun 14, 2013 3:17 PM by rp0428 RSS

    Export Insert Statement with Column Name as Comment

    525401

      I was to export data from SQL Developer with the column names as a comments in the values section.  I don't see this as an option anywhere.  It makes it easier to manage large table inserts.  Anyone know how to do this?  I seem to remember it doing it by default at some point....

        • 1. Re: Export Insert Statement with Column Name as Comment
          rp0428

          DanU wrote:

           

          I was to export data from SQL Developer with the column names as a comments in the values section.  I don't see this as an option anywhere.  It makes it easier to manage large table inserts.  Anyone know how to do this?  I seem to remember it doing it by default at some point....

          What 'export' are you talking about?

           

          What 'values section' are you referring to?

           

          Post a sample of what you expect the result to be and the EXACT steps you are trying to take to do this 'export'.

          • 2. Re: Export Insert Statement with Column Name as Comment
            525401

            When you query and then right click on the results you can export to multiple formats including insert statements.  What I'd like the result to look like is the following:

             

            insert into test_table

            (col_a,

            col_b)

            values

            ('x',  -- col_a

            'y'  -- col_b

            )

             

            That way if you have 50+ columns you can easily identify which value is being inserted where.

             

            I think what I was remembering was the syntax that SQL Developer uses for procedure calls.  Which doesn't seem to work for inserts

             

            TEST_PROC(

                PARAM1 => PARAM1,

                PARAM2 => PARAM2,

                PARAM3 => PARAM3

              );

            • 3. Re: Export Insert Statement with Column Name as Comment
              rp0428

              Thanks for the clarification. You are talking about 'unload'.

               

              No - there is no way to add those 'comments' to the code.

               

              The code you get already includes the column list; even your example above includes it. So not sure why you think putting every column on a separate line and adding the column name as a comment is useful. Generally it will only bloat the file more than it already is.