Simple Insert Function Syntax

From: "" <npdavis(at)hotmail(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Simple Insert Function Syntax
Date: 2000-10-06 18:46:48
Message-ID: F274xj0kdBDH0IsPH8f0000d9eb@hotmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hello,

Does anyone have an example of a simple insert function. I am new to
PostGreSQL and am having a little trouble with the basics. There is no
simple (to me) example in the book... Here is what I am trying to do:

CREATE FUNCTION sp_add_dealerinfo(Text, Text, Text, Int, Text, Text,
Text, Text, Text, Text, Float4,
Float4, Varchar(1024))
AS
'Insert Into (ID, Name, StoreName, Address, NumberOfLocations, ContactName,
Email, HomePhone, WorkPhone, BestTime, Products, TotalAnnualSales,
TotalCreditSales, Comments)

Values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13);'
Language 'sql';

If anyone can help, a simple one column insert function will do. I prefer
the encapsulation and speed that is provided by putting queries into db
functions instead of inline in my PHP or other language... so this is
important to me. I am still struggling with PGSQL syntax.

I come from an MSSQL/Oracle background... but am not willing to spend the
outrageous licensing for either of these software packages for my own
projects... it is just not worth it for the product that you get!

thx,
Neil P Davis
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at
http://profiles.msn.com.

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Greger Haga 2000-10-07 10:17:28 ignore
Previous Message Vic 2000-10-06 08:25:22 How I exec sheel script from Postrgres Function ???