Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Problems with Select Max on Date Field
Are you aware that your text is loading about 950 characters into variable v_sql_statement? If you don't have it defined as varchar2(1000) or larger, then that is the problem.
If I were writing the code, I would put quotes around each line and use concatenation. This would eliminate your unnecessary blank padding in the actual SQL statement.
For example:
v_sql_statement
:='SELECT e.emp_number, e.name, p.acct_number, 'Received on Fri Feb 27 1998 - 00:00:00 CST
|| 'a.description, a.account_owner, '
|| 'p.percent_budgeted, p.effective_date '
|| 'FROM employees e, accounts a, primary_accounts p '