Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

203
Views
El valor numérico '"+i+"' no se reconoce en Statement.execute en el procedimiento almacenado de copo de nieve mientras se ejecuta el siguiente código.

A continuación se muestra el procedimiento almacenado que utiliza for loop usando java script

 create or replace procedure test() returns varchar language javascript execute as caller as $$ for (var i = 1; i<= 10; i++) { var command8=` update table a set a.c1='some' from table b where a.source='gg' and b.c2=a.c2 and b.c3=a.c3 and (datediff(year,date(a.etl_create),current_date())= '"+i+"')` var stmt8=snowflake.createStatement({sqlText: command8}); var rs8=stmt8.execute(); }
about 4 years ago · Santiago Trujillo
2 answers
Answer question

0

Uso de variables de oferta :

 for (var i = 1; i<= 10; i++) { var command8=` update table a set a.c1='some' from table b where a.source='gg' and b.c2=a.c2 and b.c3=a.c3 and (datediff(year,date(a.etl_create),current_date())= :1)` var stmt8=snowflake.createStatement({sqlText: command8, binds:[i]}); var rs8=stmt8.execute(); }
about 4 years ago · Santiago Trujillo Report

0

Para sustituir una variable en un literal de plantilla, use ${variable} .

 var command8=` update table a set a.c1='some' from table b where a.source='gg' and b.c2=a.c2 and b.c3=a.c3 and (datediff(year,date(a.etl_create),current_date())= '${i}')`
about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!