Home » Developer & Programmer » Forms » Oracle Forms Newbie question :)
Oracle Forms Newbie question :) [message #412088] Tue, 07 July 2009 13:43 Go to next message
elshadai
Messages: 7
Registered: July 2009
Junior Member
Forgive me for this silly question but i am new with Oracle Forms and Oracle Database, but so far i've managed to handle it Laughing My question will sound so silly but i have not figures that part yet. I have succesfully connected Forms 10g with my database(Oracle database 10g Enterprise Edition) and all is working fine. I have completed the form part from my application and now I want to fill my forms with data from my database. I want to ask how can i crate tables and store data in the database so i can retrieve them to my Oracle Forms.
So far i have used SQL*Plus but i have not achieved anything.
I did the following:
1) I opened the SQL Editor
2) I created a sample table juset for expirimental purposes for beginning to see how it works e.g.(create table news ( n1 varchar(50) );
3) then i used the insert into news values ( 'news' );
all were succesfull but i've noticed that the data isn't stored permanantly in there and when i run the data Block wizard it succesfully connects the table news but the problem is that there are no data in it plus if i run a select * from news return no data.
I would like some guidance(because i am newbie with that stuff) in how can someane store data in database and retrieve them. Sorry for the big post. I would like it to explain as much as i could. If anyone can help I would really appreciate it! Embarassed
Re: Oracle Forms Newbie question :) [message #412095 is a reply to message #412088] Tue, 07 July 2009 15:23 Go to previous messageGo to next message
Littlefoot
Messages: 20891
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Try to COMMIT after INSERT.
Re: Oracle Forms Newbie question :) [message #412098 is a reply to message #412095] Tue, 07 July 2009 15:27 Go to previous messageGo to next message
elshadai
Messages: 7
Registered: July 2009
Junior Member
OK! The job is done! Thank you pal you helped me a lot! Smile
Re: Oracle Forms Newbie question :) [message #412104 is a reply to message #412098] Tue, 07 July 2009 16:04 Go to previous messageGo to next message
elshadai
Messages: 7
Registered: July 2009
Junior Member
Uhm the above worked but how do i retrieve the value from the DataBase, i mean what PL/SQL code do i use?
I 've tried in Forms Builder a select * from news but it returns nothing Sad
I used the Data Block wizard and i succesfully connected it to the database table. But still not working Sad
Re: Oracle Forms Newbie question :) [message #412112 is a reply to message #412104] Tue, 07 July 2009 16:52 Go to previous messageGo to next message
Littlefoot
Messages: 20891
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Just follow Data Block Wizard; if you do that, it will create a functional form. There's nothing you have to do in order to make it work - at least, its basic functionalities will be here and let you query data, insert new data and update existing data.

When you run the form, simply execute the query (find that button on the toolbar or press <Execute query> on your keyboard (it might be F8 key) - if you've inserted some values through SQL*Plus, executing a query will fetch it. No additional programming is necessary.
Re: Oracle Forms Newbie question :) [message #412114 is a reply to message #412112] Tue, 07 July 2009 16:56 Go to previous messageGo to next message
elshadai
Messages: 7
Registered: July 2009
Junior Member
I programmatically use Exequte_Query but it does not work Sad
It says that i must be connected to a database but the outrageous is that i am already connected because i select the table and the values i want. Thank you fro the reply again! Smile
Re: Oracle Forms Newbie question :) [message #412149 is a reply to message #412114] Wed, 08 July 2009 00:31 Go to previous messageGo to next message
Littlefoot
Messages: 20891
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Quote:
i am already connected because i select the table and the values i want
How? Where?

Quote:
It says that i must be connected to a database
Please, post exact Oracle error code (such as ORA-00942 or FRM-40501 or similar). It is much easier to figure out what is going on than reading your description.
Re: Oracle Forms Newbie question :) [message #412223 is a reply to message #412149] Wed, 08 July 2009 04:48 Go to previous messageGo to next message
elshadai
Messages: 7
Registered: July 2009
Junior Member
Well i get the error: FRM-40301. That means i am not connected to the database. That's really odd. From Data block wizard i can view all of my tables that i have crated with PL/SQL and i can see all of their fields, but when i try to fetch their values from a button with EXECUTE_QUERY i get the FRM-40301 error(i try to do it programmatically). Mad Again thanx for your big help.
Re: Oracle Forms Newbie question :) [message #412225 is a reply to message #412223] Wed, 08 July 2009 05:01 Go to previous messageGo to next message
elshadai
Messages: 7
Registered: July 2009
Junior Member
Oh well my bad! I forgot to mention that i first get the error FRM-40514 and then i get the error above. Well i think i've messed it up a bit Shocked
Re: Oracle Forms Newbie question :) [message #412229 is a reply to message #412225] Wed, 08 July 2009 05:36 Go to previous message
Littlefoot
Messages: 20891
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Quote:
i get the error: FRM-40301. That means i am not connected to the database

No, you are wrong.
Oracle
FRM-40301: Query caused no records to be retrieved. Re-enter.

Cause:  No records matched the query criteria. Still in Enter Query mode.

Action:  Either adjust the query criteria or press [Exit/Cancel] to leave Enter Query mode.

FRM-40514 means that you should connect to the database and retry the operation.

So: make sure you are connected to the database during form execution. Executing a query will return records if they exist in a table (and satisfy conditions you entered during querying phase).
Previous Topic: Horizontal Scroll Bar for More then 15 Column
Next Topic: read input from serial port
Goto Forum:
  


Current Time: Sat Dec 03 15:53:54 CST 2016

Total time taken to generate the page: 0.06320 seconds