Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ADD, DELETE, UPDATE Buttons on forms

Status
Not open for further replies.

Heck

Programmer
Aug 16, 2000
2
US
Using Oracle 8.0 DB. Using ADO Connection Object with SQL statements directly to add, delete, and update. Got Delete working. Keep getting missing values on Inserting rows through the ADD control. Must I include all the columns on the row, or can I just include the ones I'm trying to update? I chose an unbound form for the flexibility it offers. Any good tips on what I'm trying to do?

Thank you very much.
 
Heck,

You seem to be on the right track actually.

You can insert rows into an Oracle table without specifying values for each column -- like this
[tt]
Insert Into TABLE_NAME
(FIELD1, FIELD2, FIELD3)
Values
('Mike', 39, 'Male');
[/tt]

Have a look at the definition of the table using sql/plus. You do this by typing:
[tt]
describe table_name
[/tt]

where table_name is the actual name of the table -- like this for the table 'emp'
[tt]
describe emp
[/tt]


You'll notice that some of the columns are marked "NOT NULL" and these are the columns which need values when you're inserting a row, like this:
[tt]
Name Null? Type
----------------------- --------- ----------------
FIELD1 NOT NULL VARCHAR2(20)
FIELD2 NOT NULL NUMBER(8)
FIELD3 NOT NULL VARCHAR2(20)
FIELD4 VARCHAR2(20)
FIELD5 VARCHAR2(20)
FIELD6 VARCHAR2(20)
[/tt]
 
Thanks. One of my columns (MCO_CODE) is set to NOT NULL but I'm not updating it; seems to be abandoned by users. So I try to set it to spaces and get: ORA-00984 Col not allowed here. I assume it's talking about that one. Do you know of a sample program I can download dealing with my scenario and with ADD, DELETE, and UPDATE controls?
Here's my SQL for the ADD:

sSQL =
 
if you put something into mco_code (not just spaces) does it work then?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top