Hi, I created a simple application in Oracle APEX, and on the first page (blank page), I put a textbox. Now, I want to be able to insert the input data from the textbox into the tables, e.g. insert new first name, last name etc... Can someone tell me if there's a simple way to do this, or I must create some triggers or functions ?

Member Avatar for manuhar

ur saying that u have already created a blank page with a text box to enter data which is to be stored ?
if thats the case its always suggested to use a row level before/after trigger to accept data instead of functions.
yes ofcourse we can achive with functions too but its always beter to use triggers for these kind of...............

Member Avatar for manuhar

if u want the trigger code what actually it goes with then reply me ill try my way

I found it better to use a "form" page, which is automatically bound to one table, so I will be able to insert data into that particular table. But, I have a problem here too :( Since my table (the one I'm inserting in) already contains data, and the primary keys (numbers) are not - auto - increment (i have been entering these values manually 'till now in the database), now when I try to enter data it gives me an error. So, I wrote a sequence that increments the values by one, and I wrote a trigger too, that uses that sequence. But, it only works when used on an empty table. When I try to use it with the table which contains data, it gives me an error again... So I do not know is there any other way, than deleting the data in the table. Regards

Member Avatar for manuhar

ok now u r very much clear so the problem is to update an already data containing table
ill check it out and reply soon as i come up with it

I created a sequence STARTING WITH the value that's by one greater than the maximum value in my primary key column, so there wouldn't be any errors (no overlapping). So, that actually solves my problem, so thank you for the assistance. Regards.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.