Simple Insert Function Syntax - Mailing list pgsql-novice

From
Subject Simple Insert Function Syntax
Date
Msg-id F274xj0kdBDH0IsPH8f0000d9eb@hotmail.com
Whole thread Raw
Responses Importing Data into Postgresql from MS Access
List 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.


pgsql-novice by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: [ADMIN] Foreign key
Next
From: Tim Mueller-Seydlitz
Date:
Subject: Date_Part with time fields