It should be DatabaseExecute( sql, sts ) "sql" in this context is a variable name not a string constant. : I have a job that attempts to update the status of an Oracle table if it : meets certain criteria (see code below). When I run this job I get an : ORA-00900 error Invalid SQL statement. However, if I step through and : debug the job and copy the sql that is created to TOAD and run it, it : seems to work fine. Any ideas? : Thanks, : Jeff : ConcatEx "Update essbase_calc_audit Set status = 'HUNG', end_datetime = : sysdate ", & : "Where sequence_key IN ", & : "(Select sequence_key From essbase_calc_audit Where status = 'RUNNING' : ", & : "and (sysdate - start_datetime)*24*60 > 60)", & : sql : DatabaseExecute( "sql", sts ) : Note, I am doing some other things as well is why I wrote this as a JAL : script instead of just plain sql statement.
|