Simple Insert Function Syntax

Поиск
Список
Период
Сортировка
От
Тема Simple Insert Function Syntax
Дата
Msg-id F274xj0kdBDH0IsPH8f0000d9eb@hotmail.com
обсуждение исходный текст
Ответы Importing Data into Postgresql from MS Access  ("Kevin Leclaire" <kevin@virtualnav.com>)
Список 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 по дате отправления:

Предыдущее
От: Stephan Szabo
Дата:
Сообщение: Re: [ADMIN] Foreign key
Следующее
От: Tim Mueller-Seydlitz
Дата:
Сообщение: Date_Part with time fields