Home » Developer & Programmer » Forms » affectation de sysdate avec format ('DD/MM/RRRR HH24:MI:SS') à un item (3 merged) (oracle/forms 6i)
affectation de sysdate avec format ('DD/MM/RRRR HH24:MI:SS') à un item (3 merged) [message #685003] Thu, 07 October 2021 05:55 Go to next message
Boumati
Messages: 21
Registered: November 2019
Junior Member

Bonjour tout le monde,

Je développe sous forms 6i et je viens de constater un fait extrèmement surprenant.
Lorsque j'affecte la valeur de SYSDATE à une quelconque colonne d'une de mes tables, les heures, minutes et secondes sont systématiquement à 0.

exemple :

:B1.ST_DATMOD := TO_DATE(SYSDATE, 'DD/MM/RRRR HH24:MI:SS');
MSG_BOX('MAJ de ST_DATMOD := ' || TO_CHAR(:B1.ST_DATMOD, 'DD/MM/RRRR HH24:MI:SS') );

merci.
affectation sysdate with format 'DD/MM/RRRR HH24:MI:SS' to an item [message #685004 is a reply to message #685003] Thu, 07 October 2021 06:03 Go to previous messageGo to next message
Boumati
Messages: 21
Registered: November 2019
Junior Member

hi,


i've a problem with this affectation : B1.ST_DATMOD := TO_DATE(SYSDATE, 'DD/MM/RRRR HH24:MI:SS');
the resulte gives 0 value to hours, minutes and seconds .
could you please help me to find the solution.

best regards.
affectation sysdate() to item type date using format TO_DATE(SYSDATE, 'DD/MM/RRRR HH24:MI:SS') [message #685005 is a reply to message #685003] Thu, 07 October 2021 06:58 Go to previous messageGo to next message
Boumati
Messages: 21
Registered: November 2019
Junior Member
hi,

I need a help to resolve a problem of affectation data (format date) to an item .

ex :

blokname.delivery_date:=TO_DATE(SYSDATE, 'DD/MM/RRRR HH24:MI:SS');

in the result the values of Hours, minutes and seconds for the item delivery_date are every time 0 ;

example : 10/07/2021 00:00:00


thanks a lot.

Re: affectation sysdate() to item type date using format TO_DATE(SYSDATE, 'DD/MM/RRRR HH24:MI:SS') [message #685017 is a reply to message #685005] Sat, 09 October 2021 04:55 Go to previous message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
SYSDATE is a function that returns DATE datatype. Applying TO_DATE function to it is just wrong. If you want to format it, then use TO_CHAR instead, e.g.

:blokname.delivery_date := to_char(sysdate, 'dd/mm/yyyy hh24:mi:ss';
It presumes that DELIVERY_DATE field's datatype is char. If it is date, then you'd just

:blokname.delivery_date := sysdate;
and apply desired format mask to the field itself (in its property palette).

[Updated on: Sat, 09 October 2021 04:56]

Report message to a moderator

Previous Topic: Comparing forms from 2 different folders
Next Topic: WHEN-BUTTON-PRESSED event issue
Goto Forum:
  


Current Time: Wed Dec 11 15:10:29 CST 2024