Re: Sqlform 3.0 -- inputing new data problem

From: Diana Tracy <bs794_at_cleveland.Freenet.Edu>
Date: 2 Feb 1994 18:11:07 GMT
Message-ID: <2ioqbr$3rc_at_usenet.INS.CWRU.Edu>


In a previous article, yshah_at_bsd.meddean.luc.edu (Go Ahead Reverse My day!) says:

>Me and some other people are working on a little project; a database to
>hold music info, i.e. group name, label, album title...etc
>
>We created the tables and everything, but now we have a problem. We made
>a table called "groop" (group is sql statement), and have two fields:
>
>groop_nm char(80)
>primary key(groop_nm);
>
>When data is entered in the first question is for group (or artist) name.
>If a name has already been entered then forms won't let enter new info for
>that group.
>(1) Should we make it by album first, then artist?
>(2) Is there a way that forms won't check for that stuff?
>(3) Can I do this:
>
> groop_id num(8),
> groop_nm char(80),
> primary key(groop_id);
>
> How do I generate the groop_id?
>(4) Any other options?
>
>Thanks.
>Yatrik.
>

First of all, if you want to put in new information for an existing group in Forms, you need to Enter a Query. If you want to be able to update the group name, you probably should have a groop_id that is unique. To generate it, use a sequence:

	create sequence groop_id_seq
	increment by 1
	start with 1
	maxvalue 99999999

When you insert into a table, use an insert statement referencing the sequence:

	insert into groop
	values(groop_id_seq.nextval, :new_group_name);

Sorry if you already know this stuff, but you sounded like a beginner.

-- 
Diana Tracy, System Designer		-- Excitement, Adventure
bs794_at_cleveland.Freenet.Edu		-- and Really Wild Things
Received on Wed Feb 02 1994 - 19:11:07 CET

Original text of this message