java - calling a parameterized function in a preparedstatement -
i attempting use jdbc preparedstatement insert data sql server 2008 database. difficulty i'm running have point-in-time ids subject change, , need constant id based on other elements of insert. have written stored function perform lookup, myidlookup(x,y).
i tried writing preparedstatement this:
insert mytable (id,idelement1,idelement2,otheritem) values (myidlookup(?,?),?,?,?) i have seen examples using built in functions such now(), haven't seen using parameterized functions in preparedstatement. possible?
thanks
i think right way of doing write stored proc insert rows takes x , y , generates id calling myidlookup ad inserts row too. template may :
stored proc insertrow (x, y, z) { id = myidlookup(x , y) insert table values (id, x , y, z) }
Comments
Post a Comment