Hi,
I have written a sql query in bash script when I try to run I am getting
error
Below is script :
> SELECT
> SUBSTR(CAST(`columns`[2] AS VARCHAR(50)), 1, 6 + POSITION('.' IN
> `SUBSTR`(CAST(`columns`[2] AS VARCHAR(50)), 8))) AS `Col2`,
> TO_NUMBER(`columns`[3], '##########') AS `Col3`
> FROM `dfs`.`default`.<path to file >;
Tried couple of solutions to handle special character :
1. Surrounded the query with " " (read as double quotes )
2.back slash the special characters like
> POSITION('\.'
> '\##########')
3.Surround the special characters with double quotes like
POSITION("."
"##########")
Nothing worked :(
Appreciate the help !
Thanks,
Divya
|