pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Question Regarding Procedural Function (store procedure)
2+ messages / 2 participants
[nested] [flat]

* Question Regarding Procedural Function (store procedure)
@ 2005-02-17 02:11  b t <qtboyzz@yahoo.com>
  0 siblings, 1 reply; 2+ messages in thread

From: b t @ 2005-02-17 02:11 UTC (permalink / raw)
  To: pgsql-interfaces

Hi, first of all thanks for taking the time to read my message. I'm new to Sql and is very confuse of how to write a procedural function. I want to write a function that check if the data is aready in the table then it should not add to the table instead of linking it to the table. This is what I mean, I have a movies table and a stars table and a stars_in_movies (this table keep track of the stars in what movies). So I'm suppose to write a store procedure that add the movie to the database, if there is a star in the new movies then is already exist in the stars table then it should link that star to the new movie.
thanks in advance
-brian

		
---------------------------------
Do you Yahoo!?
 Yahoo! Mail - Find what you need with new enhanced search. Learn more.

^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Question Regarding Procedural Function (store procedure)
@ 2005-02-17 17:03  Bruno Wolff III <bruno@wolff.to>
  parent: b t <qtboyzz@yahoo.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Bruno Wolff III @ 2005-02-17 17:03 UTC (permalink / raw)
  To: b t <qtboyzz@yahoo.com>; +Cc: pgsql-interfaces

On Wed, Feb 16, 2005 at 18:11:16 -0800,
  b t <qtboyzz@yahoo.com> wrote:
> Hi, first of all thanks for taking the time to read my message. I'm new to Sql and is very confuse of how to write a procedural function. I want to write a function that check if the data is aready in the table then it should not add to the table instead of linking it to the table. This is what I mean, I have a movies table and a stars table and a stars_in_movies (this table keep track of the stars in what movies). So I'm suppose to write a store procedure that add the movie to the database, if there is a star in the new movies then is already exist in the stars table then it should link that star to the new movie.

You probably want to do this on the application side. While the screen
actors guild does things to keep actors names unique, they aren't always
used constistantly and occasionally change names. So a database procedure
is not in a good position to know whether or not an entry is new.
An application could do a check and provide information back to the person
entering the data and ask if the person is new. And then create a new entry
or modify an existing entry as desired.



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2005-02-17 17:03 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-02-17 02:11 Question Regarding Procedural Function (store procedure) b t <qtboyzz@yahoo.com>
2005-02-17 17:03 ` Bruno Wolff III <bruno@wolff.to>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox