drill-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Divya Gehlot <divya.htco...@gmail.com>
Subject handle special characters in query in bash script
Date Thu, 21 Sep 2017 10:26:51 GMT
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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message