COPY INTO SNOWFLAKE IGNORE "/" - snowflake-cloud-data-platform

I wish to upload a file with field with text containing "\", but to ignore it while running COPY INTO.
e.g:
For the following field value: \"before!!\' not!!
I wish the data be loaded as :
"before!!' not!!
I have tried including ESCAPE='\\', Tried using FIELD_OPTIONALLY_ENCLOSED_BY='"',
and ESCAPE_UNENCLOSED_FIELD in all kind of variations, None of those options did the job.
Does anyone have any idea?
Thanks!

If you want to change the values of a field then you would need to do it as part of the SELECT statement e.g. using the REPLACE function.
This is documented here

Related

Remove extra brackets from JSON call in Integromat

I am running a HTTP call to bring back data in JSON format but this is bringing through an extra set of square brackets that is causing issues when i am trying to recognise the array. See screen shots.
I can remove the extra set manually in a JSON editor but need to try and find a way of doing this automatically as part of my call.
I am running the call through Integromat and have looked at using Regex but couldn't find the correct code combinations.
Any help or advise much appreciated.
You can use the replace function and insert the brackets that need to be found using regex pattern making sure you denote the bracket at the starting position and the bracket at the end of the string to be replaced with emptystring
Don't check "Parse Response" in HTTP Request module.
That way Data will be returned as long text
Use "Text Parser"'s "Replace", look for ^[|]$ and replace it with emptystring. Make sure you check "Global Match", otherwise it will only do to the first match only=[
3.Then just Parse Json from parsed(replaced) text
I think this article will help.
https://medium.com/#petr.hnilica/json-in-integromat-how-to-create-an-array-from-collections-with-the-same-structure-2991b985e03e

Looping with multiple variables in a URL using Postman

Using postman tool, I am trying to loop in multiple values in the place of a specific parameter 'memid' in the sample URL https://www.testdomain.com/login?memid=123
I have replaced the value '123' as {{id}} in the URL and then declared a single value '123' in Globals. It's working fine when I execute this. But, is there a way where I can loop the URL and replace the variable memid every time with some other predefined unique values? Should I be storing all the values in a separate csv file?? Thanks in advance.
You could take a look at using a Data file in the Collection Runner to help with this - More information can be found here.
https://learning.getpostman.com/docs/postman/collection_runs/working_with_data_files/

SSIS Foreach loop through text files with "crosswlk" in the name

In my Foreach loop I only want to process files that have crosswlk in the filename. Unfortunately this is in the middle of the filename and I can't do crosswlk.pgp.
I have Googled this a bunch and most solutions say to do some C# in a script task to accomplish this. It seems like I should be able to do this in the Foreach container, maybe in the Collection area with Expressions. But I'm having troubles finding any information about the various Properties in the Property Expressions Editor. What's the difference between the Name, FileSpec and FileNameRetrieval properties?
I thought I could do something like:
Property: Name
Expression: `FINDSTRING(#[User::SourceFilename],"crosswlk",1) > 0`
To me that's saying only process files where the filename has crosswlk in it. But that's not working. I did notice the word crosswlk always starts at the 13th character in the filename so I tried using substring, but no luck there either.
Is there a way to do filter the filenames this (or another) way, or is using C# the only way? Thanks very much!
According to the documentation, you should be able to use wildcards in the Files field.
Use wildcard characters (*) to specify the files to include in the
collection. For example, to include files with names that contain
“abc”, use the following filter: *abc*.
So, you should be able to use something like this: *crosswlk*
See here for more detail: https://learn.microsoft.com/en-us/sql/integration-services/control-flow/foreach-loop-container#enumerator-dynamic-options
If it is too hard to craft a usable wildcard then one option that might be of use is to use a FOREACH ADO Enumerator. First you "fill" a recordset Object Variable with all the filenames you want then you can loop through this.
You can fill the recordset object through a Script Task and use C# system.IO for interrogating the filesystem.
This is a handy way if you need to tightly control what files are processed (eg to prevent test files being loaded)

concatenate inside indirect excel formula

I've been looking for some way to dynamically reference another workbook of excel using concatenate and indirect. And just get more and more frustrated.
This is how my problem looks like.
Concatenate inside Indirect formula
How do I make my formula in cell 'B3' work?
From the picture it appears that you are missing an apostrophe at the beginning of your reference. It should look like this:
'D:\path\[Filename.xlsx]sheet 1'!$D$6
#REF! might as well be caused by just wrong filename. Please check it.
And finally: the referenced file must be open for this formula to work. Do not use INDIRECT() to extract data from other files stored somewhere in system - this is not possible and should be avoided because file references generated from text strings cannot be tracked from Data / Edit Links menu. You should consider using regular formula links to other files instead - you can easily refresh your references from said menu.

Can't upload to database if using ' symbol

this is probably an easy question but it is driving me mad. I have a form for users to add comments but if there is a ' symbol in the textarea then it will not upload.
I reckon it might have have something to do with the encoding. I am using phpmyadmin and the encoding for the textarea is utf8_gerenal_ci. But I can manually put this symbol into the database. It is only when it is uploaded through the form which has no character restrictions on the textarea.
There may be more symbols that cannot be uploaded. I don't want to have to stop users from using the ' symbol. Hopefully there is a simple answer even if it does make me look stupid. Thank you for your time.
You should do the changes on form part instead of database in this case.
See if this helps you -
How to pass apostrophies from text areas to MySQL using PHP
Try using addslashes() before sending form data to database.
eg. $str = $_POST['form_data];
$str = addslashes($str);
This function will escape all such characters which may cause problems while entering in db.
PLease read: http://php.net/manual/en/function.addslashes.php

Resources