quicktemplate
quicktemplate copied to clipboard
make it be a sql template
hi,I want make it be a best sql template like this: step1: define a sql template text select * from table where name=#name @if age>0 { and age=#age or name=#name @}
step2: when I give one param "name" with value "John",after call your quilktemplate,return a preparedstatment string sql, and a paramslist select * from table where name=? , [ John]
when I give two params "name=John" and "age=12",it should be like this:
select * from table where name=? and age=? or name=?, [John, 12, John]
I think it should be very usefull. thanks
@fxk2006 Have you tried sqlc ? It does this kind of thing but with many more useful features