Forum Stats

  • 3,839,855 Users
  • 2,262,546 Discussions
  • 7,901,081 Comments

Discussions

Spooling script with /*insert*/ hint gives an incorrect output

User_ZZQ0F
User_ZZQ0F Member Posts: 34 Green Ribbon

Hello,

I am trying to use VS Code add-on to spool INSERT scripts. As instead I get the incorrect output.

When I use the same script using SQL Plus, I get the correct output containing INSERT scripts.

The code:

show serveroutput
set sqlblanklines on
set heading off
set linesize 10000
set long 90000

-- not available in VSCode
-- set ddl pretty on
-- set ddl storage on
-- set ddl segment_attributes on
-- set ddl tablespace on
-- set ddl sqlterminator on
-- set pages 999 
-- set longchunksize 1000

spool %userprofile%\Desktop\log_results.sql;
SELECT /*insert*/ * FROM CO_RDP_PROJECT where dwh_id < 0;
spool off;

It looks like the add-on is ignoring the /*insert*/ hint.

Could you please try to fix it?

Best Answer

  • Christian.Shay -Oracle
    Christian.Shay -Oracle Posts: 2,168 Employee
    edited Nov 16, 2021 9:59PM Answer ✓

    Hi,

    Are you sure you got this working with SQL*Plus (and not sqlcl)? As far as I know this is a feature of SQLCl/SQL Developer and not SQL*Plus. I just tried it with SQL*Plus and it doesn't do anything other than output the rows.

    We support (limited) SQL*Plus syntax with this extension although if a SQLCl enhancement is popular enough we might be able to add it.

Answers