SunQuest
           Oracle Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesOracle Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today!
  #1  
Old May 22nd, 2004, 06:13 PM
Smakit Smakit is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 19 Smakit User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Forms Builder Blues...

Hey there.

I got a problem with Form Builder. I am having a heck of a time getting it to do what I want, so I was looking for some tutorials or help from you all.

Here are some things I would like to do:

1) Have a list of fields (text boxes) where the user enters in the information, then clicks Submit (button) to insert the new values into an already existing database.

2) Because it is unlikely the user will know some things (vendor ID, type ID, that sort of thing), I would like a way to populate a poplist (drop down box) with the names of the vendors, but it should send back the vendor id . The problem I am really stuck on is how to populate that from a database. Possible?

3) Have another form entirely seperate where you enter in information (say, the vendor name) and it shows information about them.

Thanks in advance for any help you might offer!

Reply With Quote
  #2  
Old May 23rd, 2004, 09:39 AM
Smakit Smakit is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 19 Smakit User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thumbs down Hmmm

Hmmm.... still can't get the stupid form to insert values into the DB. I did get a LOV so users can pick stuff like vendors, then it inserts the ID... but the PL\SQL statement-driven button doesnt insert at all, tho it looks fine by my accounts..

Code:
INSERT INTO items
VALUES (:ITEMS.ITEM_YEAR,
        :ITEM_TYPES.I_TYPE_ID,
        :VENDORS.V_ID,
        :ITEMS.ITEM_COUNT,
        :ITEMS.ITEM_PRODUCER,
        :ITEMS.ITEM_TITLE,
        :ITEMS.ITEM_ARTIST,
        :ITEMS.ITEM_PRICE,
        :ITEMS.V_ITEM_ID,
        ITEMS_ITEM_ID_SEQ.nextval,
        :ITEMS.ITEM_GENRE);

commit;


Anyone help? I could even send the frm if you think it would help. Thanks

Reply With Quote
  #3  
Old May 23rd, 2004, 10:05 AM
Smakit Smakit is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 19 Smakit User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Exclamation ERror info...

Here is some more error informationg given by forms builder...

Code:
INSERT INTO ITEMS(I_TYPE_ID,V_ID,ITEM_ID,ITEM_TITLE,ITEM_ARTIST,ITEM_PRODUCER,ITEM_YEAR,ITEM_GENRE,ITEM_PRICE,IT  EM_COUNT,V_ITEM_ID) VALUES (:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11)  

ORA-01400: cannot insert NULL into ("SYSTEM"."ITEMS"."ITEM_ID")


WHat I don't understand is this... it says values(:1,:2,:3...etc.), but my PL\SQL statement above should grab from text fields, no? Well I didn't enter 1,2,3 ... in the fields. What gives? Also it says Items.Item_id cant have null inserted, but I use a sequence to use the next value. ??? HELP!

Reply With Quote
  #4  
Old May 25th, 2004, 10:27 AM
shafique shafique is offline
Senior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Canada
Posts: 305 shafique User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 45 m 20 sec
Reputation Power: 5
specify all mendotry(not null) columns in INSERT clause, your query would be looki like that:

INSERT INTO items(
ITEM_YEAR,
ITEM_TYPES,
VENDORS,
ITEM_COUNT,
ITEM_PRODUCER,
ITEM_TITLE
ITEM_ARTIST,
ITEM_PRICE)
VALUES (
:ITEMS.ITEM_YEAR,
:ITEM_TYPES.I_TYPE_ID,
:VENDORS.V_ID,
:ITEMS.ITEM_COUNT,
:ITEMS.ITEM_PRODUCER,
:ITEMS.ITEM_TITLE,
:ITEMS.ITEM_ARTIST,
:ITEMS.ITEM_PRICE)

The second solution, if these above columns are based on exsisting table, first fetch the sequence/formulated value into form column writing trigger behind those columns, write 'save_form' command behind 'save' or 'submit' button to save these value into database table.

You can also load the 'demo' tables and then view the some reports and forms demos provided by oracle, check this option in developer which is installed in your computer.

Reply With Quote
  #5  
Old June 16th, 2004, 11:43 AM
astrocanis astrocanis is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 14 astrocanis User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to astrocanis
Are you familiar with base-table vs. non-base-table blocks? If not, send me an email.

In order to do an insert, it must occur during a commit-level transaction (assuming the database is an Oracle one). If not, you have to do lots more work.

Using the lov you can specify the query and then specify which form columns the lov populates.

The :1, :2, :3, etc. are substitution variables that the form creates...the columns, even if they are associated with a table column are actually "pictures" that contain values that must be parsed by forms prior to inserting records. The insert statement is created based on these sequential variables.

If you have a base-table block, you pretty much just have to deal with validations. If you don't have a base-table block, committing inserts becomes more problematic.

Are you receiving any error messages?

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesOracle Development > Forms Builder Blues...


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway