in reply to Re: Use command line argument in script
in thread Use command line argument in script

Yes that makes sense, will remove trunc(date) and replace with date. 'date' contains datetime data so thought without trunc(date) it won't work.

Basically trying to accept parameter days at runtime, use it in DELETE

Delete all data from table which are older than -days parameter.
  • Comment on Re^2: Use command line argument in script

Replies are listed 'Best First'.
Re^3: Use command line argument in script
by chacham (Prior) on Dec 19, 2014 at 17:37 UTC

    Excellent. Got to think about the where clauses sometimes. They're not always obvious from the get go.

    As for using dynamic SQL, that is a security risk. You should really uses a parametrized query. Variables on the end of a statement are particularly bad.