literal does not format string when collecting in bulk.

Hello
should work with 10.2 DB.
  1  declare
  2    type vcArray is table of varchar2(10);
  3    type vdateArray is table of date;
  4    l_group#   vcArray;
  5    l_status vcArray;
  6    l_date vdateArray;
  7    cursor c is select to_char(sysdate, 'YYYYMMDD_HH24MISS') data, GROUP# , status from v$log;
  8  begin
  9  open c;
 10  loop
 11     fetch c bulk collect into l_date, l_group# , l_status;
 12     for i in 1..l_date.count
 13     loop
 14      dbms_output.put_line('l_date: ' || l_date(i));
 15     end loop;
 16     exit when c%notfound;
 17  end loop;
 18  close c;
 19* end;
declare
*
ERROR at line 1:
ORA-01861: literal does not match format string
ORA-06512: at line 11
Just try to display loop a few output of v$ log view :).
Concerning
GregG

Hello

GregG says:
Hello
should work with 10.2 DB.

1  declare
2    type vcArray is table of varchar2(10);
3    type vdateArray is table of date;
4    l_group#   vcArray;
5    l_status vcArray;
6    l_date vdateArray;
7    cursor c is select to_char(sysdate, 'YYYYMMDD_HH24MISS') data, GROUP# , status from v$log;
8  begin
9  open c;
10  loop
11     fetch c bulk collect into l_date, l_group# , l_status;
12     for i in 1..l_date.count
13     loop
14      dbms_output.put_line('l_date: ' || l_date(i));
15     end loop;
16     exit when c%notfound;
17  end loop;
18  close c;
19* end;
declare
*
ERROR at line 1:
ORA-01861: literal does not match format string
ORA-06512: at line 11

Just try to display loop a few output of v$ log view :).
Concerning
GregG

To_char, as the name suggests, returns a VARCHAR2, c.data is therefore a VARCHAR2, but you try to store it in an array of DATEs.
Do not use TO_CHAR. In fact, there is no need to use a column for that at all, because SYSDATE will always be the same.

Try something like this:

declare
    type vcArray is table of varchar2(10);
    l_group#   vcArray;
    l_status vcArray;
    cursor c is select GROUP# , status from v$log;
    run_time DATE;
  begin
  open c;
  loop
     run_time := SYSDATE;
     fetch c bulk collect into l_group# , l_status;
     for i in 1..l_group#.count
     loop
      dbms_output.put_line('run_time: ' || run_time);
     end loop;
     exit when c%notfound;
  end loop;
  close c;
end;
/

Published by: Frank Kulash on 12 March 2012 10:26
Added example.

Tags: Database

Similar Questions

  • TO_DATETIME gives the error ORA-01861: literal does not match the format string

    When I use the following in a formula in the column in the business model, the administration of BI tool does not complain:

    TO_DATETIME (LEFT ("registration - College". "D time". " ("' Exercise ', 4) | ("/ 09/01 ', ' yyyy/mm/dd')

    But when I use it in an analysis, I get the error message:

    ORA-01861: literal does not match the format to the call of the OIC string

    The scope of practice is a varchar of 6 characters (e.g. 201213), so I do not know what causes this error. Is this because the TO_DATETIME expects something like hh as argument?

    Without the element that to_datetime is supposed to work, here is an example that I made on SampleApp406.

    Try to add the "time", but for me it has always worked without problem.

  • Error "ORA-01861: literal does not match the format ORA-06512 string.

    Hello
    I am getting error on EBS page when I click on the button

    I wrote the code in CO to insert values in table when the button is clicked

    but when I click the button it gives an error
    ORA-01861: literal does not match the format ORA-06512 string
    I think that his error of date format

    but I tried many styles of formatting but not yet able to fix it

    KAO

    You are right, that this is due to the error in the data type. Share the code that you have coded for button click here.

    Kind regards
    GYAN

  • Getting ORA-01861: literal does not match format string whith 2 passes DATE

    Not exactly a complete Newbie, but not an expert either but it left me speechless...

    I have two DATE columns in two different tables.
    In a select statement I compare these two in the where clause.

    ... and
    Table1. Column1 = table2.column1

    I then get

    ORA-01861: literal does not match the format string (and toad has highlighted the second column)

    I made a selection on the two tables to have a look at the values and found that, the values in a table (Toad), has this format: YYYYMMDD but in the other select table produces a column of values in the format YYYY-MM-DD

    I've made a desc on the two paintings and confirmed that the two are DATE columns...

    I've never seen different date formats in the same database... Thinking about it now (I'm home and can not verify) the two tables could be in different schemas... Different schemas can display different date formats?

    In any case, I tried to_date ([column] on the two (in the where clause) and got that a nonnumeric value has been found where a numeric value has been planned (this time for the first column).)

    So I guess I ask how come two different date formats and how to find the nonnumeric value in table 1 which contains lines of 5.8 million

    Any tips/ideas/tips?

    Please check back when you get back to work... I can almost guarantee you that one (if there is not both) of these columns is NOT a data type DATE (or timestamp).

    Or if they are, you are actually handled in a view or query to convert to this type of data.

  • SQLERRM: ORA-01861: literal does not match the format string

    Here's what I want to do.

    Select to_char (to_date (estimatedshipdate, 'DD-MM-AA'), 'YDDD')
    of cram_stg
    where estimatedshipdate = 14 January 11 ';

    TO_CHAR (TO_DATE(ESTIMATEDSHIPDATE,'MM-DD-YY'), 'YDDD')
    -----------------------------------------------------
    1014


    1 selected lines


    I want to convert the shipping date is DD-MM-AA YDDD, but in my program:

    v_est_ship_date varchar2 (10);

    ESTIMATEDSHIPDATE VARCHAR2 (10) in a TABLE

    v_est_ship_date: = to_char (to_date (CRAM_PTCLICK_REC.estimatedshipdate, 'DD-MM-AA'), 'YDDD');

    I get this problem

    SQLERRM: ORA-01861: literal does not match the format string


    I want to assign the result of the function to_char to v_ext_ship_date. What I am doing wrong? Thank you.

    Hello

    It's just one of the reasons for which the storage of dates as VARCHAR2 columns is a bad idea.
    Apparently, some (maybe just one) this column values is not the right format. To find malformed (the kind that cause the ORA-01861) values, you can do something like this:

    SELECT  primary_key
    ,     estimatedshippingdate
    FROM     cram_stg
    WHERE     TRANSLATE ( estimatedshippingdate
                , '012345678'
                , '999999999'
                ) != '99-99-99'
    ;
    

    It intercepts any mistakes as the 32nd day of the month (let alone ' 02-29-11'). See the next thread of a way to do this:
    Re: How to select valid dates only

  • HP 7612: I have a 7612 Officejet from HP that worked wireless but now does not work. When I try to

    I have a 7612 Officejet from HP that worked wireless but now does not work.  When I try to open the Network Setup Wizard a message indicating "wireless communication has been disabled. Can someone please?

    Thank you!

    hhmenar

    Hey @hlhmenar,

    Welcome to the Forums of HP Support!

    I understand that you are experiencing some problems with the wireless settings is disabled on your Officejet Wide Format e-all-in-one printer. I can help you with that.

    I'll send you some instructions describing how to do a factory reset on your printer. If you check your Inbox of forum you should see happens shortly.

    Please let me know the results after following the above. If you can run the wireless setup, click on accept solution. If you appreciate my help, please click on the thumbs up icon. The two icons are below this post.

  • Definition of group does not belong to the collection

    Hi all, I hope you can help.  We have recently migrated some applications to a new host and group configurations used in the available refinements component now seem to be unreadable to short Studio.  For all applications, we get messages as follows:

    2015-08-04 09:46:22, 041 WARN [CollectionManager] group definition(key:'Action-Plan') does not belong to the collection "ATR_Detail".

    2015-08-04 09:46:22, 041 WARN [CollectionManager] group definition(key:'General') does not belong to the collection "ATR_Detail".

    2015-08-04 09:46:22, 041 WARN [CollectionManager] group definition(key:'Task-Info') does not belong to the collection "ATR_Detail".

    When we created these there is no way to set the collection for a group and in the documentation so that the SOAP API seems always to be the case: http://docs.oracle.com/cd/E40518_01/server.761/server_api_ref/endeca-server/wsdl/config/xsd/1/element/putGroups.html.

    The studio version 3.1.14220 has no difficulty to the ingestion of these even when there are multiple collections in an application, but this new version 3.1.19408 get the message above and does not display groups.

    We need to understand if:

    1. it is a bug.  If so, I have the document and present it.

    2. There is a way to specify collections when creating the groups via the web service that is not obvious from the documentation.  Maybe I'm interested in the false documentation?

    Thank you

    DIran

    We think we have found a solution that we are now stable which is that perhaps dot notation in the form of Collection.GroupName is now required to load the groups into the new version of studio.

    Diran

  • Indicator light charging cable does not go on when connected to power what a lack of cable or battery problem? Advice please. I have

    Indicator light charging cable does not go on when connected to power what a lack of cable or battery problem? Advice please.

    Troubleshooting help here > Apple Portables: Troubleshooting MagSafe adapters - Apple Support

  • My iphoto does not open. When I click on the circle still turns but nothing happens. I tried to open it with option to order and reconstruction, and nothing happened. I have version 9.2.3. Any advice will be greatly appreciated.

    My iphoto does not open. When I click on the circle still turns but nothing happens. I tried to open it with command + option and reconstruction and nothing happened. I have version 9.2.3. Any advice will be greatly appreciated.

    If you recently updated to El Capitan, your version of iPhoto is not compatible with this OS.

    What version of Mac OS X are you running?

  • Satellite M30-113 does not work well when I use FreeBSD 6.2

    Hello

    My M30-113 does not work well when I use FreeBSD 6, 2-RELEASE http://www.FreeBSD.Org/

    I was told that Toshiba has release a new bios to correct the problem of cooling, because it does not allow me to fan passive cooling in FreeBSD.

    So could we have a new bios to solve this issue?

    Arabian salvation

    I am sure that mobile industry is focused on Windows operating system and hardware architecture together and preinstalled software are adapted and also configured to run well and stable.

    This operating system is supported and if something should be better portable manufacturers offer different updates to the BIOS. Of course, you can preinstall what you want but you can not expect support for everything you can find on the market and because of this I n t believe that you won't find any update especially for FreeBSD 6.2 - RELEASE BIOS.

  • C50-B-15Z satellite does not recognize discs when inserted

    Toshiba Satellite C50-B-15Z
    Hello! Pls my Satellite C50-B-15Z newly purchased does not recognize discs when inserted. It dosent play any CD or DVD drive, or it even recognize it at all. Pls help... What should I do?

    Original Win8.1 is installed on your machine?
    Have you tested the feature with different CD and DVD, DVD (original)?

  • iTunes does not charge enough when synced to my car

    iTunes does not charge enough when synced to my car

    This forum is for the application of music notes... This is the wrong forum for your question.

  • My 5s, IMessage iPhone does not work and when I try to activate it by electronic mail, the box opens, but I hit the sign in button and his stays there as it's frozen! Someone help me please find a solution

    My 5s, IMessage iPhone does not work and when I try to activate it by electronic mail, the box opens, but I hit the sign in button and his stays there as it's frozen! Help

    A deal with this * day. Only thing that worked was plugging it into the computer, it supported up to the computer. Do you have a reset, and when that went to spend he asked me to do an update "carrier". If you're on verizon? My co worker and I have the two are facing it today

  • I am now on iOS 9.2 Game Center still does not work. When I open the app it freezes on a blank page. When I open the Game Center in the settings, it freezes and then crashes. Please Apple can solve this problem of Game Center iOS 9.2.

    I am on iOS 9.2 and Game Center still does not work. When I open the app it freezes on a blank page. When I open the Game Center in the Middle it hangs just. For this reason, I can't back up my data on my games. Please Apple can solve this problem of iOS 9.2.

    Hello Vaishnav,

    Thank you for using communities of Apple Support.

    I see that you are having problems with Game Center on your iPhone. I have a number of things for you to try.

    First force quit Game Center.

    1. Press the Home button twice quickly. You will see small glimpses of your applications recently used.
    2. Swipe to the left to find the Game Center app to close.
    3. Swipe up on the preview of the Game Center to close.

    Force an app to close the iOS

    If this does not work, then the next step would be a restoration. I recommend restore like new, without backup restore and everything first. If it works there, you can restore the backup.

    Use iTunes to restore your iPhone, iPad or iPod to factory settings

    Best regards.

  • 6 iPhone with iOS 9.2 does not and freezing when I try to turn on + WiFi freezes

    6 iPhone with iOS 9.2 does not and freezing when I try to turn on + WiFi freezes cannot allow him. (When I get to start the Iphone by pluging it to Itunes)

    I've done a new install and reset the network settings.

    But always the same questions

    Thanks a lot for your help

    I have the same questions and more from Friday December 11 when I've upgraded to iOS 9.2.

    Device: iPhone 5 s

    Problems:

    -Screen freezes randomly reboot * required (sometimes restart by the camera itself)

    -Sometimes device reacts very slowly on the command (or even then restarts)

    -For the most part within the first hour when used, sometimes immediately (after restart)

    -Cannot slide or apps to react when I touch

    -AssitiveTouch on, keep available however to move and opening, but no order accepted when the screen is in gel

    Resolution of problems so far:

    -Reset all settings (no result)

    -Backup on iTunes (11 dec)

    -Erase content and settings and restore the backup to iCloud (10 Dec *) (no result)

    -Erase content and settings and restore the backup of iTunes (11 dec) (no result)

    -Tried with the new iPhone camera 6 and restore backup icloud (unsuccessfully; restore hangs at "1 minute remaining")

    -Tried with the new iPhone camera 6 and restore backup of iTunes (no result: same freezing questions reappear)

    Conclusion date: is not a hardware problem (device), but one software: combination of the configuration (such as backup) and the new iOS 9.2.

    By the way: I guess that not possible to restore 9.1 on the device.

    The new iPhone 6 initially contained iOS 9.1, but then did not 'see' backups, because they were made from a 9.2 iOS device.

    So I had to first install the iPhone 6 as a new iPhone, upgrade to iOS 9.2 and then I was able to reset and restore the backup (with no good result, as described above).

    *) restarts: hold Home-button on/off-button simultaneously for 10 seconds

    backup *) in the form of clouds 10 Dec worked without problem on iOS 9.1.

    I will continue to investigate on removing the apps installed a year or two, see if that generates the result.

Maybe you are looking for

  • shuffle 4gen iPod won't charge / turn on, recognized by itunes

    My ipod shuffle 4th generation died, I found it when I was digging around old-school supplies and my phone has recently broken so it became very handy, it worked when I loaded and then I let it die once again during the week now my computer that reco

  • Microsoft Money password

    I just installed Microsoft Money 2002 work. He asked me un_mot_de_passe. What can I do?

  • HP Pavilion dv7-2160ed - blue screen with error code: 0 x 00000003, 0x86FF8688, 0x86FF87F4, 0x82E2FEC0

    Installed windows 7 - Ultimate (32 bit) and after that, I sometimes have a blue screen with error code: 0 x 00000003, 0x86FF8688, 0x86FF87F4, 0x82E2FEC0 And I also noticed that some hardware is not installed to properliy: 1 base system device:PCI\VEN

  • HP Envy 5660 - message of paper jam

    Our printer HP Envy 5660 is 2 weeks old.  It was purchased in a store of electronic chain. Implementation has not been easy.  No problem until the second week of ownership.  An error message pops up pointing a problem of paper jam.  Follow-up of the

  • MARCH tutorials and references

    Hi all I was wondering if anyone had any good tutorials MARCH or reference material? I can't do this thing do anything useful, in part because of access limited to the program, but mostly because of my lack of knowledge of what it can potentially mak