HOW TO CALL 'Date_LOV.Get_Date'

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 !

Who is Participating?
Muhammad Ahmad ImranConnect With a Mentor Database DeveloperCommented:
>>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


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;
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

The new generation of project management tools

With’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Muhammad Ahmad ImranDatabase DeveloperCommented:
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.

sadmelodyAuthor Commented:
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

Muhammad Ahmad ImranDatabase DeveloperCommented:
catch the file :-)

sadmelodyAuthor Commented:
That's exactly what's missing .. you're reading my mind !!
thank you so much
you are a real expert !!
Muhammad Ahmad ImranDatabase DeveloperCommented:
Enjoy SadMelody

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.


Muhammad Ahmad ImranDatabase DeveloperCommented:

Did you have the procedure and body 'DATE_LOV' in the forms. It seems that you are trying without them.
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!

Muhammad Ahmad ImranDatabase DeveloperCommented:
My Pleasure!
All Courses

From novice to tech pro — start learning today.