Home » Developer & Programmer » Forms » database name in foms 6i
database name in foms 6i [message #258106] Fri, 10 August 2007 04:44 Go to next message
rishi1979
Messages: 36
Registered: November 2006
Member
How can i get the database name through oracle form 6i .
SYS_CONTEXT is not supported in forms 6i.if i write it in forms then it says sys_context must be declared.but it is working in oracle sql.plz help

thanks in advance
Re: database name in foms 6i [message #258141 is a reply to message #258106] Fri, 10 August 2007 06:55 Go to previous messageGo to next message
Littlefoot
Messages: 20901
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Write a stored function (i.e. the one which resides in the database) which would return information you need.
CREATE OR REPLACE FUNCTION my_context RETURN CHAR IS
BEGIN
  RETURN sys_context('USERENV', 'DB_NAME');
END;


Call this function from the form as
-- WHEN-NEW-FORM-INSTANCE trigger

:control.db_name := my_context;
Re: database name in foms 6i [message #258172 is a reply to message #258141] Fri, 10 August 2007 08:12 Go to previous messageGo to next message
rishi1979
Messages: 36
Registered: November 2006
Member
Thanks for this but i want to know if there is any built which i can use in forms
Re: database name in foms 6i [message #258239 is a reply to message #258172] Fri, 10 August 2007 11:55 Go to previous messageGo to next message
Littlefoot
Messages: 20901
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Not in Forms 6i (as far as I can tell); SYS_CONTEXT was introduced in Oracle 8i, while Forms 6i are based on 8.0.6.

So, you can either use suggested database function or upgrade Forms to higher version (but be warned! 6i is the last client-server version!).
Re: database name in foms 6i [message #258312 is a reply to message #258106] Sat, 11 August 2007 00:01 Go to previous messageGo to next message
azamkhan
Messages: 548
Registered: August 2005
Senior Member
I can remember the name of the property right now but I think you can get the name of the database. I will find it out for you and let you know later
Re: database name in foms 6i [message #258504 is a reply to message #258106] Sun, 12 August 2007 19:59 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
How about 'get_application_property(connect_string)'?

Or "SELECT name FROM v$database;"

David

[Updated on: Sun, 12 August 2007 20:06]

Report message to a moderator

Re: database name in foms 6i [message #259355 is a reply to message #258504] Wed, 15 August 2007 03:39 Go to previous messageGo to next message
rishi1979
Messages: 36
Registered: November 2006
Member
Thank u all for ur help the problem is solved
Re: database name in foms 6i [message #259453 is a reply to message #259355] Wed, 15 August 2007 11:50 Go to previous message
Littlefoot
Messages: 20901
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Could you post the solution, please?
Previous Topic: frm-40735:post_query triger rasied unhandled exception ora-06502
Next Topic: What This Forms6i Built-in Procedure Do
Goto Forum:
  


Current Time: Fri Dec 09 04:07:58 CST 2016

Total time taken to generate the page: 0.07146 seconds