|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
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
|
|||
|
|||
|
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! |
|
#2
|
|||
|
|||
|
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 |
|
#3
|
|||
|
|||
|
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! |
|
#4
|
|||
|
|||
|
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. |
|
#5
|
|||
|
|||
|
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? |
![]() |
| Viewing: Dev Shed Forums > Databases > Oracle Development > Forms Builder Blues... |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|