Home » Developer & Programmer » Forms » how to make tabular calander (form 6i , database 9i,windows xp)
how to make tabular calander [message #389316] Sat, 28 February 2009 06:30 Go to next message
hisham99
Messages: 106
Registered: October 2008
Location: united arab emirates
Senior Member
i need to create a tabular calander like this attachement
can any one help me how to make it
i need an example not an idea
form consist of header and details
when user comes to details
it will populate a calander starting from the same month of the currant date
ex. if the forms is entered on nov/2008
the details will show
month year
11 2008
12 2008
1 2009
2 2009
3 2009
4 2009
5 2009
6 2009
.
.

if any one have another idea please tell me
Re: how to make tabular calander [message #389317 is a reply to message #389316] Sat, 28 February 2009 06:38 Go to previous messageGo to next message
hisham99
Messages: 106
Registered: October 2008
Location: united arab emirates
Senior Member
sorry i forget to send the attachement
  • Attachment: cal.JPG
    (Size: 103.77KB, Downloaded 551 times)
Re: how to make tabular calander [message #389330 is a reply to message #389317] Sat, 28 February 2009 12:04 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
It seems that it doesn't matter what month you are dealing with in the detail block, as all of them have 31 days. Therefore, a table which is used as a source for the detail data block might look like
CREATE TABLE calendar
(month_year date,
 day_1 varchar2(1),
 day_2 varchar2(1),
 day_3 varchar2(1),
 ...
 day_31 varchar2(1)
);

Once you enter starting month and year, you'll want to fill in next months/years. How far in the future would that go? The easiest way is probably using Oracle ADD_MONTHS function as it would do the job for you. Here's an example of how to create next six months (from September 2008):
SQL> select to_char(add_months(to_date('&starting_month', 'mm.yyyy'), level), 'mm.yyyy') result
  2  from dual
  3  connect by level <= 6;
Enter value for starting_month: 09.2008

RESULT
-------
10.2008
11.2008
12.2008
01.2009
02.2009
03.2009

6 rows selected.

SQL> 


Quote:
i need an example not an idea
What "example" are you talking about, exactly? What kind of "ideas" do you not want to hear?
Re: how to make tabular calander [message #389409 is a reply to message #389316] Sun, 01 March 2009 22:58 Go to previous messageGo to next message
hisham99
Messages: 106
Registered: October 2008
Location: united arab emirates
Senior Member
i make cope past for your syntax and it gives me one record only
Re: how to make tabular calander [message #389419 is a reply to message #389409] Mon, 02 March 2009 00:11 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Yes, it does ... I'd be surprised if it didn't. My apologies, I didn't pay attention to your database version. Previous code works fine on 10g onwards, while - for 9i - you'll have to use an inline view:
SQL> select to_char(add_months(to_date('&starting_month', 'mm.yyyy'), lvl), 'mm.yyyy') result
  2  from (select level lvl
  3        from dual
  4        connect by level <= 6
  5       );
Enter value for starting_month: 09.2008

RESULT
-------
10.2008
11.2008
12.2008
01.2009
02.2009
03.2009

6 rows selected.

SQL>
Re: how to make tabular calander [message #389445 is a reply to message #389316] Mon, 02 March 2009 02:15 Go to previous messageGo to next message
hisham99
Messages: 106
Registered: October 2008
Location: united arab emirates
Senior Member
ERROR:
ORA-01436 CONNECT BY loop in user data
Re: how to make tabular calander [message #389446 is a reply to message #389445] Mon, 02 March 2009 02:27 Go to previous message
babuknb
Messages: 1736
Registered: December 2005
Location: NJ
Senior Member

Quote:
ORA-01436: CONNECT BY loop in user data
Cause: The condition specified in a CONNECT BY clause caused a loop in the query, where the next record to be selected is a descendent of itself. When this happens, there can be no end to the query.
Action: Check the CONNECT BY clause and remove the circular reference.
Previous Topic: Calling Database Procedures/functions from Oracle Forms
Next Topic: connecting ms access to oracle form
Goto Forum:
  


Current Time: Fri Sep 20 12:24:07 CDT 2024