Posterous theme by Cory Watilo

AWK ami SQL-t generál, ami SED-t generál

{
        HSZSZ=substr($0,26,24)
        BISTA=substr($0,166,1)
        STAK=substr($0,311,3)
        BBD=substr($0,319,11)
        if ( STAK=="UJ " && BISTA != "A" && ( BBD == 0 || BBD ~ /^ *$/ ) ) {
                print "select '" NR " s/^\\(.
\\{296\\}\\).\\{11\\}/\\1'||to_char(x.insur_fee,'999999999.00')||'/' from TABLA x where giro_acct = '" HSZSZ "';"
        }
}

És elsőre jól működött. Még betehettem volna az automatikus sqlplus és sed hívást. De mindennek van határa...