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

172
Views
Cómo pasar el tipo de datos de matriz como argumento en el procedimiento de almacenamiento. Me gustaría pasar varios valores como parámetro de entrada

Estoy escribiendo el procedimiento de la siguiente manera. Pasar los valores como Array y vincularlos mientras se ejecuta el sql.

Al llamar al procedimiento (procedimiento de llamada proc_test1(array_construct('a','b'))) se obtiene un error de enlace de tipo de datos no compatible.

 create or replace procedure proc_test1(PRAM Array) returns varchar not null language JavaScript as $$ var step0='select value from table(flatten(input =>parse_json(:1))'; var statement0=snowflake.createStatement( {sqlText: step0,binds: [PARAM]} ); var res1 = statement0.execute(); while (res1.next()) { var column_val1 = res1.getColumnValue(1); try { snowflake.execute( {sqlText: "begin transaction;"} ); var step1=`insert into table1(column1,column2) select column1,column2 from table2 where column3=:1;` var statement1=snowflake.createStatement( {sqlText: step1,binds: [column_val1]} ); statement1.execute(); result="Succeeded"; snowflake.execute( {sqlText: "commit;"} ); }catch (err) { snowflake.execute( {sqlText: "rollback;"} ); result = "Failed: Code: " + err.code + "\n State: " + err.state; result += "\n Message: " + err.message; result += "\nStack Trace:\n" + err.stackTraceTxt; } return result; } $$
about 4 years ago · Juan Pablo Isaza
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!