Issue DATE

Hello

I'm passing a date for a TRIAL, then do an INSERTION of this date in a table...
  PROCEDURE Insert_Current_Data(
   p_create_date                 IN         VARCHAR2
) IS
 e_constraint_error               EXCEPTION;
   PRAGMA EXCEPTION_INIT (e_constraint_error, -2291);
CURSOR ei_claimant_ext_cur
      IS
      SELECT to_number(NOC_CODE) NOC_CODE,
                  to_number(ECONOMIC_REGION_CODE) ECONOMIC_REGION_CODE,
                  CASE EI_PROV_CODE
                    WHEN '00' THEN 1
                    WHEN '01' THEN 4
                    WHEN '02' THEN 2
                    WHEN '03' THEN 3
                    WHEN '04' THEN 5
                    WHEN '05' THEN 6
                    WHEN '06' THEN 7
                    WHEN '07' THEN 8
                    WHEN '08' THEN 9
                    WHEN '09' THEN 10
                    WHEN '10' THEN 11
                    WHEN '11' THEN 12
                    ELSE 13
                  END EI_PROV_CODE,
                  POSTAL_CODE
        FROM ei_claimant_curr_year_external
        WHERE ei_prov_code <> 12
        AND     economic_region_code <> 99
        AND     postal_code is NOT NULL
        AND     ROWNUM < 1000;
        
        ei_claimant_ext_rec ei_claimant_ext_cur%ROWTYPE;
        
        v_create_date       VARCHAR2(20);
        
    BEGIN
           
     dbms_output.put_line('Date passed: '||p_create_date);  

        OPEN ei_claimant_ext_cur;
        
        LOOP
  
            FETCH ei_claimant_ext_cur 
            INTO ei_claimant_ext_rec;
                
            EXIT WHEN ei_claimant_ext_cur%NOTFOUND;      
            
            BEGIN
                          
               INSERT INTO ei_claimant_curr_year
                VALUES  (EI_SEQ.nextval,
                            ei_claimant_ext_rec.noc_code,
                            ei_claimant_ext_rec.EI_PROV_CODE,                            
                            ei_claimant_ext_rec.ECONOMIC_REGION_CODE,
                            p_create_date, --- CURRENT Month 
                            ei_claimant_ext_rec.POSTAL_CODE
                            );
                            COMMIT;                              

                EXCEPTION
                    WHEN e_constraint_error THEN dbms_output.put_line('CONSTRAINT Error '); 
                        fwutil_pkg.logerror (SQLERRM||' '||ei_claimant_ext_rec.noc_code||' Prov Code: '||ei_claimant_ext_rec.EI_PROV_CODE||'  Econ Region: '||ei_claimant_ext_rec.ECONOMIC_REGION_CODE||
                        ' Postal Code: '||ei_claimant_ext_rec.POSTAL_CODE||' Date: '||p_create_date,
                              SQLCODE,
                              NULL,
                              'Populate_EI_Claimant_Main -- Insert into EI_Claimant_curr_year '
                             );   
                    WHEN OTHERS
                    THEN

                        fwutil_pkg.logerror (SQLERRM||' '||ei_claimant_ext_rec.noc_code||' Prov Code: '||ei_claimant_ext_rec.EI_PROV_CODE||'  Econ Region: '||ei_claimant_ext_rec.ECONOMIC_REGION_CODE||
                        ' Postal Code: '||ei_claimant_ext_rec.POSTAL_CODE||' Date: '||p_create_date,
                              SQLCODE,
                              NULL,
                              'Populate_EI_Claimant_Main -- Insert into EI_Claimant_curr_year '
                             );          
            END;
            
        END LOOP;
    
        CLOSE ei_claimant_ext_cur;        
        
    END Insert_Current_Data;
Get the error:

ORA-01858: a non-digit character was found here where was waiting for a digital

Why so complicated dates :-(

Help, please!

Thanks in advance!

Hello

>
Why the dates so complicated?
>

Dates are not difficult, but you do not use the dates but varchar2 as shown below:

  PROCEDURE Insert_Current_Data(
   p_create_date                 IN         VARCHAR2
...

I suggest to change that to:

  PROCEDURE Insert_Current_Data(
   p_create_date                 IN         date
...

Then call the procedure with an actual as date:

begin
Insert_Current_Data( to_date('10-12-2012', 'dd-mm-yyyy') );

If then you have a problem let us know.

Kind regards

Peter

Tags: Database

Similar Questions

  • mask for the format issue date

    I was wondering why this first query works, but the second does not work, if someone could help please :

    [quote]

    SELECT course_no, section_id, to_char (start_date_time, 'Day' The "Ddspth" of "fmMonth yyyy") IN the section

    WHERE to_char (start_date_time 'DY') = 'Sun '; [/ quote]

    [quote]

    WHERE to_char (start_date_time, 'Day') = 'Sunday '; [/ quote]

    any ideas? can't see what I'm missing?

    Thanks in advance,

    Nick

    Date format day returns the name of the white day to the length of the longest day name (in the appropriate language):

    SQL > select ' [' | to_char (sysdate + 1, 'day') |] ']' double.

    '['|| TO_CHA
    -----------
    [Sunday]

    SQL > select ' [' | to_char (sysdate + 1, 'FMDay') |] ']' double.

    '['|| TO_CHA
    -----------
    [Sunday]

    SQL >

    Use FM modifier and,'nls_date_language = English "to make independent NLS:"

    WHERE to_char (start_date_time 'FMDay', 'nls_date_language = English') = 'Sunday ';

    SY.

  • Issue Date format as a VARCHAR

    Using Oracle 10 g:
    I have a varchar field that keeps a date like:

    2010-08-28 14:40:21

    I am trying to format the date so I can check if it is greater than the sysdate. I'm doing:

    To_char (end_date, 'YYYYMMDD') > to_char (sysdate, 'YYYYMMDD');

    I get an error message:
    ORA-01722: invalid number
    01722 00000 - "invalid number."

    Which makes sense, but I'm not sure how to properly format the end_date in YYYYMMDD format.

    Hello

    user9179751 wrote:
    Using Oracle 10 g:
    I have a varchar field that keeps a date like:

    2010-08-28 14:40:21

    I am trying to format the date so I can check if it is greater than the sysdate. I'm doing:

    To_char (end_date, 'YYYYMMDD') > to_char (sysdate, 'YYYYMMDD');

    I get an error message:
    ORA-01722: invalid number
    01722 00000 - "invalid number."

    Which makes sense, but I'm not sure how to properly format the end_date in YYYYMMDD format.

    Is the VARCHAR2 column end_date?
    To_char, as its name suggests, converts a DATE to a string of record CHAR. If you already have a string of characters, so there's no need of TO_CHAR.
    You can call TO_DATE, such as

    WHERE   TO_DATE ( end_date
                    , 'YYYY-MM-DD HH24:MI:SS'
                    )  > SYSDATE
    

    but it is more effective and less prone to say

    WHERE   end_date > TO_CHAR (SYSDATE, 'YYYY-MM-DD HH24:MI:SS')
    

    Why is it more effective? The optimizer considers SYSDATE be a constant, even if the query takes a long time. Therefore, it only will convert SYSDATE in a string once, even if you have 1 million rows in the table. If you did the first way, you must call TO_DATE a million times, once for each line. In addition, your column, end_date, being alone on one side of the > operator, the optimizer can use an index on that column.
    Why is it less error-prone? If you still have a line where End_date is incorrect, you will get an error if you call TO_DATE. Not try to convert end_date, you won't make mistakes.

    This works because the format for End_date is suitable for sorting. If the format was, say, 'DD-Mon-YYYY', you would have to be converted to a DATE.

    It would be better if End_date a DATE column. It is never a good idea to use a VARCHAR2 column to store points in time.

  • Issue date and time with the javascript scripts

    Hi all

    I need to maintain a bit of history on my pdf form, so I need to get the date and time when the user submits the form.  Currently, I am able to do this in FormCalc.

    var todayDate = Date()
    var todayTime = Time()
    var today = concat (Num2Date (todayDate, "MMMM DD, YYYY"), "", Num2Time (todayTime, "h: mm A") "");

    today will contain: April 28, 2009 14:23

    I want exactly the features in javascript.  I'm not able to get the same result.

    Please give me some code for the same in javascript snippet

    Deepak.

    Hi Deepak,

    This example should show you how you can recover each "piece" of the date in JavaScript and piece and then that their back together according to your needs.

    You will find several examples of scripts on the date formatting here: http://javascript.internet.com/time-date/

  • Issue date (again)

    Hi all

    I have a column of strings that contain equivalent dates data.
    --DDL & DML Statement
    CREATE TABLE TEST_TABLE AS
    (
    SELECT '29-Jul-2009 NUL:NUL:NUL' col_1 FROM Dual
    UNION ALL
    SELECT '28-Jul-2009 16:16:16' FROM Dual
    UNION ALL
    SELECT '28-Jul-2009 04:16:16 PM' FROM Dual
    )
    /
    I have therefore given as
    SQL> SELECT * FROM TEST_TABLE
      2  /
    
    COL_1
    -----------------------
    29-Jul-2009 NUL:NUL:NUL  -- String with no time component
    28-Jul-2009 16:16:16        -- String in 24Hr Format
    28-Jul-2009 04:16:16 PM   -- String in 12Hr Format
    
    3 rows selected.
    I need to convert these strings to dates

    I tried the following:
    SQL> SELECT col_1, SUBSTR (REPLACE (col_1, 'NUL', '00'), -2, 2),
      2         CASE
      3            WHEN SUBSTR (REPLACE (col_1, 'NUL', '00'), -2, 2) IN
      4                                                         ('PM', 'AM')
      5               THEN TO_DATE (REPLACE (col_1, 'NUL', '00'),
      6                             'DD-Mon-YYYY HH12:MI:SS'
      7                            )
      8            ELSE TO_DATE (REPLACE (col_1, 'NUL', '00'),
      9                          'DD-Mon-YYYY HH24:MI:SS')
     10         END date_col
     11    FROM test_table
     12  /
    ERROR:
    ORA-01830: date format picture ends before converting entire input string
    
    
    
    no rows selected
    
    SQL> 
    Can someone help me please understand what I am doing wrong in the above query, or give advice to achieve the desired results.

    Thank you
    Ann

    You forgot the AM/PM indicator in your format mask.

    SQL> SELECT col_1, SUBSTR (REPLACE (col_1, 'NUL', '00'), -2, 2),
      2         CASE
      3            WHEN SUBSTR (REPLACE (col_1, 'NUL', '00'), -2, 2) IN
      4                                                         ('PM', 'AM')
      5               THEN TO_DATE (REPLACE (col_1, 'NUL', '00'),
      6                             'DD-Mon-YYYY HH:MI:SS AM'
      7                            )
      8            ELSE TO_DATE (REPLACE (col_1, 'NUL', '00'),
      9                          'DD-Mon-YYYY HH24:MI:SS')
     10         END date_col
     11    FROM (select '29-Jul-2009 NUL:NUL:NUL' col_1 from dual union all
     12          select '28-Jul-2009 16:16:16'    col_1 from dual union all
     13          select '28-Jul-2009 04:16:16 PM' col_1 from dual
     14         )
     15  /
    
    COL_1                   SU DATE_COL
    ----------------------- -- --------------------
    29-Jul-2009 NUL:NUL:NUL 00 29-JUL-2009 00:00:00
    28-Jul-2009 16:16:16    16 28-JUL-2009 16:16:16
    28-Jul-2009 04:16:16 PM PM 28-JUL-2009 16:16:16
    
  • Issue date max back in 2009

    Everyone knows about this problem?

    Create the following new table and add the data...
    CREATE TABLE ETL_LASTRUN
    (
    DATE OF CBX_TLEMSANI_2000TJE
    )
    /
    Insert into ETL_LASTRUN
    (CBX_TLEMSANI_2000TJE)
    Values
    (TO_DATE (DECEMBER 31, 2008 23:17:13 ',' DD/MM/YYYY HH24:MI:SS'));))
    Insert into ETL_LASTRUN
    (CBX_TLEMSANI_2000TJE)
    Values
    (TO_DATE (DECEMBER 31, 2008 23:26:31 "," MM/DD/YYYY HH24:MI:SS'));))
    Insert into ETL_LASTRUN
    (CBX_TLEMSANI_2000TJE)
    Values
    (TO_DATE (DECEMBER 31, 2008 23:36:35 ',' DD/MM/YYYY HH24:MI:SS'));))
    Insert into ETL_LASTRUN
    (CBX_TLEMSANI_2000TJE)
    Values
    (TO_DATE (DECEMBER 31, 2008 23:46:23 ',' DD/MM/YYYY HH24:MI:SS'));))
    Insert into ETL_LASTRUN
    (CBX_TLEMSANI_2000TJE)
    Values
    (TO_DATE (DECEMBER 31, 2008 23:56:30 "," MM/DD/YYYY HH24:MI:SS'));))
    Insert into ETL_LASTRUN
    (CBX_TLEMSANI_2000TJE)
    Values
    (TO_DATE (JANUARY 1, 2009 00:06:36 ',' DD/MM/YYYY HH24:MI:SS'));))
    Insert into ETL_LASTRUN
    (CBX_TLEMSANI_2000TJE)
    Values
    (TO_DATE (JANUARY 1, 2009 00:16:39 ',' DD/MM/YYYY HH24:MI:SS'));))
    Insert into ETL_LASTRUN
    (CBX_TLEMSANI_2000TJE)
    Values
    (TO_DATE (JANUARY 1, 2009 00:26:30 "," MM/DD/YYYY HH24:MI:SS'));))
    Insert into ETL_LASTRUN
    (CBX_TLEMSANI_2000TJE)
    Values
    (TO_DATE (JANUARY 1, 2009 00:36:38 ',' DD/MM/YYYY HH24:MI:SS'));))
    COMMIT;


    Now, run the following query
    SELECT MAX (to_char (CBX_tlemsani_2000tje, "MM/DD/YYYY HH24 '")) as CBX_tlemsani_2000tje FROM etl_lastrun

    The results I get (using 10.2.0.1.0)
    CBX_tlemsani_2000tje
    =====
    2008-12-31 23:56

    Hello

    This is because you take to_char max. try this instead:

    select to_char(max(last_run), 'MM/DD/YYYY HH24:MI') as last_run
      from etl_lastrun
    
    LAST_RUN
    ----------------
    01/01/2009 00:36
    1 row selected.
    

    Best regards
    Peter

  • 4.0.22.33382 required ASAP issue date

    I need to present the notes as part of the internal change management upgrade to 4.0.22.33382 ticket. It's on an ix12-300r. Thank you.

    Hello cbotner,

    Here is a link to the documentation/download page to update to this version:
    https://Lenovo-na-en.custhelp.com/app/answers/detail/A_ID/23142

    If you want more details, you can contact support here:
    https://Lenovo-na-en.custhelp.com/app/ask/

  • IDSMC V1.2 issue Date please?

    Hello

    where can I get the release notes V1.2 for IDSMC products

    I would particularly like to know if CSCea55080 bug fix

    in included in this version

    Thanks for the tips

    JYP

    Hello

    You can find the release notes here:

    http://www.Cisco.com/en/us/products/SW/cscowork/ps3990/prod_release_note09186a00801b142b.html

    There are also a few bug fixes for IDS MC 1.2, you might want to look at the software Center.

  • Why something as simple as the date on my computer being wrong cause me does not open all websites in firefox?

    I see others have this problem several times... and we're trying to do all sorts of things to fix. This is one of my mistakes:

    This connection is Untrusted

    You asked Firefox to connect on www.facebook.com, but we cannot confirm that your connection is secure.

    Is it for all. And sometimes a double confirmation to go on the site anyway. Other times it will not let you go to a site just about anything.

    So I came here and I realized that it was on my own reading after a few complex corrects those proposed to others who have posted this problem.

    Look at the date... not on your phone... on the computer with the problem.

    If you guys can make part of the warning mentioned in order to ensure that the date is correct on your computer. Also, it looks like a program connected to the internet with access to the right time wouldn't go the clock of the computer. Or maybe you should check the date in line when this error occurs if the error message can indicate to the user what the problem... or at least let it go to a Web site. Or maybe not even scare the user with a completely fake security warning.

    each certificate has an issued date and an expiration date...

    You can check that yourself, for example on this page, by clicking on the padlock in the upper left corner of the address bar > more information > Security > view certificate.

  • Date after 30 days.

    Hi all

    I have a date column and I want when 30 days is over and if someone (user) to select date the next day, it give a message to the user that month being u cant update date already closed.is is possible? Please help me thanks in advance.

    Sarah

    Hi Sarah!
    Why not take the suggestion of may with the shutter button an after new point instance about to ins1.issue?

    begin
    set_item_property ( 'ins1.issue', update_allowed, property_true );
    set_item_property ( 'ins1.issue', hint_text, 'Enter value for issue date.' ); 
    
    if
      :ins1.issue is not null AND
      trunc ( :ins1.issue ) < trunc ( sysdate - 30 ) AND
      user != 'ADMIN'
    then
      set_item_property ( 'ins1.issue', update_allowed, property_false );
      set_item_property ( 'ins1.issue', hint_text, 'Month is already closed. Issue date could not be changed.' );
    end if;
    end;
    

    If the ADMIN user is logged, it is still able to update the date of issue.
    If the issue date is today less less than 30 days, the issue is not editable.
    Concerning

  • 37 of Firefox on Ubuntu 14.10 cannot use Media Source Extensions on YouTube

    I've seen on the issue date that Media Source Extensions has been activated for YouTube with this version. I was wrong?

    MSE is always disabled by default in Firefox 37 on Linux.

    • Media.MediaSource.Enabled = false
    445 // Whether to enable MediaSource support.
    446 // We want to enable on non-release  builds and on release windows and mac
    447 // but on release builds restrict to YouTube. We don't enable for other
    448 // configurations because code for those platforms isn't ready yet.
  • iCloud email Id does not exist (@yahoo.co.za)

    iCloud id [email protected] linked to my iPad. Restored IPad now cannot recover locked cause email account there is not (yahoo.co.za), security meets forgotten child create account iCloud on iPad with good intentions. Need help, the Apple recovery methods won't work as e-mail does not exist, security issues (date of birth) as badly. What should I do to fix this?

    If you are unable to remember your password, security issues, do not have access to your address of rescue or are unable to reset your password for any reason, your only option is to contact the Support of Apple ID, to speak to an operator you should explain that your problem is related to your Apple ID This way you can be attributed to the assistance, even if you do not have an AppleCare plan.

    You will need to be patient with the process and to be ready to prove without doubt that the account belongs to you. Do not expect access to be restored immediately and if you are not the owner of the Apple ID saved to the device the account will not be reset.

  • Can I transfer my itunes/app purchases to a Google account on behalf of the family Organizer? Or make an account abroad the family Organizer?

    Unfortunately, a long time ago that I have set up my Itunes purchases wuth my gmail account. I didn't have a Mac at the time.  I spoke with technical support on this issue dates back to 10.7. I had and now have an e-mail icloud account, but all my app and itunes purchases are attached to a gmail account. At this time Apple told me to just keep everything separate. In fact, I'm sure you have noticed, during the installation of OSX, it asks you if you have different accounts and it's installation based on this scenario.

    Fast forward to 2015-2016 where my Icloud account is family Organizer and new purchases pass under this account. I want to ask the question again, is it possible to change my Itunes and App store purchases to an icloud account in the account of the family Organizer, which is used for purchases? I know that I can easily put my Itunes media in the cloud under the account of the family Organizer, but it will not recognize as purchases.  If Apple would allow an e-mail account foreign to be the family Organizer will arrange my problem. I also realize the House sharing can be used for each Member of my family's Itunes purchases. But home sharing does not work for apps, right?

    There is an "Edit subscription" page in the app store, where can I sign up my google account to a family membership. This will allow the google account to then become the family Organizer?

    Suggestions?

    is it possible to change my Itunes and App store purchases to an icloud account in the account of the family Organizer, which is used for purchases?

    Unfortunately not.

    You should be able to use your

    Why should fix your problem.

  • I used a master password for years. Today, I noticed that it had been authorized. What could cause this?

    I used a master password for years. I also use Sync. Today, I wanted to watch one of my saved passwords. When I went to do this, I noticed that Firefox was no longer is configured to use a master password. I'm afraid I can have been hacked, or that something is is past (recent update Firefox?) which caused the use of the master password will be disabled.

    I have not yet checked my other computers synced to see if their master password has been disabled.

    I have re-enabled the functionality of password on this computer.

    On this particular computer, I had a long-standing issue date where Firefox ' help > about Firefox "still says I need to"restart to update. This means that I can't use "help > about Firefox ' to check and install the latest version. I need to download Firefox manually and update by running the installation program.

    If the files have already been downloaded, then delete the files in the folder updates\0 and updates.

    You can also remove active - update.xml, or even updates.xml (this will clear the update history).

    C:\Documents and Settings\<user>\Local Settings\Application Data\Mozilla\Firefox\Mozilla Firefox\updates
    (%USERPROFILE%\Local Settings\Application Data\Mozilla\Firefox\Mozilla Firefox)
    
    C:\Users\<user>\AppData\Local\Mozilla\Firefox\Mozilla Firefox\updates
    (%LOCALAPPDATA%\Mozilla\Firefox\Mozilla Firefox)
    
  • How to disable the verification of certifcation

    All the sites I visit me to click on a pop up saying safety for site certification expired and I have to reverse it. This also includes your sites. The pop up according to this is from firefox

    Check the Date and time on your system to make sure that they are correct.

    1. If the Date is set incorrectly on your system, it may fall outside the "issued" dates and "expires" certificate.
    2. To view the dates for certificates, you must click on the button to the Site identity (color icon at the left end of the location/URL bar), then click on 'Further information', the Page Info window will open, click on the Security tab, and then click view certificate.

    If your system does not take the Date and time after having been turned off and left overnight, the battery on your motherboard may need to be replaced. I replace mine about every 12 to 18 months to avoid such problems. Check with the manufacturer of your system or your operating manual system on how to replace it as well as the battery suitable for use.

    If this answer solved your problem, please click 'Solved It' next to this response when connected to the forum.

Maybe you are looking for

  • Completely erase disc hard mac and set up in the new laptop.

    Hello. I'm hoping to completely erase my old mac and set up as a new to give to a family member. I tried going to disk utilities and erasure, but the options are grayed out and I can't seem to clear. Any help on this would be much appreciated! Thank

  • How to find a shared file drive?

    Hey,. I have an apple wireless system. Who understands (Apple Airport Extreme (Gen 8? The most recent) hand router, Apple Airport Extreme (Gen 5), then four cells, two are first gen Airport Express and two are the new generation. I try to have a file

  • new iphone 6 (iOS 9.2.1) does not connect to itunes (version 11.4).

    not connecting not due to: "The iPhone"iPhone"cannot be used because it requires a newer version of iTunes. Go to www.itunes.com to download the latest version of iTunes. " Help, please!

  • Recovery disks do not work with the new hard drive?

    Hello, everyone. I have a laptop HP (pavilion dv7-1245dx) and the hard drive is dead. I had never gotten to burn my recovery disks, so I ordered new ones from HP. When I installed the new hard drive and popped in the disk to reinstall the operating s

  • OptiPlex gx270s for Windows XP video drivers

    I rebooted a boring optiplex gx270s with XP SP3 to replace another machine having for some reason to have XP on it (an old piece of equipment must be supported and has no drivers after XP). In any case, I ran into problems that others have also and g