Home » Developer & Programmer » Forms » why there not block with timestamp ?
why there not block with timestamp ? [message #278781] Mon, 05 November 2007 11:56 Go to next message
Hany Freedom
Messages: 256
Registered: May 2007
Location: Egypt
Senior Member

when I make table like this :-

create table test(id number,tim timestamp);

and go to forms to insert the table into the block , give me this photo :-

http://imgbolt.com/public/38815/err%20frm.PNG

why this data type ( timestamp ) not supported in forms ?
is there any solve for this problem ?

Re: why there not block with timestamp ? [message #278782 is a reply to message #278781] Mon, 05 November 2007 12:00 Go to previous messageGo to next message
vamsi kasina
Messages: 2112
Registered: October 2003
Location: Cincinnati, OH
Senior Member
What is the version?

By
Vamsi
Re: why there not block with timestamp ? [message #278794 is a reply to message #278782] Mon, 05 November 2007 12:26 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
It is a known bug (a feature?).

Workaround is:
  • Create a table WITHOUT the timestamp column. Create a form using the Data Block Wizard. Then alter the table and add the timestamp column into the table; manually add the item into the data block.
  • Create a table with all columns, including the timestamp one. Create the whole data block manually.
I believe that the first approach is less painful.
icon4.gif  Re: why there not block with timestamp ? [message #278809 is a reply to message #278794] Mon, 05 November 2007 14:37 Go to previous messageGo to next message
Hany Freedom
Messages: 256
Registered: May 2007
Location: Egypt
Senior Member

I know how to make data block and insert items inside manually , but I don't know how to make the items work as the items that made in data block wizard , I mean how can I convert the item from no database item to database item ..... please give me example about it ..... and thanks.
Re: why there not block with timestamp ? [message #278818 is a reply to message #278809] Mon, 05 November 2007 15:28 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
A timestamp data column may not be used in data block creation process using the Data Block Wizard. You've seen that already (FRM-10095 is the proof).

Quote:

how can I convert the item from no database item to database item
Modify item's 'Database Item' property to 'YES'.
Re: why there not block with timestamp ? [message #278824 is a reply to message #278818] Mon, 05 November 2007 16:02 Go to previous messageGo to next message
Hany Freedom
Messages: 256
Registered: May 2007
Location: Egypt
Senior Member

I made data block manually and rename it SS , that's because I made this code in database :-

SQL> create table ss(ss timestamp );
Table created.

SQL> insert into ss values(systimestamp);
1 row created.


then when I press F4 in Keyboard and go to "Query Data Source Columns" property .... I found this :-

http://imgbolt.com/public/38941/eee.PNG

SO ..... what can I do to make column with timestamp data type ?
Re: why there not block with timestamp ? [message #278826 is a reply to message #278824] Mon, 05 November 2007 16:16 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
DATETIME.
icon4.gif  Re: why there not block with timestamp ? [message #278830 is a reply to message #278826] Mon, 05 November 2007 17:07 Go to previous messageGo to next message
Hany Freedom
Messages: 256
Registered: May 2007
Location: Egypt
Senior Member

The problem didn't solved ..... check the TIMESTAMP.zip file attached here.
  • Attachment: TIMESTAMP.zip
    (Size: 48.88KB, Downloaded 1101 times)
Re: why there not block with timestamp ? [message #278937 is a reply to message #278830] Tue, 06 November 2007 06:47 Go to previous messageGo to next message
Hany Freedom
Messages: 256
Registered: May 2007
Location: Egypt
Senior Member

I'M STILL WAITING FOR THE ANSWER
Re: why there not block with timestamp ? [message #278942 is a reply to message #278937] Tue, 06 November 2007 07:04 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Read Maaher's answer (post #3) and my P.S. (post #4) in this topic.
Re: why there not block with timestamp ? [message #278959 is a reply to message #278942] Tue, 06 November 2007 07:54 Go to previous messageGo to next message
Hany Freedom
Messages: 256
Registered: May 2007
Location: Egypt
Senior Member

Littlefoot wrote on Tue, 06 November 2007 15:04

Read Maaher's answer (post #3) and my P.S. (post #4) in this topic.


I want the answer only ...... not anything else
Re: why there not block with timestamp ? [message #278961 is a reply to message #278959] Tue, 06 November 2007 08:05 Go to previous messageGo to next message
vamsi kasina
Messages: 2112
Registered: October 2003
Location: Cincinnati, OH
Senior Member
Quote:

I want the answer only ...... not anything else
Then just wait for it. I don't know how long.

By
Vamsi
Re: why there not block with timestamp ? [message #279045 is a reply to message #278961] Tue, 06 November 2007 13:14 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Here's a workaround, as form is not capable of displaying a timestamp value. There are documents on the Internet that discuss timestamp : datetime relation in Oracle Forms so, if you are interested in the issue - search for them and read more about it.

Create a database function which will return timestamp converted to a character, properly formatted:
CREATE OR REPLACE FUNCTION Fun_Ts (par_ts IN TIMESTAMP)
  RETURN CHAR
IS
  l_ts VARCHAR2(30);
BEGIN
  l_ts := TO_CHAR(par_ts, 'dd.mm.yyyy hh24:mi:ss:ff6');
  RETURN (l_ts);
END;
/

In a form, create additional display item of a character datatype. Write a block-level POST-QUERY trigger which will not pass a form item's value to the function, but reference this value in a table through its ROWID:
SELECT fun_ts(ss)
INTO :ts
FROM ss
WHERE rowid = :rowid;

The result is as follows:

/forum/fa/3353/0/

icon14.gif  Re: why there not block with timestamp ? [message #279065 is a reply to message #279045] Tue, 06 November 2007 16:04 Go to previous messageGo to next message
Hany Freedom
Messages: 256
Registered: May 2007
Location: Egypt
Senior Member

thanks for your work .... but I made what you said , I made the function in the database successfully ... but when I made the post-query trigger didn't compile with me correctly ...... it give me this error :-

http://www.imagehosting.com/out.php/i1341253_dd.PNG

so please , can you attach your fmb file that you made , so I can understand what you done exactly ....... and thanks.
  • Attachment: TIMESTAMP.fmb
    (Size: 40.00KB, Downloaded 1037 times)
Re: why there not block with timestamp ? [message #279112 is a reply to message #279065] Wed, 07 November 2007 00:34 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
I can't remember whether you ever mentioned your working environment; which OS, database and Developer Suite version do you use? As you've seen, it works correctly on Forms (32 Bit) 9.0.4.0.19, Oracle database 10.2.0.10 and MS Windows XP SP2.

As of the error you got - what happens if you redefine the function as
FUNCTION Fun_Ts (par_ts IN TIMESTAMP DEFAULT NULL)
and/or change function call to
SELECT fun_ts(nvl(ss, systimestamp))
icon4.gif  Still not working [message #279194 is a reply to message #279112] Wed, 07 November 2007 05:11 Go to previous messageGo to next message
Hany Freedom
Messages: 256
Registered: May 2007
Location: Egypt
Senior Member

that my forms builder version :-
http://www.imagehosting.com/out.php/i1343321_ss.PNG
and I use windows XP SP2
and the problem didn't solve yet :-
http://www.imagehosting.com/out.php/i1343326_rrr.PNG
although I did your function successfully in the database :-
SQL> CREATE OR REPLACE FUNCTION Fun_Ts(par_ts IN TIMESTAMP default null)
  2    RETURN CHAR
  3  IS
  4    l_ts VARCHAR2(30);
  5  BEGIN
  6    l_ts := TO_CHAR(par_ts, 'dd.mm.yyyy hh24:mi:ss:ff6');
  7    RETURN (l_ts);
  8  END;
  9  /
Function created.

so could you please give me your fmb file that you made successfully to timestamp datatype Nod
  • Attachment: TIMESTAMP.fmb
    (Size: 40.00KB, Downloaded 1002 times)
Re: why there not block with timestamp ? [message #279241 is a reply to message #278959] Wed, 07 November 2007 08:08 Go to previous messageGo to next message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
Hany Freedom wrote on Tue, 06 November 2007 14:54

I want the answer only ...... not anything else
And there you lost me. You are not in a position to make any demand. This is the thanks people get when take take time to answer to you? Now you'll have to wait.

MHE
icon13.gif  OKay Tiger [message #279249 is a reply to message #279241] Wed, 07 November 2007 08:29 Go to previous messageGo to next message
Hany Freedom
Messages: 256
Registered: May 2007
Location: Egypt
Senior Member

Maaher wrote on Wed, 07 November 2007 16:08

And there you lost me. You are not in a position to make any demand. This is the thanks people get when take take time to answer to you? Now you'll have to wait.

MHE


No problem in waiting , but I hope to get the right answer in the End ..... Wink Very Happy

[Updated on: Wed, 07 November 2007 08:31]

Report message to a moderator

Re: OKay Tiger [message #279318 is a reply to message #279249] Wed, 07 November 2007 15:01 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Perhaps the point is in an old Forms Builder version you use; it is Developer Suite 6i I guess, so - maybe its *old* PL/SQL version (8.0.6) (triggers are PL/SQL) can not comprehend such things.

Try to download a more recent Developer Suite and run the form there; I did, and it works. Unfortunately, I don't have 6i to test it. Maybe there is a workaround, but I don't know it.
icon14.gif  Re: OKay Tiger [message #279322 is a reply to message #279318] Wed, 07 November 2007 15:41 Go to previous messageGo to next message
Hany Freedom
Messages: 256
Registered: May 2007
Location: Egypt
Senior Member

thank you Littlefoot ..... I will see about that
Re: OKay Tiger [message #279387 is a reply to message #279322] Thu, 08 November 2007 01:08 Go to previous message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
Forms 6i does not support the TIMESTAMP data type. My Forms 10g does - partially that is. I created a small form with
- a control block
- an exit button (exit_form(NO_VALIDATE) in the when-button-pressed)
- a text item (data type CHAR, length 60)
- a when-new-form-instance trigger:
Begin
	:Control.Time_Stamp := TO_CHAR(SYSTIMESTAMP,'DD-MON-YYYY HH24:MI:SSxFF TZH:TZM');
End;

When I run it, it looks like this:
/forum/fa/3370/0/

I've read on several forums that timestamps can still cause problems, but I haven't verified that. I suggest you do your own casting like I did.

A final note: I never used timestamp in Forms. It is mostly used on the database side.

MHE

PS: could you stop using these fancy colors and fonts? It's a bit messy.
  • Attachment: timestamp.jpg
    (Size: 11.62KB, Downloaded 1595 times)

[Updated on: Thu, 08 November 2007 01:09]

Report message to a moderator

Previous Topic: HOW to invoke FILE from FORM
Next Topic: The code work in database not in forms ... why?
Goto Forum:
  


Current Time: Sun Feb 09 20:30:13 CST 2025