All Questions
Tagged with snowflake-cloud-data-platform javascript
217
questions
0
votes
1
answer
93
views
Stored Procedure: add parameter for month or hour
I have the below Stored Procedure on Snowflake that sends out an email with all the load errors that exist in table SNOWFLAKE.ACCOUNT_USAGE.COPY_HISTORY for the last 24 hours. This is working ok but ...
3
votes
1
answer
33
views
Snowflake - .toISOString() incorrectly rounds timestamp in JS stored procedure
I've encountered a weird issue in Snowflake when using .toISOString() within a JavaScript stored procedure. The behaviour is very inconsistent and I'm suspecting this might actually be a bug.
In some ...
0
votes
2
answers
59
views
Not able to set the variable as column alias in create view in snowflake stored procedure
I am trying to create a view in snowflake stored procedure. I need one of the column from the variable. I tried following but getting following error,
Error
SQL compilation error:
syntax error line 4 ...
0
votes
0
answers
24
views
How to assign variables to the sql query logic fetched from a table in snowflake using JS
I have a table which has sql validation logic which I need to fetch in a loop and execute each rule id .
VALIDATION_RULES table has following columns : RuleID,SQL_Logic
Orchestration store proc: It ...
1
vote
1
answer
32
views
Insert results from js function to snowflake table
I have a js function, that prepares a query, then executes it on snowflake and stores the result in variable:
function objectGet(db, view, schema, object) {
const x = `select get_ddl('${view}',...
1
vote
1
answer
242
views
Snowflake JavaScript Stored Procedure Returns Success Despite Expected Failure
I've recently been experimenting with Snowflake's JavaScript stored procedures and encountered an unexpected behavior. I created a simple stored procedure as outlined in the Snowflake documentation ...
0
votes
0
answers
47
views
javascript stored procedure in snowflake logic
I have a snowflake table like this.
i want to have a SCD type 2 table based on the table shown above. The logic is, when
1.) ID's are the same
2.) data in the table on a given day is always the date ...
0
votes
0
answers
20
views
Unable to insert data in array field in snowflake table using javascript
let gpt3Embedding= async (content) => {
try {
const response = openai.embeddings.create({
model: "text-embedding-ada-002",
input: content,
...
0
votes
0
answers
45
views
How can I remove the possibility of SQL Injection while appending the binds a user submits in a API against Snowflake?
The end goal of my code is to query the database using the query variable with the binds submitted by the user.
It would be very helpful for logging to be able to see the actual values that were ...
0
votes
2
answers
39
views
How to iterate through table and insert records in corresponding table using for loop in javascript in snowflake?
Somehow my code only insert row 1 and colum1,2,3 records into output table.
unfortutely it doesn't insert records row2 onwards.
could someone please help?
unforutely my code only insert the first row'...
0
votes
1
answer
120
views
Write snowflake stored procedure in SQL and JS using for loop
Table contains the order data and has columns city, date, orders, total_sales.
Write a Snowflake procedure in SQL and JS containing 'For Loop ' to get the most grossing day( in terms of total_sales) ...
0
votes
1
answer
63
views
Not able to Parse a valid javascript Json object with \" to snowflake table using parse_json [duplicate]
I have the below json object as a json string
{
"type": "employee",
"details": [
{
"key": "name",
"value": &...
0
votes
1
answer
330
views
Unloading data from Snowflake to S3 bucket in xml format
I need to unload the data I have in Snowflake to S3 bucket to a file with .xml extension. In reality, the required output in not exactly .xml, but rather comma separated values enclosed in tag. But I ...
0
votes
0
answers
79
views
Rudderstack sdk support for multiple write keys
I am using rudderstack to connect two sources to two snowflake destinations for which I am using rudder-sdk-js npm package. In this there is a load method available for loading loading write key and ...
0
votes
0
answers
56
views
Query works when ran in SNOWFLAKE UI but when ran through a Stored Procedure. It gives Null records. What needs to be done?
This is the SNOWFLAKE QUERY which I want to run through Stored Proc.
REGEXP_SUBSTR(INTERNET_ADDRESS,
'[A-Z0-9\\!\\#\\$\\%\\&''\\*\\+\\/\\=\\?\\^\\_\`\`\\{\\|\\}\\~\\,\\-]+([\\.]?[...