Solved

Form crash in Julian date conversion

Posted on 2009-07-15
1
570 Views
Last Modified: 2013-12-19
Wheh I run this output in toad its ok. But when I run this in oracle forms 10g the form crashes.

In the form the field exp_date is date datatype. What might be the problem.

I also tried running with datatype datetime and giving a format mask of
DD-MON-YYYY HH24:MI:SS PM. Buit still oracle forms crashes. How to fix it? Thanks in advance
:rbc_irradiation_dtl.original_exp_date := to_char(TO_DATE(2000 + TO_NUMBER(SUBSTR(:rbc_irradiation_dtl.original_exp_date,1,3)) || '0101', 'yyyyddmm')

       + TO_NUMBER(SUBSTR(:rbc_irradiation_dtl.original_exp_date,4,3)) -1

       + TO_NUMBER(SUBSTR(:rbc_irradiation_dtl.original_exp_date,7,2)) / 24

       + TO_NUMBER(SUBSTR(:rbc_irradiation_dtl.original_exp_date,9,2)) / 1440,'DD-MON-YYYY HH24:MI:SS PM');
 

----------------------

select  to_char(TO_DATE(2000 + TO_NUMBER(SUBSTR('0092372359',1,3)) || '0101', 'yyyyddmm')

       + TO_NUMBER(SUBSTR('0092372359',4,3)) -1

       + TO_NUMBER(SUBSTR('0092372359',7,2)) / 24

       + TO_NUMBER(SUBSTR('0092372359',9,2)) / 1440,'DD-MON-YYYY HH24:MI:SS PM') as standard_date from dual

Open in new window

0
Comment
Question by:anumoses
1 Comment
 
LVL 73

Accepted Solution

by:
sdstuber earned 500 total points
ID: 24860019
when you use the outer TO_CHAR,  that converts the date to a string so it can be formatted.

from your previous questions I thought that is what you wanted
you can't actually format a DATE, only a string representing a date can have a format.

simply remove the outer to_char and then do your formatting with forms attributes


select TO_DATE(2000 + TO_NUMBER(SUBSTR('0092372359',1,3)) || '0101', 'yyyyddmm')
       + TO_NUMBER(SUBSTR('0092372359',4,3)) -1
       + TO_NUMBER(SUBSTR('0092372359',7,2)) / 24
       + TO_NUMBER(SUBSTR('0092372359',9,2)) / 1440 as standard_date from dual
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
Working with Network Access Control Lists in Oracle 11g (part 2) Part 1: http://www.e-e.com/A_8429.html Previously, I introduced the basics of network ACL's including how to create, delete and modify entries to allow and deny access.  For many…
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now