Converting HH24:MI:SS to seconds Issue

Hallo Everyone,
I’m fairly new (read: about 2 days) to the whole PL/SQL world and I’ve run into a little problem with one of my projects. I’ve googled and looked around the forums and tried to apply what I have picked up but so far without much success.
The general situation is as follows:
I am creating a .bat file which will take data from a comma separated file and “upload” the data into a table of my choosing. However, in the file I’m trying to “upload”, one of the columns contains a time value of the type HH24:MI:SS (for example: 0:05:32). The column sequence in the file matches that of my table and the .bat file.
My standalone table for testing this conversion looks like this:
Table: Conversion_Test
Column Name          Data Type     
AUTO_ID          NUMBER (12)     
TIME               NUMBER (12)     
WORKING          VARCHAR2 (32 Byte)
UPLOAD_DATE      DATE
The columns AUTO_ID and UPLOAD_DATE are filled by triggers which have been tried, tested and found to be working just fine. My test file contains 1 row of raw data (no headers or other information is present).
I have managed to convert the HH24:MI:SS into seconds through the SQL*Plus interface with the following query:
SELECT
sysdate, to_number(substr('00:05:32',1,2)*3600 + substr('00:05:32',4,2)*60 + substr('00:05:32',7,2))
from dual
Which returns the correct result:
SYSDATE
TO_NUMBER(SUBSTR('00:05:32',1,2)*3600+SUBSTR('00:05:32',4,2)*60+SUBSTR('00:05:32
23-10-08
332
Potential Relevant Content off .bat file (not all of it):
LOAD DATA                          
INFILE "dat\%date%.dat"                          
Append                                        
INTO TABLE Conversion_Test                          
FIELDS TERMINATED BY ';'                                        
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX*
Working
* XXXXXXXX = Location of relevant statement.
I have tried duplicating the results from my sysdate query with the following statements:
1. Time "to_number(substr('Time',1,2))*3600" + "to_number(substr('Time',4,2))*60" + "to_number(substr('Time',7,2))",
This generates the following error message:
SQL*Loader-350: Syntaxiserror in row 7.
"," of ")" expected, "+" found.
Time "to_number(substr('Time',1,2))*3600" + "to_number(substr('Time' ^
2. Time “to_number(substr('Time',1,2))*3600 + to_number(substr('Time',4,2))*60 + to_number(substr('Time',7,2))",
3. Time "to_number(substr('Time',1,2))*3600 + (substr('Time',4,2))*60 + (substr('Time',7,2))",
These generate the following error message:
Record 1: denied – error in table CONVERSION_TEST, Column TIME.
ORA-01722: invalid number
4. Time "to_number(substr('Time',1,2))*3600 + (substr('Time',4,2))*60 + (substr('Time',7,2)) from dual",
This generates the following error message:
Record 1: denied – error in table CONVERSION_TEST, Column TIME.
ORA-00917: missing comma
Question: What I want to do is convert this HH24:MI:SS “format” into seconds and then put them into a numbers column in my table by running the .bat file.
I hope I have provided enough information to give you a good insight into the problem and potential solutions.
With regards,
Luhaine
Edited by: user10465140 on 23-okt-2008 7:28
Edited by: user10465140 on 23-okt-2008 7:30
Edited by: user10465140 on 23-okt-2008 7:30
Edited by: user10465140 on 23-okt-2008 7:33 - Clearafication and Clean up.

This keep getting weirder and weirder.
The reason why I am using a .bat file is because the end user of this little upload procedure is going to be someone who's SQL capabilities are that of a monkey (at best). So it needs to be relativly simple (think basic console window where one has to put in his password before uploading starts).
In the .bat file I basicly echo every line to the control file and establish a connection with username to the database where the target table is located. See below for snippets from the .bat file. Inspired with new hope that you managed to pull it off I went forth and replicated your table and query. Alas to no avail.
I use the same source data.
.dat file:
0:05:32
23:43:23
22:43:23
10:00:00
11:00:00
12:00:00
7:20:00 I use basicly (don't see why or how the difference could create this problem) the same ctl file:
echo LOAD DATA                                                          >>loaddata.ctl
echo    INFILE "dat\%date%.dat"                                         >>loaddata.ctl
echo      Append                                         >>loaddata.ctl
echo    INTO TABLE Conversion_Test                                       >>loaddata.ctl
echo    FIELDS TERMINATED BY ';' OPTIONALLY ENCLOSED BY '"' TRAILING NULLCOLS           >>loaddata.ctl
echo    (                                           >>loaddata.ctl
echo ACTUAL                                         >>loaddata.ctl
echo ,secs "to_number(to_char(to_date(:ACTUAL, 'HH24:MI:SS'), 'SSSSS'))"               >>loaddata.ctl     
echo    )                                                           >>loaddata.ctl
echo off
cls
echo  Enter your database password:
sqlldr userid=xxxx@yyyy control=loaddata.ctl log=log\Data_Extract_Nummer_Periode_%date%.log
echo on
{code}
The same table build.
{code}
Naam                                Null?         Type
ACTUAL                                             VARCHAR2(10)
SECS                                                  NUMBER
{code}
This is what I get :(
{code}
ACTUAL    SECS
      0           0
      2        7200
      2        7200
      1        3600
      1        3600
      1        3600
      7      25200
{code}
So I'm clueless as to why you would get the proper results and I'm stuck with these weird ones.
I've been on track to another possible sollution to the issue by using the replace and ldap function to remove the "":" from the time, supplement it to a 6 digit number, then use positions to calculate the total amount of seconds. I've only begun exploring this one a while ago.
PS. How do you format your tables so nicely without them going haywire with the ultra amoutn of breaks additions that rich text mode seems to do.
Edit:
I've just spotted something. The line:
FIELDS TERMINATED BY ';' OPTIONALLY ENCLOSED BY '"' TRAILING NULLCOLS
Is not getting echo'd to the control file. Could this be causing the problem?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Similar Messages

  • Product ID for second issue of multi viewer app

    hi,
    I've in this forum already found very usefull info about publishing the second issue of a free multi viewer app but still can't figure out if we have to use the same Product ID  for each issue, or do we need to create a different Product ID for each issue ?
    I've put two examples below, suppose one of them has to right. Or not ??
    Is this the way to handle multiple issues (option 1):
    product ID issue 1 = Product ID issue 2 = com.magnusmedia.magname
    Or is this the right way (option 2):
    product ID issue 1 = com.magnusmedia.magname.01
    product ID issue 2 = com.magnusmedia.magname.02
    thanx in adavance
    Herman
    Allright, was in a hurry and tested it out myself.
    Option 2 is working for me, hope it's right to handle it that way.
    With option 1 the app crashes (dark gray screen, no folio opens, library- en scrolling buttons are available but)

    Short answer: Yes, use a different Product ID for each folio (or for each set of folio renditions).
    Longer answer: It's confusing that there are three different types of Apple Product IDs:
    (1) the app Product ID, which you can ignore
    (2) subscription duration Product IDs for a paid app or a single Product ID for a free subscription app
    (3) a Product ID for each retail folio
    When you're setting up a free subscription app, you don't need to use iTunes to create a Product ID for individual folios, because your folios are free. You just need to set up a free subscription Product ID in iTunes Connect and specify that Product ID in the DPS App Builder. On the Adobe side, you use a different Product ID for different folios you publish, such as com.publisher.publication.2012October and com.publisher.publication.2012November.  If you're creating renditions, you use the same Product ID for the different renditions and different Product IDs for different sets of renditions.

  • How do you publish a second issue in a multi folio DPS app?

    For a free folio is it really as easy as the following?
    1.) Go to DigitalPublishing.acrobat.com and click on folio Producer
    2.) Click on the Folio and click the Publish Button
    3.) Select the options as "Public" & "Free"
    4.) Enter The Product ID and Hit Publish
    Do you sign in with the new PRODUCT ID that you've created for the second issue?
    How far in advance can you schedule the publishing of an app?
    Is there no waiting period after submitting the app to APPLE?

    Yes, it's that simple for free apps. Just publish it as public and free—and use a DIFFERENT product ID such as com.company.app.issue—and it will be available.

  • Regarding function module to convert hours to minutes and seconds to minute

    hi all,
        is there any function module to convert hours to minutes and seconds to minutes....if so please guided me....i hav req like this...want to convert all those to minutes[seconds and hours]....

    Hi,
    Use FM
    SD_CALC_DURATION_FROM_DATETIME
    Pass paramters like
    I_DATE1 16.09.2008
    I_TIME1 10:33:00
    I_DATE2 16.09.2008
    I_TIME2 19:00:00
    and you will get the result as below..
    E_TDIFF 8:27
    8 hours and 27 minutes...
    Now u can use this values of hours and minutes to get the exact wage type values... get the details from HR module and multiply it with the hours and minute and calculate it...
    Use Offsets and get the hour and minute value from E_TDIFF
    Hope it will solve your problem..
    Thanks & Regards,
    Naresh

  • I own Lightroom 4 and have updated the software however, I am unable to import images taken on the Sony A6000. I have also updated the raw converter and am still having this issue.

    I own Lightroom 4 and have updated the software however, I am unable to import images taken on the Sony A6000. I have also updated the raw converter and am still having this issue.

    You can either upgrade to Lightroom 5.4 or later, or use the free Adobe DNG Converter version 8.6 to convert your RAW photos to DNG, which then will import into Lightroom 4.

  • Creating the second issue of an iPad magazine

    So the first issue is approved by Apple and ready to go on iTunes...
    When I come to the second issue, I am a little unsure of the Viewer Builder process - can anyone help?
    If my first issue is loaded up as:
    Viewer name: Design Monthly
    Viewer type: Multi-issue
    Title (Library view): Design Monthly Magazine
    How do I specify the second issue?
    I assume it is:
    Viewer name: Design Monthly
    Viewer type: Built-in Single Issue
    Is this correct?
    Also, how does enabling the app for Newstand change things (if at all)? Is that specified in the first issue as 'Multi-issue with iTunes subscription'?

    A little bit of extra information:
    If you have created a multi-folio app, until now with only free folio's, you should do the following:
    Create a IAP (in application purchase) in itunes connect . (Add screenshots of a couple of you magazine pages to the IAP)
    Create a folio that has the content and publish it is 'Public/Retail'. Make sure the productId matches the productID in your IAP
    Create a new Viewer binary (the marketing version number will increase) - the configuration of the viewer is _exactly_ the same as your current viewer
    Test the viewer on your iPad - including the purchasing proces with an iTunesConnect Test User
    Upload the viewer to iTunes Connect.
    Submit the viewer for Approval TOGETHER with your first In Application Purchase.
    (Apple requires you to submit a 'new' binary once you start to use IAPs). At the moment to use Newsstand in combination with DPS, you can only use paid subscriptions, which als requires you to set up at least on paid issue and the corresponding subscription IAPs
    if you have not yet submitted a viewer to iTunes Connect and want to do retail (IAP) content, you should do the following:
    Create a folio with content that represents your magazine. Publish the folio as 'Public/Free'
    Create an IAP (Add screenshots of a couple of your magazine pages to the IAP)
    Create a folio that has the content and publish it is 'Public/Retail'. Make sure the productId matches the productID in your IAP
    Test the viewer on your iPad - including the purchasing proces with an iTunesConnect Test User
    Upload the viewer to iTunes Connect
    Submit the viewer for Approval TOGETHER with your first In Application Purchase.
    (Non official information) Apple will closely look at the content of your Free folio to approve the app. They will use the screenshots to approve the IAP.
    If you are planning to publish frequently (once a week, once a day) and IAP approval time is critical, then work with your local Apple representative. Publishers have been able to get IAPs preapproved for a longer time period
    More information on testing can be found in the 'iPad publishing companion guide' in the Digital Publishing Portal and in the iTunes Connect Developer Guide (downloadable from iTunes Connect)
    With kind regards,
    Klaasjan Tukker

  • Converting Time Ruler to Seconds Issue

    In the project settings I have specified to use a time code 00:00:00:00 where the timeline should display the hours, minutes, or seconds in the footage. However, the timeline is still showing frames as you can see below. What am I doing incorrectly?

    Thanks for the help Rick. I am still experiencing issues however. For instance in the composition settings I entered in 0:00:00:30 to have a 30 second composition. The first problem I notice is when I go back to the composition settings, or view the timeline, it shows one minute six seconds ( 0:00:01:06) for the duration of the comp, even though I specified  0:00:00:30.
    The second problem I am having is I add clip to the timeline that is only 7 seconds long. For some reason it it stretches the clip through the whole timeline of the comp, it shouldn't as it its only 7 seconds.
    Thanks for your feedback.

  • Problem in converting the date format in Second's place

    I am developing an application using OAF in JDeveloper.
    I have to pass the current date from my page to a quary to filter the data.
    I used the following:
    String PresentDate=this.getOADBTransaction().getCurrentDBDate().toString();
    However it is sending a date like '2011-03-22 17:04:14.0'. Here if you see the seconds place, it has a fraction as well.
    I need to convert it by using TO_DATE(PresentDate, 'YYYY-MM-DD HH24:MI:SS')
    But because of the fraction in Seconds place, it gives an error.
    Can anyone help me to solve this problem?
    Thanks & Regards
    Hawker

    Hawker,
    Instead of that use..
    //Calling dateValue( ) does not include time.
    long sysdate = transaction.getCurrentDBDate().dateValue();
    Regards,
    Gyan

  • Converting files to PDF causing formatting issues.

    Hello.
    I am experiencing issues with converting an Excel file to a PDF and retaining its format.  The first page converts fine, no formatting issue.But every page after that is shrinking the font and making the images smaller.  This employee has tried to save the Excel file as a PDF and tried printing it through the Adobe print driver, but both are producing the same issue.
    The troubleshooting steps I have taken to try to resolve this issue are below.
    reinstall Adobe Acrobat
    tried modifying the margins
    tried a different machine
    Cleaned the Temp folder
    Any suggestions on a fix for this?

    Hi Bill.
    Thank you for the response.  I tested what you have suggested and this did not work.  When Adobe PDF printer is selected, it looks fine in the print preview, but once the Excel sheet has been processed, the format is not correct.  I tested this also with printing a hard copy to a printer, still the formatting looks fine in the print preview.  Once the file has been printed, it is not formatted the same. I have also removed the Adobe Driver and installed it again.  Still doesn't work.
    Any suggestions?

  • Convert smartform to PDF Convert_OTF - Performance Issue

    Hi gurus,
    We have a custom development for Compensation statement developed smartform that could have easily been done in Adobe PDF. The downside of this is ithat whenever we want to download to PDF, the program first coverts this smart form to PDF usinf funciton module "Convert_OTF" and then downloads it.
    Did any one face this performance issue. Is the convert to OTF a major time consuming process
    We are having system performance issue when downloading the comp statement and want to analysize how big this CONVERT_OTF is a factor.
    please suggest

    Ok
    Iìve never had particular performance problem with that function, so:
    have you tried to measure the time for the printing (smartform), for the convertion (convert_otf) and for the downloading separatly?
    Max

  • How to convert frames into hours:minutes:seconds?

    if I have some columns which contains the time value in frames, i.e. Content_Duration, program_duration etc.
    How can I convert those frames in hh:mm:ss?
    Is it possible to do it with a function do that so that I can re-use it?
    Thanks

    I am not quite sure where you get content_interval from?CONTENT_INTERVAL comes from the function call "numtodsinterval( content_duration / 1500, 'MINUTE' )" in the inline view.
    You might want to code it as "numtodsinterval( content_duration / 25, 'SECOND' )" to match the 25 frames/second standard you mentioned after I posted my reply.
    will it allow more than 99 hours? i.e. 154:57:40?Actually, it won't work for more than 23 hours, 59 minutes, 59 seconds. For larger numbers this technique requires a field for the number of days, like this.
    SQL*Plus: Release 10.2.0.1.0 - Production on Fri Jun 29 12:41:38 2007
    create table t ( content_duration number );
    Table created.
    insert into t values ( 1500*60*99 /* = 99 hours */ );
    1 row created.
    commit;
    Commit complete.
    select
      lpad(extract(DAY    from content_interval),2,'0')||' '||
      lpad(extract(HOUR   from content_interval),2,'0')||':'||
      lpad(extract(MINUTE from content_interval),2,'0')||':'||
      lpad(extract(SECOND from content_interval),2,'0')
      as result
    from
      ( select numtodsinterval( content_duration / 25, 'SECOND' ) as content_interval
        from t
    RESULT
    04 03:00:00
    1 row selected.
    -- if you're going to show DAYS though, the following way is simpler
    select
      cast
      ( numtodsinterval( content_duration / 25, 'SECOND' ) as interval day(2) to second(0))
      as result
    from t ;
    RESULT
    +04 03:00:00
    1 row selected.If you really need output like 99:00:00 instead of +04 03:00:00 then take Volder's approach.
    Is it possible to do it as a function?Anything you can do with a SQL query you can probably do inside a function, but for a line of code like "cast ( numtodsinterval( ..." I personally wouldn't bother.
    Joe Fuda
    SQL Snippets

  • Converting 1/00 of a second to HH:MM:SS

    In my PL/SQL statement, I'm using the following fuction DBMS_UTILITY.GET_TIME to get the starting and ending times of a sql process. It works fine but it returns the value in 1/100 of a second or microseoncds. Has anyone come up or know of a function that converts those microseconds to HH:MM:SS?
    Thanks!
    Glenn

    If your desired time granularity is to the whole second, just use SYSDATE instead of DBMS_UTILITY.get_time. DBMS_UTILITY.get_time merely returns the 1/100 second difference from some arbitrary point in time.
    DECLARE
       timer DATE := SYSDATE;
    BEGIN
       -- do some stuff
       DBMS_OUTPUT.put_line( SYSDATE - timer );
       -- which will return the floating point value where 1 = one day
    END;Michael

  • Convert Format Day, Hour, Minute, Seconds in Hours

    Hi all,
    I have one report generate by VoIP application like this:
    Total of hour has showed in Day (4). hour (20): Minute (26): seconds (06) summarize 4.20:26:06
    I need convert this format only how like 116 (hours) 26 (twenty six) Minutes 06 (Six) seconds. summarize 116:26:06
    How I can make this?
    Regards!
    Douglas Filipe http://douglasfilipe.wordpress.com

    Hi,
    I'm marking the reply as answer as there has been no update for a couple of days.
    If you come back to find it doesn't work for you, please reply to us and unmark the answer.
    Thanks
    George Zhao
    Forum Support
    Come back and mark the replies as answers if they help and unmark them if they provide no help.
    If you have any feedback on our support, please click "[email protected]"

  • Video pause for second issue

    Hello guys,
    do you have any clue why Premiere Pro CS3 would suddenly pause the playback for 2 seconds and it will continue to play the videos in the timeline?
    This issue only happens when a title is put on layer above the timeline. Also happens when I added the end credits.
    This pausing behaviour does not happen when I only render or playback videos only without titles in the Timeline.

    Please provide
    these details to help us help you.
    Cheers
    Eddie
    PremiereProPedia   (
    RSS feed)
    - Over 300 frequently answered questions
    - Over 250 free tutorials
    - Maintained by editors like
    you
    Forum FAQ

  • How to Convert frames into minutes and seconds

    Hi,
    does anyone know how to convert frames into time (minutes and
    seconds). I need the users to view the swf with current time being
    played and over time. I have 2152 frames in total and I want that
    to be converted to time. Can anyone help me on this. I would really
    appreciate it. It is very urgent!!!!
    Thanks

    Time Indicator,
    > does anyone know how to convert frames into time
    (minutes
    > and seconds).
    That depends entirely on the framerate of the movie. At the
    default
    12fps, 12 frames would be one second; 24 frames would be two.
    At 24fps, 24
    frames would be one second.
    > I need the users to view the swf with current time being
    played
    > and over time. I have 2152 frames in total and I want
    that to be
    > converted to time. Can anyone help me on this. I would
    really
    > appreciate it. It is very urgent!!!!
    Judging by your four exclamation points, I'd say it's
    definitely urgent!
    Well, again, if you're at 12fps, 2152 frames would take 179
    seconds, or 2
    minutes and 59 seconds. I arrived at that number by dividing
    2152 by 12.
    Keep in mind, though, framerate is actually more of a
    guideline than an
    exact figure. Framerate determines the rate at which Flash
    will *try* to
    display content. On an especially slow computer, the Flash
    Player may not
    be able to keep up, and the same number of frames might
    actually take more
    time.
    David Stiller
    Adobe Community Expert
    Dev blog,
    http://www.quip.net/blog/
    "Luck is the residue of good design."

Maybe you are looking for

  • IOS 5: The iPad "..." could not be synced because the sync session failed to start.

    Am trying to migrate into the iCloud and updated: 1. Mac Air to 10.7.2 2. iTunes to 10.5.(141) 3. iPad (1) to iOS 5 (9A334) Was able to sychronize and then found out I lost all my apps and rearranged them in iTunes and hoping I could resync them agai

  • Are earphones with built-in minc compatible with EliteBook 8440p?

    I have an EliteBook 8440p.  I need to know if earphones with mic included are compatible with this laptop. Currently, I am trying to use one with 3.5mm jack on the earphones or microphone connector.  When connected to the earphones plug, the earphone

  • File.exists() speed

    I have written a recursive algorithm for a particular statistical analysis that often requires in excess of 1x10^30 permutations. The function looks to see if file.exists(). If file.exists()==true, then a calculation is perfomed and a new file is wri

  • App in sd card

    Tell me how can I stored app in SD card in Lumia 620 like all androids phone now stored there app in SD card is that any tectonic that I stored my apps in SD card plz tell me

  • SQL*Net Client for Oracle 8i/9i ?

    Hi..All, Where do I download just the SQL*NET client for ORacle 8i/9i. ? Regards