Title: RE: Invalid number of arguments

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
>
> I have a procedur, and when i compile it I get the erro rmessage
> "Invalid number of arguments in call..."
>
> It stops at the line:
>
> vDELIVERY_STOP_DATE:= lpad(nvl(recCursor.DELIVERY_STOP_DATE,0),8,'0');
>
> The datatype declaration in pl/sql is varchar2 for the field
> but in the database it is datatype DATE for that corresponding field.

If I understand you correctly, vDELIVERY_STOP_DATE is type VARCHAR2 but recCursor.DELIVERY_STOP_DATE is type DATE?
To format dates you should use the to_char function. Look it up in a manual.
Here's an example:

SQL> set serveroutput on
SQL> declare
  2     x varchar2 (8) ;
  3     y date ;
  4     null_date constant varchar2 (8) := rpad ('0', 8, '0') ;
  5  begin
  6     y := to_date ('19670528', 'YYYYMMDD') ;
  7     x := nvl (to_char (y, 'YYYYMMDD'), null_date) ;
  8     dbms_output.put_line ('x is <' || x || '>') ;
  9     y := null ;
 10     x := nvl (to_char (y, 'YYYYMMDD'), null_date) ;
 11     dbms_output.put_line ('x is <' || x || '>') ;
 12  end ;
 13  /
x is <19670528>
x is <00000000>

PL/SQL procedure successfully completed.

Reply via email to