From: bs794@cleveland.Freenet.Edu (Diana Tracy)
Newsgroups: comp.databases.oracle
Subject: Re: Sqlform 3.0 -- inputing new data problem
Date: 2 Feb 1994 18:11:07 GMT
Organization: Case Western Reserve University, Cleveland, OH (USA)
Lines: 48
Message-ID: <2ioqbr$3rc@usenet.INS.CWRU.Edu>
References: <2ijttc$416@bsd.meddean.luc.edu>
Reply-To: bs794@cleveland.Freenet.Edu (Diana Tracy)
NNTP-Posting-Host: piglet.ins.cwru.edu



In a previous article, yshah@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@cleveland.Freenet.Edu		-- and Really Wild Things

