UNIX script to convert queries

Posted by Harish on Stack Overflow See other posts from Stack Overflow or by Harish
Published on 2010-04-06T03:54:59Z Indexed on 2010/04/06 4:13 UTC
Read the original article Hit count: 406

Filed under:
|
|

I need a UNIX shell script to convert my queries from Java compatible to Oracle compatible format. ie.

I have all the java compatible queries:

java:

SELECT a, b, c, d, e, f,g "+//    "from test where year(timestamp)=year(today) and month(timestamp)=month(today) " 
+//    "and day(timestamp)=2 and h='" + "W" + "'"

Oracle

SELECT a, b, c,d,e,f,g from test where year(timestamp)=year(today) and month(timestamp)=month(today) and day(timestamp)=2 and h='W'

Is it possible using sed or awk?

© Stack Overflow or respective owner

Related posts about shell

Related posts about script