HOW TO CALL 'Date_LOV.Get_Date'

Posted on 2004-05-02
Last Modified: 2012-06-22
Hello Experts,

I was creating a calendar using the follwing steps:
1. Copy or make the Calendar Object
Group a subclass.
2. Attach the PL/SQL library
3. Create a Key-Listval trigger.
4. Call Date_LOV.Get_Date.

I'm a begginer and I need to know how to do the steps 3 & 4

when I write the following code in the trigger key_listval of the  item that i want to use date_lov window the following error rise:
 ERROR 201

Also I get an error In the procedure body DATE_CHOOSEN

So  I may be did somthing wrong or missed some step !

Question by:sadmelody
  • 6
  • 2
  • 2
  • +1

Expert Comment

ID: 10972459
This note form Metalinkl may help you:

This note gives instructions as to how to make use of the calendar.pll  
supplied with your forms.  If you have a date field to be entered in your form,
you can attach this pll and bring a calendar interface for the user to choose
a date from this interface.
Reusable componenets of developer: Using calendar.pll
This NOTE focuses on how to reuse demo forms supplied with developer cd with  
your forms application: (calendar demo is covered in this session).
What is a reusable component?
A reusable component is a generic object, (object group, block, PL/SQL
library, and so on), that you can reuse in all your applications. You can  
create your own reusable components (code and object) using the generic
programming characteristics.
This release also includes a number of reusable components that allow you to
easily and rapidly build applications that provide power and performance,
while conforming to GUI standards. These components are customizable.
Technical Note
Some of the demonstrations and reusable components require PL/SQL
features that are only supported in Oracle7 release 7.3 or later. If your
database does not support these features, certain packages will be created
but marked as "Invalid." If you try to run a demonstration that requires these
objects, you will see a warning that the packages are invalid.
The Calendar Class
The Developer CD has already a variety of demo forms that can reused  
with your application without much coding.
Usually the demos and associated files are located in:
A. How to Create a Calendar for as a Forms Application:
The Calendar Class
This component enables you to easily add a calendar or date list of values to
an application. The Calendar window will automatically display the
calendar according to the NLS settings that are currently in effect, adjusting
the start of the week (for example, Sunday in the United States, Monday in
Western Europe) and the month and day names accordingly.
Creating a Calendar
To create a calendar, follow the steps below:
1. Create a new MODULE in Forms Builder
2. Then open the stndrd20.olb file (this .olb file is located
3. You will see 'STANDARDS' appear under 'Object Libraries' in the Object  
4. Double click on the book-like icon next to 'STANDARDS'
5. Expand the object library window that appears
6. Click on the 'COMPONENTS' tab
7. Look for the 'CALENDAR' object library  
8. Drag-n-drop the 'CALENDAR' object into your new form
9. Notice all the new items are now in your form marked with a red arrow*
   *The red arrow means that the items are subclassed.
10. Attach the PL/SQL library CALENDAR.PLL
   (this .pll file is also located in the ORACLE_HOME/TOOLS/DEVDEMXX/Forms  
11. In Forms, Create a new block on a new canvas
12. Create a Key-Listval trigger on the date item for which you
   would like to use the Date LOV Window. Add the below code to display the
   calendar using the Date_LOV package.
date_lov.get_date(sysdate,         -- initial date
                  'emp.hiredate',  -- return block.item
                  240,             -- window x position
                  60,              -- window y position
                  'Start Date',    -- window title
                  'OK',            -- ok button label
                  'Cancel',        -- cancel button label
                  TRUE,            -- highlight weekend days
                  FALSE,           -- autoconfirm selection
                  FALSE);          -- autoskip after selection
13.  If you want the end user to be able to close the Date List of Values
window by clicking the window close button (the X) in the title bar, create a
form-level When-Window-Closed trigger with the following code:
When-Window-Closed trigger:
The calendar will appear whenever the end user invokes a list of values for
the date item. A single calendar can be reused on many different date items.
Simply create a Key-Listval trigger for each item.
B. Calendar Object Group Content
The component contains many different Form Builder objects. You can
customize those objects for your specific application.
The Blocks
The calendar object contains two blocks:
      -This block contains the buttons that control which month and year is displayed.
      -This block contains the buttons that represent each day of the month.
The Canvas
The calendar class contains a content canvas named Date_Lov_Canvas. This
canvas contains all the items from both blocks.
The Window
The calendar class contains a window named Date_Lov_Window. This
window is used to display the Date_Lov_Canvas.
The Visual Attributes
The calendar class contains three visual attributes:
This visual attribute contains the attributes for a date button that is
displayed normally.
This visual attribute contains the attributes for a date button that is
displayed as selected.
This visual attribute contains the attributes for a date button that is
displayed as a weekend day.
Built-in for Manipulating
the Calendar uses Date_LOV.Get_Date to display the Calendar Syntax
date_lov.get_date( display_date,return_item,
cancel_label,highlight,autoconfirm,autoskip );
date_lov.get_date(sysdate,'s_ord.date_ordered',240,60,'Order Date','OK','Cancel',TRUE,FALSE,FALSE);
C. Built-in for Manipulating the Calendar
To use the calendar class, you have to attach a PL/SQL library called
calendar.pll. This library contains a package called DATE_LOV. This
package contains routines that the developer uses to interact with the
Date_LOV.Get_Date Procedure
This procedure displays calendar with the month and year specified in the
Display_Date argument. The day of the month is displayed with bold
numbers. The date chosen by the end user is returned to the item specified
by the Return_Item argument.
display_date DATE, return_item VARCHAR2,
window_x_pos NUMBER := 0, window_y_pos NUMBER := 0,
window_title VARCHAR2 := 'Date List of Values',
ok_label VARCHAR2 := 'OK',
cancel_label VARCHAR2 := 'Cancel', highlight BOOLEAN := TRUE,
autoconfirm BOOLEAN := TRUE, autoskip BOOLEAN := FALSE );. . .
Argument Description
display_date                               The date to display when the  
                                           Date List of Values window first  
return_item                                The name of the block and item
                                           to return  the  chosen date to
window_x_pos                               Specifies the X coordinate of  
                                           the Date List of  
window_y_pos                               Specifies the Y coordinate of the
                                           Date List of Values window
window_title                               Title to display in the Date List  
                                           of Values window
ok_label                                   Label  for the OK button
cancel_label                               Label for the Cancel button
highlight                                  Specifies that weekend days
                                           will appear in a different  
autoconfirm                                Specifies that the date will  
                                           immediately be returned when  
                                           the enduser clicks a day.  
autoskip                                   Specifies that the input
                                           focus moves to the next
                                           item in  sequence.    
procedure get_date (display_date  in date,
                       return_item   in varchar2,
                       v_x_pos       in number   := 0,
                       v_y_pos       in number   := 0,
                       v_title       in varchar2 := 'Date List of Values',
                       v_ok          in varchar2 := 'OK',
                       v_cancel      in varchar2 := 'Cancel',
                       v_highlight   in boolean  := TRUE,
                       v_autoconfirm in boolean  := FALSE,
                       v_autoskip    in boolean  := FALSE)
date_window  window;
      date_window := find_window('date_lov_window');
      -- set date lov window position
      set_window_property(date_window, position, v_x_pos, v_y_pos);
      -- set date lov window title
      set_window_property(date_window, title, v_title);
      -- set OK button label
      -- set Cancel button label
      -- set date lov auto confirm flag
      lov_auto_confirm := v_autoconfirm;
      -- set date lov auto skip flag
      lov_auto_skip := v_autoskip;
      -- set weekend highlight flag
      weekend_highlight := v_highlight;
      date_lov_return_item := return_item;
   end get_date;

Expert Comment

ID: 10972486
and also this is useful:

First error:

"If you have Forms 6i the Demo files (containing the .olb within) aren't on the install CD. Apparently they come on a separate CD. You can download demo files from under Forms and Reports Feature/Benefit Demos. Once downloaded extract all files and run the setup/install exe which will put the files in the right places.

Stndrd20.olb will be in C:\Demo\win32\pmbf\6_0_8_8\demo\forms. The calendar.pll is there too"

Second error:

"identifier 'date_lov.current_lov_date' must be declared is caused because the calendar.pll library file has not been attached to your form.This can be done by first opening the calendar.pll file (it is now displayed under the PL/SQL Libraries Tag) and then attaching this library file to your form by double-clicking the Attached Libraries Tag in the form module.
You will get a dialog box asking whether to remove the path or not.Select this option as yes as it eliminates the hard coding of the path of the library file.
After this the form should run normally displaying the calendar whenever the button is pressed.

Hope this helps you

LVL 14

Expert Comment

ID: 10974614
This is the Key-ListVal Trigger: You must place it against the item to which you want to display the calendar.
In the object Navigator select the desire item(like Hiredate in emp table) and create a Key-Listval Trigger as ...

date_lov.get_date(sysdate,         -- initial date
                  'hiredate',  -- return block.item
                  240,             -- window x position
                  60,              -- window y position
                  'Start Date',    -- window title
                  'OK',            -- ok button label
                  'Cancel',        -- cancel button label
                  TRUE,            -- highlight weekend days
                  FALSE,           -- autoconfirm selection
                  FALSE);          -- autoskip after selection

Now create a button with when button pressed trigger as


If problem persists you can mail me at and I wil send you a sample file.

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.


Author Comment

ID: 10991577
Thank you so much LeoAhma
You're right I didn't attach the calendar.pll library

 it compiled successfuly BUT when I press the button nothing happend !!
no error massege or any thing .. I know I'm missing somthing : (

It'll be so nice of you if you send me that sample file my email is

Thanks again

LVL 14

Expert Comment

ID: 10994038
catch the file :-)

LVL 14

Accepted Solution

leoahmad earned 500 total points
ID: 10994045
>>no error massege or any thing .. I know I'm missing somthing

<< Are you do this

**** Now create a button with when button pressed trigger as



Author Comment

ID: 11015970
That's exactly what's missing .. you're reading my mind !!
thank you so much
you are a real expert !!
LVL 14

Expert Comment

ID: 11019498
Enjoy SadMelody


Expert Comment

ID: 11851154
I am trying to implement the calendar demo into my form but I receive the following errors for Program Units "DATE_CHOOSEN* (Procedure Body),

Error 201 at line 3, column 17
 identifier 'DATE_LOVE.CURRENT_LOV_DATE' must be declared
Error 0 at line 3, column 4
 Statement ignored
Error 201 at line 4, column 12
 identifier 'DATE_LOV.DATE_LOV_RETURN_ITEM' must be declared
Error 0 at line 4, column 4
 Statement ignored
Error 201 at line 5, column 7
 identifier 'DATE_LOV.LOV_AUTO_SKIP' must be declared
Error 0 at line 5, column 4
 Statement ignored

I have followed all help documentation and related posts about implementing the calendar form but I'm stuck on these compile errors. I know I have got to be missing something simple. Please point me towards the light.


LVL 14

Expert Comment

ID: 11856871

Did you have the procedure and body 'DATE_LOV' in the forms. It seems that you are trying without them.

Expert Comment

ID: 11876301
leoahmad ty for your help, I reallized I was attaching the library under the pl/sql libraries section instead of Attached Libraries under the form itself. And I needed to put the library files and form files in the same directory and modify my forms shortcut's start in directory to the location of the forms and library files. Ty again for your help!

LVL 14

Expert Comment

ID: 11876824
My Pleasure!

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction A previously published article on Experts Exchange ("Joins in Oracle", makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

832 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question