Apex Collections and dates

Apex Collections and Dates
I made an earlier posting today on the forum titled “‘ORA-01861: literal does not match format string’ error after my hosting company upgraded to Apex 3.2.” The issue relates to Apex collections and dates. Prior to the hosting company upgrading Apex 3.2 from 3.1 all was working OK. It seemed a reasonable assumption that the issue relates to the upgrade to 3.2. Having tested the code against another Apex 3.2 installation I am satisfied that the issue is not with Apex 3.2. That said, I am still getting the issue on the hosting site.
To demonstrate the issue to my hosting company and this forum, I put together a simple one page application that demonstrates the issue using the least amount of code.
I created a page with an ‘On Load – Before header” process that sets up an Apex Collection with a single value of ’20-FEB-2009’ in the c001 element as follows:
if apex_collection.collection_exists(p_collection_name=>'THEISSUE') then
apex_collection.delete_collection(p_collection_name=>'THEISSUE');
end if;
apex_collection.create_collection(p_collection_name => 'THEISSUE');
APEX_COLLECTION.ADD_MEMBER(
p_collection_name => 'THEISSUE',
p_c001 => '20-FEB-2009');
I added an SQL REPORT region to the page which uses the Apex Collection as follows:
select to_date(c001,'DD-MON-YYYY') testdate
from apex_collections
where collection_name='THEISSUE'
and to_date('20-FEB-2009','DD-MON-YYYY')
= to_date(c001,'DD-MON-YYYY')
When the page is run I get the ‘ORA-01861: literal does not match format string’ error.
If I remove the following from the SQL Report Region:
and to_date('20-FEB-2009','DD-MON-YYYY')
= to_date(c001,'DD-MON-YYYY')
and run the page, the date is displayed OK, i.e., c001 is converted to a date OK. This made me wonder whether it does not like the line to_date('20-FEB-2009','DD-MON-YYYY')? So I changed the where code for the report to :
and to_date(c001,'DD-MON-YYYY')
= to_date(c001,'DD-MON-YYYY')
i.e., convert c001 to a date and compare it to itself. The rationale being that if the c001 converts to a date OK, then comparing c001 converted to a date with itself should not give an error. It did it gave the same error ‘ORA-01861’
It would seem on my hosting site since the upgrade, that Apex and Oracle have problems with Apex Collection elements being converted to dates as part of the where clause.
Now my understating of Oracle Apex collections in simple terms is that all Apex collections are held in a single Oracle table managed by a series of Apex functions. Given that all Apex collections are in the same table, could the issue be with the Oracle database when it is creating its execution plan for the query? Could Oracle be including the value of c001 from other collections (i.e., when c001 is not in a date format ) in the initial stages of its execution plan?
I hope the above make sense and thanks in advance.
Ian

Scott,
I believe I have found the answer the statistics on WWV_FLOW_COLLECTIONS$ and WWV_FLOW_COLLECTION_MEMBERS$. are out of date and Oracle is doing a full table scan instead of using the indices to select only the c001 columns that belong to the given collection_id. If I change my simple example to store the date value in c050 it works ok. (In all probability this will be the only collection on the hosted database to use c050).
I have asked the hosting company to gather stats on all the apex tables.
Thanks for your help
Ian

Similar Messages

  • 3.1.2 - apex collections and invalid number

    Hi,
    We use collections on a number of pages in our production applications and everything is running well. Those applications are running on Apex 3.0 right now in 4 different environments.
    We have now upgraded to Apex 3.1.2 on 3 of those environments. 2 of them work properly, but with the other one we get an error message "invalid number" with the collections. The data is the same on all the environments.
    The query looks like this (c002 is always a number) :
    select to_number(c002), to_number(c001)
    into   v_seq, v_page
    from   htmldb_collections
    where  collection_name = 'COLLECTION_NAME'
    and    to_number(c002) = 1;
    I have modified the query like this to get it working again :
    select to_number(c002), to_number(c001)
    into   v_seq, v_page
    from   htmldb_collections
    where  collection_name = 'COLLECTION_NAME'
    and c002 = '1';
    1) Why is that happening in only one of the 3 environments using Apex 3.1.2 and none of the Apex 3.0 environments ?
    2) Why can't i do a to_number in the where clause when i do it in the select with the same data ?
    Thanks for your help !
    Patrick

    probably there is some data in c002 which is not number and when you convert it with to_number(c002) it is failing, but when compare it with c002 = '1' as there is no conversion of data before compare every thing works fine.

  • Auditing usage of ApEx applications and data

    Hi there,
    I am new to the Oracle forums and asking this question not as a DBA but from a systems security angle...
    I am using ApEx to deliver business applications to my user community and I need to know collect audit trail information on system usage. I'd like to obtain information such as:
    - which user made a database change, or accessed particular database records
    - if a user has tried to access information that they have no rights to see
    - if a DBA has created new users or changed access privileges
    and so on...
    My interest is in finding out firstly if it can be done and, secondly, how it can be achieved and recorded for analysis.
    Grateful for any advice!
    Many thanks,
    HoinviP

    We've turned on fine grained audting (FGA) and the coolest part is that oracle automatically picks up the apex application level user name and puts it in the FGA log. I expected our audit logs to have a whole lot of "apex_public_user" or the workspace schema name in the user field, but when you've got a non-public app, the end user's ID gets captured. Just as it should be.
    Our app has two layers of auditing. The vendor delivered application level audit logs so that critical application level events are captured. This is just part of the code overhead of the application. In addition we turned on Oracle FGA so that we know every DDL/DML operation that occurs against our most sensitive tables.
    The short answer is that if FGA doesn't get you what you want, you'll have to build your own auditing into your app. There is no magic checkbox or setting that will add auditing to your app, though FGA goes a long way if set up properly.
    Inside our apex app, our developer put a process on every page that displays sensitive information. The process calls a stored procedure with the user's name, the sensitive field name, its value and the primary key of the record displayed. The process has the same authorization scheme as the sensitive fields. So, if the sensitive data field is displayed, the process is run, if the user cannot see the field, no audit process is run. It actually works pretty well.
    We've also written additional Apex Apps that analyze the application level audit logs so that we can track who is looking at what and when. Very useful.

  • ITunes movie collection and data fill for the "Get Info" section...

    I am an avid iTunes (iTunes 8.2.1(6) for Mac) user. My iTunes Library is stored on an OWC Guardian Maximus Raid (1tb-1tb) connected via USB2.0 to my Intel iMac (2.26 C2D/ 2GB RAM/ 350GB HD/ 256K ATI Radion X1600). I have 3 Apple TV's that we use constantly to watch our movie collection in different locations throughout the house (Kids Playroom, Living Room, & Master Bedroom) using our 3rd Generation AirPort Extreme (Dual-Band).
    Does anyone know of a service or program that can data fill all of the information in the "Get Info" sections especially for the movies? I have the titles and dvd cover photo on all of them just not any of the other information. The only ones that have any other information are the ones I purchased from the iTunes store. Any ideas or help is greatly appreciated.

    Try MetaX
    Regards

  • Search does not crawl new site collection and documents

    We have the following situation. We have two locations with different farms sharing the same databases (using AlwaysOn for the content databases). Everything works fine, the second site is also read-only while having the primary farm online. For existing
    databases the search crawler on the second site is able to crawl existing site collections.
    For new site collections created on the first farm the crawler on the first farm indexes the content proberly. The second farm though is not knowledgable of the content unless you force him to reiterate the content database. After this procedure the sites
    are available on the second site as well (showing them in the web browser), but the search farm still is not able to see the new site collection and data created within.
    Is there any additional iteration we have to go through making the crawler aware of the new structure / content ?
    Thanks in advance, Jens

    Nope.
    Change log wipes are real, that's how incremental crawls work in SharePoint.
    Site A is created and modified. Changes are mirrored to the second AG, content is added, logged in the changes log and then removed as the crawler on the primary farm indexes it.
    This continues until you make farm 2 aware of the changes. At that point farm 2 will look for any changes to the content in the change logs on the newly added sites. Which will be empty, or at least not contain any changes since the primary farm's last crawl.
    That explains why you don't get sites indexed properly when they are added but would explain why some content is indexed afterwards which i believe is the case?
    The second issue you'll find is that the crawls won't synchronise. Assuming continuous crawls kicking off at the same time you'll end up in a race between the two. If the primary farm is quicker then the second farm will continuously fall behind then catch
    up and go ahead of the primary indexing process, but if the secondary farm is faster then it'll race off into the distance and then any changes that occur between the secondary farm indexing a site and the primary indexing the site will be lost on the secondary
    farm.
    You'll have to run full crawls. Unless MS have done a lot of work on the supporting infrastructure incremental or continuous crawls of AOAGs won't work well.

  • Using wwv_flow_load_excel_data and apex collections

    Hi!
    I have a question regarding very popular subject: parsing csv files.
    I made one application, which takes csv file, parses it using Vicas's code, presents validation report to the user, and finally allows to submit data into the datatable.
    Everything works fine, but I don't like this solution. CSV can cause problems when quotation mark is used inside, when numbers have 1000 separators and so on.
    Besides that, I have to add some code to validate column types. Lot of mess.
    The solution incorporated into apex tool, called "Data Load/Unload" looks much better. It would be nice to use that inside apex application adding some business validations, and hardcoding table and columns names.
    I have seen wwv_flow_load_excel_data package and I'm wondering if it is possible to use load_excel_data procedure to perform that task?
    Is there any documentation to that package?
    Somebody heard about using that with apex collections (to avoid a need of temporary table)?
    Regards,
    Arek

    And if somebody else is looking for "ApEx" forum:
    Oracle Application Express (APEX)

  • How do I perform a trigger that collect the data for every rising edge continuously and then automatically put the data in a .xls file??

    I need to collect the data for every rising edge a trigger perfoms. So far I could collect the data but it seems that it only collect the data in the start of triggering, but not continuously. I also want to put the data in an excel spreadsheet and automatically add new set of data when the next rising edge occur. Please help.
    thanks a lot.

    LabWindows/CVI actually ships with a comprehensive set of examples for just about every area of programming you can use it in, including triggered analog data acquisition and ActiveX control of Microsoft Excel for data logging. Go to the following two directories on your computer to find respective examples for the two areas you are inquiring about:
    1) C:\MeasurementStudio\CVI\samples\DAQ\Ai\DAQsingleBufExtTrig.PRJ
    2) C:\MeasurementStudio\CVI\samples\activex\excel\excel2000dem.prj
    Just make sure to study the examples carefully so that you fully understand the processes followed for triggered analog acquisition and the process of launching an ActiveX automation server for control, and then you should be able to merge the concepts shown in both of the example
    s to make the application you desire.
    Jason F.
    Applications Engineer
    National Instruments
    www.ni.com/ask

  • APEX application  version, author name and date  (history)

    Hello,
    I have created few application in APEX ,I want to add version, author name and date for that application's.
    Please help wherein I can enter in APEX like in Oracle form (pre-form trigger we can add.)
    Thank you in advance.
    Regards,
    Gaurav Nagpal.

    Hi,
    I have never used Forms, so I'm not exactly know what you mean.
    But APEX application definition have version attribute that you can use.
    http://docs.oracle.com/cd/E37097_01/doc/doc.42/e35125/bldr_attr.htm#CHDGJHDC
    And you can add author and date to e.g. application comment
    http://docs.oracle.com/cd/E37097_01/doc/doc.42/e35125/bldapp_comment.htm#CHDBGHJG
    Regards,
    Jari
    My Blog: http://dbswh.webhop.net/htmldb/f?p=BLOG:HOME:0
    Twitter: http://www.twitter.com/jariolai

  • Measure Formulae for Uploadable and Data collection report

    Hi,
    I have query related to application of measure Formula for Uploadable and Data collection report.
    Consider a scenario where i use a MDX query to create a data collection report and I map these columns from these reports to an rowsource using a loader file. Can I use measure formula feature like onchange to work with Uploadable and Data colection reports such that changes to any one column should take effect in another column.
    Regrads,
    Wesley

    Wesley,
    IOP uploadable reports are used for sending data to the server in batch. They are coupled to the IOP model via a rowsource. You have a lot of flexibility with the spreadsheet you build for staging the upload. It's really just a function of how crafty you are with vb. Cascading changes from one column to another can be easily accomplished this way.
    Onchange formulas are for something else. They are part of the model definition and are used for describing how to cascade changes between IOP data blocks.

  • Is it possible to have a phone line connected to a Mac Mini (OS X10.8.2) so you can use your computer with Parallels (Windows xp) to dial into a modem to download data being collected and stored at the remote location?

    Is it possible to have a phone line connected to a Mac Mini (OS X10.8.2) so you can use your computer with Parallels (Windows xp) to dial into a modem to download data being collected and stored at the remote location?

    Hi, do you mean a real Dial-up Modem as in the old days?
    As I recall, the Apple USB Modem won't work in 64 bit OSes, but there are others that will, I think this is one of them...
    http://www.zoomtel.com/products/dial_up_external_usb.html
    Or is the Modem on the other end Cable/DSL/FiberOptic?

  • I connect my pendrive to macbook pro but it cannot detect and my important data is there in my pen drive so how can i collect this data from my pendrive?

    i connect my externalpendrive to macbook pro but it cannot detect and my important data is there in my pen drive so how can i collect this data from my pendrive?

    make sure that in your finder preferences you have it checked to show external drives on the desktop and in the sidebar of finder
    you find these preferences by selecting the finder icon (blue square on the dock w/ smiley face on it) then click on the work "finder" at top left corner of computer screen then click on preferences then general and put check next to show these items on the desktop and put check next to external drives
    now you should see it on the desktop if you still can't open the drive or access it, it may be in format the mac can't read or write to so that could be an issue.

  • Serial data collection and display

    I write machine code for microchip cpu's and have a project that transmits
    about 80 characters of hex data at 115k baud. I would like to use labview
    (or ?) to collect the data and display it on a pc. Does anyone know if about
    80 bytes sent at that speed and repeating as often as 10ms will choke
    LabView? Also, if anyone with a good understanding of LabView serial com is
    in or near Las Vegas I would be interested in their services.
    Andrew MacDonald
    [email protected]

    The data rates you're talking about should be doable with LV as long as there isn't something else running on the machine that is consuming an inordinate amount of processor time.
    The only thing to be careful of is putting too much processing in the acquisition loop. What exactly are you trying to do?
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • How to create an apex collection to store and loop through the values

    I couldn't find any simple example to do this
    Apex 4.2
    I need to create an apex collection. I have a query that returns multiple roles for a user. I need to check to see if one of my item values is within the collection but am not sure how to do so. So far I have:
    begin
    APEX_COLLECTION.CREATE_COLLECTION (
    p_collection_name => 'ALL_ROLES');
    select count(granted_role) into count from dba_role_privs where upper(grantee) = upper(:APP_USER);
    end;
    How would I store the query results in the collection?

    Trying to understand your code and a better suggestion:
    declare
    is_viewable boolean;
    v_count number;
    l_query varchar2(2000);
    i_counter number(10) :=1;
    begin
    --l_query := 'select granted_role from dba_role_privs where upper(grantee) = upper(:APP_USER)';
    --why do you need a collection, this is a simple select count(1) question
    APEX_COLLECTION.CREATE_COLLECTION_FROM_QUERY (
    p_collection_name => 'ALL_ROLES',
    p_query => l_query,
    p_generate_md5 => 'YES');
    -- You create a collection, but where are you using it?
    -- select count(granted_role) into count from dba_role_privs where upper(grantee) = upper(:APP_USER);
    -- discard the above code
    -- If you want to see  how many elements in a collection
    -- determine # of elements in a collection
    http://docs.oracle.com/cd/E23903_01/doc/doc.41/e21676/apex_collection.htm#CJAFFEAH
    v_count := APEX_COLLECTION.COLLECTION_MEMBER_COUNT ('ALL_ROLES');
    IF :P32_SUBMISSION_DATE IS NOT NULL THEN
      begin
      select count(granted_role) into v_count
         from dba_role_privs
      where upper(grantee) = upper(:APP_USER) and
        granted_role in ('SURVEY_SUID','SURVEY_JOB_SUID');
      exception
      when no_rows_found then
        v_count := 0;
      end;
      if v_count > 0 then
        is_viewable := true;
      else
        is_viewable := false;
      endif;
    else
      is_viewable := false;
    endif;
    return is_viewable;
    end;Thank you,
    Tony Miller
    Ruckersville, VA

  • How can collect the data from laptop sound card and serial port at the same time?

    I'm working on a project, I need to collect the data from laptop sound card, and also from serial port at the same time.
    The attachments are my VIs for sound card and serial port communication, I'm wondering that can I combine these two VIs together? Or can I run these two VI at the same time?
    Thank you!
    Attachments:
    AC_Radar_Receive.vi ‏46 KB
    RadarAudioPlug.vi ‏774 KB

    A smarter way is just to put all your code in the same VI.
    Two parallel loops if rates are different.
    Attachments:
    RadarAudioPlug.vi ‏450 KB

  • Distribution and data collection (first attempt)

    I created a form that I will distribute manually over email.  I'm asking users to submit their answers to a local drive and I collect the data with the built-in spreadsheet.  I have some questions regarding the behavior of this system.
    1-Is there a way to automatically identify the responder other than asking him to input a name and an email?
    2-Is there a way to keep track of those that were sent a form but did not submit a result?
    3-What happens if someones submits the same form twice with minor changes?
         -does it create a double entry?
         -does it overwrite the previous entry?
         -does it warn the distributor that a change has been made?
    4-Do users need to have read/write access to the SPREADSHEET also?
         -if so, I don't want users to have the possibility to see other user's answers.  Any idea?
         -if not, can I move that spreadsheet somewhere else at anytime without problems?
    5-Regarding the spreadsheet, any way I can change the name of the columns or do I have to resort to field names?
    6-Any way I can omit certain fields to be collected? (like checkfields that automates layout of the form)
    7-How can I manipulate data from the spreadsheet to display in a more convenient way? (exporting data or importing from an excel file would be perfect)
    That all for now.  I hope someone as used enough of this function to be able to answer such specific questions.

    This applies to PDF forms that have been Reader-enabled by Acrobat, not PDF forms that are enabled by FormsCentral. It's also not very accurately worded. The limitation imposed by the Acrobat License Agreement can be summarized with the following:
    If a Reader-enabled form is distributed (i.e., made available) to more than 500 people, you are limited to using data from no more than 500 instances (including hardcopies) of the form that have been returned to you. If a form is distributed to 500 or fewer people, there is no limitation on the number of returned forms that you may use data from.
    It isn't worded well because the license specifically states that you may distribute an enabled document to an unlimited number of recipients. The limitiation is on the number of forms you are allowed to use data from, not on the number of people you are allowed to collect forms from.

Maybe you are looking for