ahmet
August 31, 2009, 11:16am
1
"INSERT INTO CBM_CT_BY_CLT ( "
" CST_CD, "
" BLK_REG_SEQ, "
" BLK_REG_DT, "
" DEL_FLG "
") "
"VALUES ( "…
how can I get the table name(CBM_CT_BY_CLT) and column name ( CST_CD
…) from this sql script?
It contains spaces and the script is line by line.
I am trying like this but it is no useless
columnname = text.scan(/"\s+(.*?)\s+"\/)
please help…
ahmet
August 31, 2009, 12:05pm
2
Ahmet K. [email protected] writes:
It contains spaces and the script is line by line.
I am trying like this but it is no useless
columnname = text.scan(/“\s+(.*?)\s+”\/)
You will have to write a SQL parser.
Of course, you may try to do a half-assed job with regular
expressions, but SQL is a language with a context-free grammar, so you
need a parser.
ahmet
September 1, 2009, 5:59am
3
Pascal J. Bourguignon wrote:
Ahmet K. [email protected] writes:
It contains spaces and the script is line by line.
I am trying like this but it is no useless
columnname = text.scan(/“\s+(.*?)\s+”\/)
You will have to write a SQL parser.
Of course, you may try to do a half-assed job with regular
expressions, but SQL is a language with a context-free grammar, so you
need a parser.
I think SQL parser is very deep for me.
I got it with regex. Thank you very much.