Re: Basic Developer2000 question.

From: Mark Bullen <mbullen_at_voyager.net>
Date: Mon, 07 Sep 1998 22:28:12 -0400
Message-ID: <6t24ob$alj_at_news.voyager.net>


Brad Pollard wrote:

> I am VERY new to PL/SQL and oracle tools. And have a very basic question.
> (I have my fire retardant suit on preparing for the flames.)
>
> I am constructing my first form with Developer2000 and am missing some
> fundamental concepts with the WHEN_BUTTON_PRESSED smart trigger. (as well as
> some other fundamental concepts)
>
> Here's my test form.
> table - people
> columns - name, address, zip, phone.
>
> my form has 4 text item inputs for each of the above fields and an
> 'ADD NEW USER' button.
>
> If i try to create a smart trigger for the button with the PL/SQL editor as
> such:
>
> v_name people.name%TYPE;
> v_address people.address%TYPE;
> v_zip people.zip%TYPE;
> v_phone peopel.phone%TYPE;
> BEGIN
> insert into people (name, address, zip, phone)
> values (v_name, v_address, v_zip, v_phone);
> END;
>
> I get all kinds of compile errors. (Because i have no clue what i am
> doing).
>
> Any help would be awesome. Even if you can point me in the direction of a
> good book that is fine. RTFM is cool, as long as you tell me where i can
> find the FM.
>
> thanks in advance.
>
> bp
>
> bradp_at_slush.org

Greetings,

No need for the flame retardant suit, everyone was a beginner at one time. :-)

I think you may be making it harder than it needs to be. Unless you need to do something specific, there's no reason to do an explicit insert in your trigger. Try this instead:

  1. Make sure your block has its base table property set to the name of the table your fields belong to. In this case, it should be PEOPLE.
  2. Make sure your fields each have their base table item property set to true.
  3. In the WHEN-BUTTON-PRESSED trigger all you need is the following line:

do_key('commit_form');

Now pressing the "ADD NEW USER" button will cause the data that has been entered into the fields to be inserted and committed into the PEOPLE table. This is the beauty of Forms, if you're doing something fairly simple, then there's practically no code to write. Forms takes care of most of it.

If you're looking for a good PL/SQL book, I have O'Reilley & Associates' "Oracle PL/SQL Programming" by Steven Feuerstein. I bought it on the recommendation of a friend and she's very, very, good with PL/SQL. I'm not endorsing this book or anything and am not connected with these people in any way but I find it to be a good reference. It starts out with an intro to PL/SQL so it gets your feet wet before getting into the heavy stuff.

--
mbullen_at_voyager.net
Illegitami non carborundum
Received on Tue Sep 08 1998 - 04:28:12 CEST

Original text of this message