Query about loops in an APEX calendar...

Hi everyone,</br></br>
I would like to know how to make a loop with the following settings:</br></br>
1. I have a calendar on Application Express 3.0.1.00.08.</br>
2. I do create some events on it, and got a start and end date.</br>
3. On the calendar I can only see the event on the start date, but I need it to be seen from the start one until the end one...
</br></br>
So I went to PL/SQL and made the following tests:</br></br>
1. created a loop example and tried to understand it:</br></br>
DECLARE</br>
a NUMBER := 0;</br>
FS DATE := SYSDATE;</br>
FF DATE := (SYSDATE+5);</br></br>
BEGIN</br></br>
WHILE ( FS < FF ) LOOP</br>
a := a + 1;</br>
FS := FS + 1;</br>
dbms_output.put_line('paso ' || a); </br>
END LOOP;</br></br>
dbms_output.put_line('Dato a: ' || a);</br>
dbms_output.put_line('Dato FS: ' || FS);</br>
END;</br></br>
I do get this as an answer:</br>
paso 1</br>
paso 2</br>
paso 3</br>
paso 4</br>
paso 5</br>
Dato a: 5</br>
Dato FS: 17-MAY-08</br></br>
Statement processed.</br></br>
0.00 seconds</br></br>
2. Once I had this I decided to modify what I had:</br></br>
This is the block of code that needs to be repeated.</br></br>
select '< a title= " TGB SCHEDUL " href = "f?p = &APP_ID.:3:' || :APP_SESSION || '::::P3_ID: ' || ID || ' " > ' || EVENT_NAME || '</a>
' EVENT_NAME,
START_DATE</br>
from     APP_TGB</br></br>
So I placed it in the middel of the loop...</br></br>
DECLARE</br>
FS DATE := SYSDATE;</br>
FF DATE := (SYSDATE+5);</br></br>
BEGIN</br></br>
WHILE ( FS < FF ) LOOP</br>
select '< a title= " TGB SCHEDUL " href = "f?p = &APP_ID.:3:' || :APP_SESSION || '::::P3_ID: ' || ID || ' " > ' || EVENT_NAME || '</a>
' EVENT_NAME, START_DATE
from     APP_TGB;</br>
END LOOP;</br></br>
END;</br></br>
And got this message:</br>
1 error has occurred</br>
·     Query cannot be parsed, please check the syntax of your query. (ORA-06550: line 8, column 3: PLS-00428: an INTO clause is expected in this SELECT statement) </br></br>
Yes it was my mistake, I forgot the cursors in the selects… but here is where I do really need your help as I really don’t know how to implement them, and now with the variables that I have got.</br></br>
I do really appreciate if anyone can help me out with it.</br></br>
Best regards.</br></br>
Jaison González</br></br>

Hi Dimitri,<br><br>
Once again, thank you very much for your time and answer,<br><br>
1. Is it really necessary to do this for your whole table? There is no WHERE clause in your statement <br>
Yes you are right I in the block of code that I sent you, I don’t have any WHERE clause but on the tests that I made, I have the following:<br><br>
select START_DATE+level-1<br>
from ( SELECT '<a title="TGB SCHEDUL" href="f?p=&APP_ID.:3:' ||
:APP_SESSION || '::::P3_ID: ' || ID || '">' || EVENT_NAME||
'</a>
EVENT_NAME, START_DATE, END_DATE from APP_TGB WHERE ID = 141)<br>
a connect by level <= (END_DATE - START_DATE)<br><br>
But I as I have more that one event on the calendar, which are identified by different IDs, I remove it (the WHERE clause) thinking about the calendar’s convenience… <br><br>
2. I guess you want in your outer select also the event_name?
select start_date+level-1 as sdate, event_name, start_date, end_date
from (select ... )<br>
Yes, I will prove it and tell you how it works… sorry about it… <br><br>
3. Not sure what you mean with that?<br>
Right now, if I have as start date 5 and end date 10, it shows me on the first day (one) EVENT_NAME, on the second (four) EVENT_NAME, on the third (twelve) EVENT_NAME… and go on till it gets to the 10th…<br><br>
Thank you very much for your help.<br><br>
Best regards,<br><br>
Jaison

Similar Messages

  • About APEX Calendar views (monthly, weekly, daily)

    Hi,
    How can I display a DAILY APEX CALENDAR?
    I read in some APEX-related articles that it is possible to have 3 different views: monthly, weekly, and daily.
    example 1. http://insum-apex.blogspot.com/2008/07/apex-calendar-enhanced-behavior.html
    example 2. http://examples.apex-evangelists.com/pls/apex/f?p=286:29:0:::::
    I tried to follow the directions given in one of those examples but I found out that the tags in my local environment differ from the ones shown in the example. I don't have the MONTHLY CALENDAR, WEEKLY CALENDAR and DAILY CALENDAR tabs mentioned in the example.
    Please help.

    Hi user10284066,
    Thank you for mentioning this link http://insum-apex.blogspot.com/2008/07/apex-calendar-enhanced-behavior.html
    in this forum. Helped a lot.
    For people who want to know where to find these tabs,
    Home>Application Builder>Application XXX>Shared Components>Templates
    select calendar and you must see those(monthly, weekly, daily) tabs under
    Home>Application Builder>Application XXX>Shared Components>Templates>Edit Calendar Template
    or upgrade to a newer version

  • Display all dates between a start and end date on an Apex Calendar

    Hi Guys,
    I am encountering an issue where Apex doesn't display the data from a valid query in a Calendar.
    I have a simple table used to capture events data with the following columns and data:
    event_id   start_date   end_date
    1           20-APR-09   22-APR-09
    2           24-APR-09   24-APR-09Using an Apex Calendar I would like to display the continuous dates of an event on each relevant date, so in the above example I would like to see Event ID 1 shown on the 20th, 21st & 22nd April in the Calendar.
    I have created the following query :
    SELECT     ees.event_id,
               ees.start_date + LEVEL - 1 AS date_range
    FROM       dual
             , (SELECT ee.event_id,
                       (ee.start_date) AS start_date,
                       (ee.end_date)   AS end_date
                FROM   ees_event ee  ) ees
    CONNECT BY LEVEL <= (ees.end_date - ees.start_date + 1)the results from this query list the dates as I require them in terms of an ID and a row for each date in the date range.
    I then wrap this query into a view and use that to base an Apex Calendar on and the when I run the page nothing is displayed on the Calendar?!
    Does anyone have any tips or pointers please?
    Kind regards,
    stu

    A bit more digging and once again I have found my solution on Denes' website - thanks for such and excellent resource!
    Solution I have used can be found here:
    http://apex.oracle.com/pls/otn/f?p=31517:83:4441524250972745::NO

  • ApEx Calendar Region - enhanced behavior using JavaScript

    Hi everyone,
    I recently wrote about the built in calendar. Comments/remarks are welcome! :)
    http://insum-apex.blogspot.com/2008/07/apex-calendar-enhanced-behavior.html
    Louis-Guillaume
    Homepage : http://www.insum.ca
    Blog : http://insum-apex.blogspot.com

    Hi Emma,
    You could do it with an POP-UP LOV and Dynamic Action.
    Dynamic Action
    - Change
    - item P65_STAFF_ID
    True Actions
    1 - PL/SQL block;
         - PL/SQL Code in this block you can get the last of first date for the absence of the STAFF_ID and put it in the date item for the calendar (eg P65_CALENDAR_DATE);
         - Page Items to Submit P65_STAFF_ID
         - Page Items to Return P65_CALENDAR_DATE
    2 - Execute Javascript Code
         - apex.widget.calendar.ajax_calendar('M','same',$v('P65_CALENDAR_DATE'));
    This way the calendar will be refreshed and set to the date in P65_CALENDAR_DATE.
    You can also put "null;" in the PL/SQL block, leave the Page Items to Return empty and remove the ",$v('P65_CALENDAR_DATE')" part from the Javascript code. This way you do not open the calendar at the right date.
    I made a small example at http://apex.oracle.com/pls/apex/f?p=14257:4 (login as demo/demo).
    Regards,
    Kees Vlek
    <tt>Company: http://www.orcado.nl
    Blog: http://www.orcado.nl/blog/blogger/listings/69-kvlek
    Twitter: http://www.twitter.com/skier66</tt>
    If the question is answered please change it to answered and mark the appropriate post as correct/helpfull.

  • Apex Calendar has a row limit per day?

    Hi, I am using the apex calendar in my application and it seems to have a limit of rows it can display per day, does anyone knows anything about it? Or maybe a limit of characters it can display in one day. (full month view)
    What I need to do is to increase this limit because I need to show in the calendar sometimes more then 70 rows displaying costumers full names.
    I use Apex 4.2 databese 11g and the theme is 26 -Productivity Applications
    Thank you
    André

    I foung this Apex SQL Calendar - ORA-06502 Error that is the same error I get but still no solid answer about it or if there is a work around.

  • Apex Calendar has a row limit per day? character limit per day?

    Hi, I am using the apex calendar in my application and it seems to have a limit of rows it can display per day, does anyone knows anything about it? Or maybe a limit of characters it can display in one day. (full month view)
    What I need to do is to increase this limit because I need to show in the calendar sometimes more then 70 rows displaying costumers full names.
    I use Apex 4.2 databese 11g and the theme is 26 -Productivity Applications
    Thank you
    André

    I foung this Apex SQL Calendar - ORA-06502 Error that is the same error I get but still no solid answer about it or if there is a work around.

  • APEX Calendar Help - I'm stuck!

    Hello,
    First let me preface this by saying I am not an APEX expert and have been learning on the fly for the past few weeks. As a trainer for my organization it was important to have a dynamic training and events calendar with some specific features. I found a pre-packaged [Sample Calendar|http://www.oracle.com/technetwork/developer-tools/apex/application-express/packaged-apps-090453.html] application, uploaded that and have modified it to fit about 90% of my needs. Here is where I am stuck:
    1. I need to change how the events sort. I need alpha sorting, ideally.
    2. I currently have two different calendar groupings, soon to be three. Meaning, I have some events labelled as Training & Events and others labelled as Birthdays. I would like to color code these on my calendar so that it is clear to users what is what. I know how to change the highlighting color of all events, but not how to specify based on an identifiable column in my table.
    3. I created a page to reflect event details. When you click on a given event, it redirects to another page and shows the name, date, start time, web conference and dial-in details. The problem is the latter two items are showing blank when there is data in my table. Ideas?
    Any help or guidance is greatly appreciated. I am using APEX 4.2.
    Thank you,
    Christina

    Hi,
    1. I need to change how the events sort. I need alpha sorting, ideally. - The current calendar design overrides your sorting and uses the Calendar date column instead. There is a workaround for this provided your Calendar is SQL based.
    select display_column, cast(date_column as timestamp) + numtodsinterval('0.00' || rownum,'SECOND') shift_date, sort_column from
    (select display_column, date_column, sort_column
    from your_table
    order by sort_column desc)
    http://sathishkumarjs.blogspot.in/2013/05/trick-to-sort-apex-calendar-data-based.html
    2. I currently have two different calendar groupings, soon to be three. Meaning, I have some events labelled as Training & Events and others labelled as Birthdays. I would like to color code these on my calendar so that it is clear to users what is what. I know how to change the highlighting color of all events, but not how to specify based on an identifiable column in my table. -
    To acheive this yo need to modify the SQL statement with additional case statement to get the color of your choice and modify the display column as custom and add the column value as background/foreground color of your choice this needs some custom HTML / this also can be achieved by Modifying the Calendar Template. if needed will blog this with practical example.
    3. I created a page to reflect event details. When you click on a given event, it redirects to another page and shows the name, date, start time, web conference and dial-in details. The problem is the latter two items are showing blank when there is data in my table. Ideas? -
    If you mean some data columns displays correctly will others does not show data, want you to check the data source of those columns, whether it is similar to columns which work fine, if not want to know does the columns which does not display the value is in anyway related to display / date column used by calendar.
    thanks
    Sathish

  • Translate daynumber to date in APEX calendar

    Hello all,
    I've got a problem with a query for a calendar.
    My current customer has two tables to see wether or not an employee is available.
    One to see if an employee has parttime hours.
    EMP_CALENDAR
    - empno number
    - day_name varchar2(24)
    - day_number number
    - work_hours number
    - non_work_hours number
    Each employee gets 5 rows. One for each workday of the week showing 0 to 8 in the work_hours and non_work_hours column.
    And one to see if an employee has time-off.
    EMP_NON_AVAILABILITIES
    - empno number
    - start_date date with timestamp
    - duration number
    - description varchar2(255)
    My predicament is that I have to build screens with monthly calendars and week calendars to show both data.
    A query for the non-availabilities is easy enough, because I have a date field available. Using the timestamp I can show it correctly in a week calendar. But showing the part-time hours is a bit more challenging.
    Can anybody help me with this? I don't have a clue how to transform the EMP_CALENDAR data to integrate with the EMP_NON_AVAILABILITIES data when using an APEX calendar.
    The trouble is that I can translate a single date to a workday without a problem, but the APEX calendar only gives me 1 date; the CALENDAR_DATE. The other days of the week aren't available in an ITEM as far as I know.

    I've found a solution myself. I don't think it's very pretty, but it does the trick.
    select empno display_value
         , start_date return_value
      from emp_non_availabilities
    where empno = :APP_USER
    union all
    select empno display_value
         , dd.return_date return_value
      from emp_calendar
         , (SELECT (to_date(:P110_CALENDAR_DATE,'YYYYMMDD') + (LEVEL-7)) return_date
              FROM DUAL
           CONNECT BY LEVEL < 14) dd
    where day_number = to_char(dd.return_date,'D')
       and empno = :APP_USERI have to select 14 days from 7 days before :P110_CALENDAR_DATE until 7 days after, so I can get all data for my weekcalender. I don't know in advance which day of the week my CALENDAR DATE will be.

  • Altering an ApEx Calendar page

    Hello,
    I was wondering if it was possible to alter an ApEx calendar page in order to make it into a resource scheduling page. Instead of the days listed across the top, it would have a list of resources (like shared meeting rooms), then times would be listed in a vertical column, showing who was using what resources.
    Thanks!

    Hi,
    You can use something like this:
    http://www.moyosoft.com/joc/
    This is not Open-Source, it might be the case that Apache POI is working on something for Outlook now since Microsoft release the main API calls not too long ago.
    You will need the native library, and I assume somehow you can do a WebStart application to run the code in the client machine. Information regarding Java WebStart can be found on http://java.sun.com/javase/technologies/desktop/javawebstart/index.jsp
    I did not really investigate other ways of doing this, maybe there are better approaches.
    Also, take a look here http://java.sun.com/products/javamail/Third_Party.html
    Hope it helps,
    Daniel
    Edited by: Daniel Ruiz on May 3, 2010 1:11 PM

  • Repeating event in an apex calendar

    Hi all,
    I would like to have a repeating meeting let's say every day
    from 8 to 10 am
    what would be the best way to do this in apex calendar ?
    what I do now is 2 * 5 inserts, one for eacht weekday and one for 8 and one for 9 o'clock
    is there no between somewhere
    Kr
    Martin

    Hello Martin,
    Seems you have to check out [Dan McGhans|http://www.danielmcghan.us/] PlRecur package... It is available on SourceForge.
    Greetings,
    Roel
    http://roelhartman.blogspot.com/
    You can reward this reply by marking it as either Helpful or Correct ;-)

  • Apex Calendar synchronize with Google Calendar

    Hi Friends,
    i have create an calendar region and i have enter my new appointment details on 15 november at 3:00 Pm .
    Then these value would be show on my calendar .
    But i want to see this appintment in google calendar also.
    How Can i synchronize apex Calendar with google Calendar.
    How can i do this.
    Thanks

    Hi 805629,
    I don't have the exact answers to your questions... but some extra details might help others.
    i.e. Which way do you want to synchronize - google to oralce; oracle to google; both? Does it need to be automated?
    Not too sure how easy an automated synchronization would be. Check out this thread: Is there a way to generate an .ics or .vcs file from an APEX calendar? on exporting the ICS file (which you would be able to upload into Google Calendar).
    You may want to check out this site - http://code.google.com/apis/calendar/ - In particular, the Data API. You should be able to get your app to create events directly in the google calendar when you create them in APEX. But again, I haven't dealt with this.
    By the way, what is the reasons for wanting synchronization between a google calendar and an apex calendar? (as opposed to just having the google calendar embedded in your site)
    Good luck :-)
    Ta,
    Trent

  • Query about local storage

    Hi,
         i had a query about local storage.
         I've a machine that hosts weblogic and tangosol. i've an ejb that accesses a distributed cache i.e NamedCache cache = CacheFactory.get("MyCache")
         i modified tangosol-coherence.xml and set local-storage to false ( for distributed cache) and replaced the file in coherence.jar.
         i'm using an overflow scheme and the back map uses a disk scheme.
         i also start a separate standalone instance of tangosol and i set the system property of local storage to true for the standalone instance.
         i start the standalone instance first and then weblogic.
         The idea is ensure that the tangosol instance in weblogic or the weblogic JVM should not participate in storing data (hence local storage false).
         only the JVM for the standalone instance should store data (hence local storage true -system property).
         i wanted to know whether the property "local-storage" is pertinent to a member(machine) or to a JVM?
         the reason for this doubt: as i'm using a disk scheme, tangosol creates a file for an overflow (e.g lh014402~.tp). i can see two such files when ideally i would have wanted only one for the tangosol instance.
         -rw-r--r-- 1 zephyr users 8364032 2005-06-23 17:02 lh014402~.tp
         -rw-r--r-- 1 zephyr users 8364032 2005-06-23 17:02 lh014403~.tp.
         can you please let me know if we can configure tangosol in such a way that we can two separate instances running with local stroage false for one and true for the other?
         Awaiting your reply
         Thanks
         Vinay

    I would suggest leaving the default 'local-storage' value set to 'true' in the tangosol-coherence.xml and just use the JVM argument to control the local storage of each individual node. Then start the stand alone instance normally (I assume you are using the com.tangosol.net.DefaultCacheServer) and start the WebLogic instance with the following:
         java [...] -Dtangosol.coherence.distributed.localstorage=false [...]
         Hope this helps.
         Later,
         Rob Misek
         Tangosol, Inc.

  • Apex Calendar Context (right click) menu

    Hi all,
    Apex version: 4.2
    Plugin: context(rightclick) menu by Vikram
    I'm using this plugin and it works perfectly for SQL Reports and IRs. For example this function opens a new popup window with the ID selected by right clicking an entry.
    function myMenuAction(action, el, pos)
      if (action=='TEST')
          window.open('f?p=&APP_ID.:52:&SESSION.::NO::P1_ID:' + $(el).children('td[headers="ID"]').text(),'Popup','height=800,width=800,toolbar=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no ,modal=yes');
    ...I want to know if there is a way to do the same on an apex calendar entry.
    Thanks in advance.
    Matt.
    (changed 'handle')
    Edited by: 942631 on 08.04.2013 03:24
    Edited by: 942631 on 08.04.2013 03:43
    Edited by: 942631 on 08.04.2013 03:43

    Matt S. wrote:
    http://apex.oracle.com/pls/apex/f?p=62302:1
    User: demo
    PW: demo
    When i do the same on the calendar ("Home") i don't get the ID "http://apex.oracle.com/pls/apex/f?p=62302:4:111941727026117::P3_X".
    What i expect is (in this example) "http://apex.oracle.com/pls/apex/f?p=62302:4:111941727026117::P3_X:*7499*"
    This is what i wanted to do. I tried different things to achieve the same result as in "TS2".you haven't provided the workspace login details to check if this works but I managed to see that you are currently using a jquery selector *#CALENDAR_PRZ_LIST table tr*
    try this instead
    .Calendar tbody tr td div

  • Apex calendar report url problems

    Hi
    im having problems with the "day link" attribute in an apex calendar report.
    i have the calendar set up so that when you click the date in the calendar it sends the date formatted correctly to the date picker field in my create a new appointment page. so pre-populating the field as the page is loaded.
    initially i used the standard "page in this application" function and passed the substitute string #DD# #MON# #YYYY# to the date picker item P6_APT_DATE, setting the link to go to page 6 etc....
    this actually works fine but apex converts in into a URL
    f?p=&FLOW_ID.:6:&SESSION.::&DEBUG.:6:P6_APT_DATE:#DD#-#MON#-#YYYY#
    which does exactly the same thing. and both work perfectly
    However - nether are saved by apex? if i go back to edit the report the "day link" section is blank but both continue to work even when i refresh / re-cache the page.
    i have had similar happen in the past when the link isn't formatted correctly, the problem here is that it all works fine until you go back in to edit the calendar report, at which point the url / links vanish.
    im just starting out with apex so my apologies if i have missed anything obvious. any help would be appreciated
    regards - Solomon Hill
    Message was edited by:
    SolomonHill

    Solomon,
    I'm not sure exactly how your calendar page works, but the # character cannot appear in URLs except as an named-anchor reference.
    If you can show me your app on apex.oracle.com, I'll take a closer look.
    Scott

  • SQL query performance between TOAD and APEX

    Hi Guys,
    I would like to know if there is any performance difference between a simple query run in TOAD and APEX(classic report).
    The reason being, I have a query based on a single table(conataining 15000 rows) which takes almost 30seconds in APEX whereas it takes just 2-3 seconds in TOAD.
    Thanks,
    Raj.

    Varad,
    Thanks for your suggestion.
    I tried changing the pagination but not much it helped.
    Basically I have 5 reports on the same page.
    When the user first navigates to this page then Report-1 is generated first with data as links to other reports.
    So I guess when I click on any of the column links on the Report-1 then the page is refreshed and this time its taking total time for Report-1 and Report-2.
    Is there a possibility that we can circumvent the execution of the first query or cache the results of report-1 so that when the page is refreshed it displays the data from the cache for Report-1 and executes the query for Report-2 ?
    -Raj

Maybe you are looking for

  • How to upload photos from memory card to computer on new Officejet 8500A Plus?

    I recently replaced an older HP psc 2410 photosmart printer with a new Officejet Pro 8500A Plus printer.  The installation went fine without error messages, and it prints, scans and copies just fine.  When I insert a memory card into the slot, the pr

  • Preview in bin doesn't work in STP 3

    I send a multitrack from FCP 7 to STP 3, withing STP 3 I open the bin & select a file to audition, nothing happens & the play button is grayed out and not selectable. Same in the browser. I browse to a file on my HD, select it & it won't preview... A

  • How to delete delete "Blank" version in MCSI

    Dear Experts, I have use OLIX to delete version in MCSI, but the info structure still contain data (SE16) with blank version. please tell me how to delete the blank version. Thank You

  • HT4759 500GB online backup how to put it on

    I purchased the 500GB online backup in store but don't know how to put it on can someone help me please.

  • Delete similar request option in the infopackage

    Hello BW Experts, I have to load Period 01 many times a month. each it loads to  the cube it has to delete the similar request from the cube. Where can i do this setting in the infopackage. Please advice. Thanks, BWer