在屬性文件中使用下面的查詢並在shell腳本中使用,但由於查詢中的特殊字符,它沒有給我輸出特殊字符。SQL查詢的轉義字符
query="select top 10 source_system,updt_etl_instnc_run_id,negative_posting_flag, to_number(to_varchar(to_date(create_tmstmp),'yyyymm')) as part_date from c_fin_a.gl_transaction_data where to_number(to_varchar(to_date(create_tmstmp),'yyyymm'))=$NOW and \$CONDITIONS"
我已經使用所有特殊字符的轉義字符,那麼它也不會給我同樣的輸出與轉義字符。
query= \ " select top 10 source_system,updt_etl_instnc_run_id,negative_posting_flag, to_number \ (to_varchar \ (to_date \ (create_tmstmp \) , \ ' yyyymm \ ' \) \) as part_date from c_fin_a.gl_transaction_data where to_number \ (to_varchar \ (to_date \ (create_tmstmp \) , \ ' yyyymm \ ' \) \)= \ $NOW and \ \$CONDITIONS \ "
我不明白的問題,這是不正確的,如果它是一個SQL查詢,那麼你應該有一個SQL標籤沒有殼標籤... – Seekheart