cancel
Showing results for 
Search instead for 
Did you mean: 

$ in sql statement

Sangeethak
New Contributor

I have a sql statement in snowflake execute snap.

“copy into table table_name from
(select t.$1,
t.$2,
t.$3
from file x(file_format=>'csv_format)t)”

I keep getting errors because of $ in the sql. Can anyone suggest how to enclose $ in the sql

3 REPLIES 3

bojanvelevski
Valued Contributor

I’m not sure, showing the actual error would be much more helpful. But I think turning your Expressions button on, will do the job.

I’m guessing that it is turned off and your columns are considered as incoming fields.

If this is not the case, please share more details about the error.

dmiller
Admin Admin
Admin

See also the SQL Substitution section on https://docs-snaplogic.atlassian.net/wiki/spaces/SD/pages/1438163/Parameters+and+Fields#Parametersan...


Diane Miller
Community Manager

ForbinCSD
Contributor

Sangeetha:

I agree with @bojanvelevski - please show the actual error you’re getting.

Also, most of us here are not familiar with snowflake, so it would also help to understand your intent. I can see 4 possibilities (at least):

  1. Are “$1”, “$2”, and “$3” the actual literal column names in your DB (the dollar signs actually appear as part of the names)?
  2. Or are these intended as “bound parameters”? (TTBOMK, SnapLogic doesn’t handle bound parameters in any flavor of SQL snaps.)
  3. Or are they properties in a document in the incoming document stream?
  4. Or, are they pipeline arguments? (In which case you need the leading underbar not the dollars sign.)