Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

211
Vistas
Numeric value '"+i+"' is not recognized At Statement.execute in snowflake stored procedure while executing below code?

Below is the stored procedure which uses for loop using 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 Respuestas
Responde la pregunta

0

Using bidning variables:

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 Denunciar

0

To substitute a variable into a template literal, 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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda