Re: Need help with DATE and Forms 5.0

From: Neville Sweet <sweet.neville.nj_at_bhp.com.au>
Date: Wed, 29 Sep 1999 17:24:42 +1000
Message-ID: <7sseti$9ua22_at_atbhp.corpmel.bhp.com.au>


Hi Jim,

Is your item's datatype in the property sheet set to 'datetime'? Problems with time trunction are usually due to the datatype being set to 'date'. Then again, as you say, it displays correctly... If you are calling the program unit in Enter-Query mode then check the Query Length property.

Also, in a Forms' PLL it's better to avoid hard-coding 'MYBLOCK.TIME_STAMP' by using:
val := name_in ( :System.Trigger_Item);
or by passing the name of the item to the library program unit as an IN parameter and then using:
val := name_in (your_text_string);
where your_text_string contains the name of the date parameter.

Jim West wrote in message ...
> I have a table with a field of type DATE.
>
> In a PL/SQL library program unit I have a statement:
>
> val varchar2(20);
>
> val := name_in ( 'MYBLOCK.TIME_STAMP' );
>
>This returns the date/time as:
>
> DD-MMM-YYYY
>
>note there is no time.
>
>So...I try the following:
>
> val date;
>
> val := to_date ( name_in ( 'MYBLOCK.TIME_STAMP' ), 'MM/DD/YYYY
>HH24:MI:SS' );
>
>I get the error ORA-06502 "PL/SQL: numeric or value error"
>
>...so I try modifying the above call to:
>
> val := to_date ( name_in ( 'MYBLOCK.TIME_STAMP' ) );
>
>...and I get the same error.
>
>Would some kind soul point me in the right direciton. I need to get
>the value in MM/DD/YYYY HH24:MI:SS format.
>
>I do have this format mask on the form field and the date/time does
>indeed display correctly on the form. I'm just not able to get that
>format with the built_in name_in function.
Received on Wed Sep 29 1999 - 09:24:42 CEST

Original text of this message