Solved

HOW TO CALL 'Date_LOV.Get_Date'

Posted on 2004-05-02
12
3,623 Views
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
CALENDAR.PLL.
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
IDENTIFIER 'DATE_LOV.GET_DATE' MUST BE DECLARED

Also I get an error In the procedure body DATE_CHOOSEN
ERROR 201
IDENTIFIER 'DATE_LOV.CURRENT_LOV_DATE' MUST BE DECLARED

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

PLEASE HELP...
0
Comment
Question by:sadmelody
  • 6
  • 2
  • 2
  • +1
12 Comments
 
LVL 8

Expert Comment

by:baonguyen1
ID: 10972459
This note form Metalinkl may help you:

PURPOSE
-------
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:
    ORACLE_HOME/TOOLS/DEVDEMXX/Forms
 
 
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
   in the ORACLE_HOME/TOOLS/DEVDEMXX/Forms FOLDER)
3. You will see 'STANDARDS' appear under 'Object Libraries' in the Object  
   Navigator
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  
   FOLDER)
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:
 GO_BLOCK('EMP');
 
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:
   **Date_Control_Block
      -This block contains the buttons that control which month and year is displayed.
   **Date_Button_Block
      -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:
 
Date_Normal_VA
--------------
This visual attribute contains the attributes for a date button that is
displayed normally.
 
Date_Selected_VA
-----------------
This visual attribute contains the attributes for a date button that is
displayed as selected.
 
Date_Weekend_VA
---------------
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,
window_x_pos,window_y_pos,window_title,ok_label,
cancel_label,highlight,autoconfirm,autoskip );
 
Example:
--------
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
component.
 
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.
 
 
PROCEDURE Date_LOV.Get_Date(
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  
                                           appears
 
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  
                                           color
 
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.    
 
 
 
IMPORTANT PROCEDURE(S)IN THE CALENDAR.PLL
---------------------------------------------
 
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)
   is
date_window  window;
   begin
      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_item_property('date_control_block.ok_button',label,v_ok);
 
      -- set Cancel button label
      set_item_property('date_control_block.cancel_button',label,v_cancel);
 
      -- 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;
      set_day_labels;
      display_cal(display_date);
      go_block('date_control_block');
   end get_date;
0
 
LVL 8

Expert Comment

by:baonguyen1
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 http://technet.oracle.com/sample_code/products/forms/content.html 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

0
 
LVL 14

Expert Comment

by:leoahmad
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

go_item('hiredate');
do_key('list_values');

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

LeoAhmad
0
 

Author Comment

by:sadmelody
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 veova@yahoo.com

Thanks again

0
 
LVL 14

Expert Comment

by:leoahmad
ID: 10994038
catch the file :-)

LeoAhmad
0
 
LVL 14

Accepted Solution

by:
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

go_item('hiredate');
do_key('list_values');

****
0
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

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

Expert Comment

by:leoahmad
ID: 11019498
Enjoy SadMelody

Thanks
0
 

Expert Comment

by:Ricotti
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.

Thanks.

Ricotti
0
 
LVL 14

Expert Comment

by:leoahmad
ID: 11856871
Ricotti,

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

Expert Comment

by:Ricotti
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!

Ricotti
0
 
LVL 14

Expert Comment

by:leoahmad
ID: 11876824
My Pleasure!
0

Featured Post

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.

Join & Write a Comment

Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.

707 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now