-1
var run_id_query = `INSERT INTO STG.RUN_STATUS (RUNID,STATUS,STATUS_DESCRIPTION)
VALUES (TO_CHAR(CURRENT_DATE,'YYYYMMDD'),0,'RUN START')`;
var run_id_stmt = snowflake.createStatement({ sqlText: run_id_query});
var run_id = run_id_stmt.execute();

getting error SQL compilation error: syntax error line 3 at position 8 unexpected 'ID_DEV'.

insert is present in STG schema, i am trying to insert it from INT schema

Gokhan Atil
  • 9,278
  • 2
  • 11
  • 24
  • There is no limitation to updating the data in another schema. Can you share the whole script? The one you shared doesn't have anything with INT schema. – Gokhan Atil Sep 02 '22 at 07:15

1 Answers1

0

Could you break it down e.g.:

 run_id_query = $$INSERT INTO STG.RUN_STATUS (RUNID,STATUS,STATUS_DESCRIPTION) VALUES (TO_CHAR(CURRENT_DATE,'YYYYMMDD'),0,'RUN START')$$;
 execute immediate $run_id_query

enter image description here

Adrian White
  • 1,720
  • 12
  • 14