ERT INTO Order (Customer_ID, Price) VALUES (_customer_id, _price);
END;
$body$;
> --- On Mon, 1/4/10, Alban Hertroys
> wrote:
>
>> From: Alban Hertroys
>> Subject: Re: [GENERAL] Insert Data Into Tables Linked by Foreign Key
>> To: "Yan Cheng Cheok"
>> C
Can you please provide me an example of a stored procedures to achieve that?
Thanks and Regards
Yan Cheng CHEOK
--- On Mon, 1/4/10, Alban Hertroys wrote:
> From: Alban Hertroys
> Subject: Re: [GENERAL] Insert Data Into Tables Linked by Foreign Key
> To: "Yan Cheng Cheok"
insert into foo(a) with recursive t(n) AS (SELECT 10 AS n UNION ALL
SELECT n-1 FROM t WHERE n > 0) select n from t;
works on 8.5
--
GJ
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
In response to Alban Hertroys :
> On 4 Jan 2010, at 13:15, A. Kretschmer wrote:
>
> > In response to Alban Hertroys :
> >> On 4 Jan 2010, at 9:53, Yan Cheng Cheok wrote:
> >>
> >>> For example, "John" place "1.34" priced order.
> >>>
> >>> (1) Get Customer_ID from Customer table, where name is "
On 4 Jan 2010, at 13:15, A. Kretschmer wrote:
> In response to Alban Hertroys :
>> On 4 Jan 2010, at 9:53, Yan Cheng Cheok wrote:
>>
>>> For example, "John" place "1.34" priced order.
>>>
>>> (1) Get Customer_ID from Customer table, where name is "John"
>>> (2) If there are no Customer_ID return
On Mon, Jan 04, 2010 at 04:53:16AM -0800, Yan Cheng Cheok wrote:
> From general point of view, having 3 SQL statement wrapped in a
> single stored procedure shall perform better due to reduced overhead
> to communicate with SQL server. Is that true? Or that is my false
> assumption?
I'd be tempted
ys wrote:
> From: Alban Hertroys
> Subject: Re: [GENERAL] Insert Data Into Tables Linked by Foreign Key
> To: "Yan Cheng Cheok"
> Cc: pgsql-general@postgresql.org
> Date: Monday, January 4, 2010, 7:57 PM
> On 4 Jan 2010, at 9:53, Yan Cheng
> Cheok wrote:
>
> &
In response to Alban Hertroys :
> On 4 Jan 2010, at 9:53, Yan Cheng Cheok wrote:
>
> > For example, "John" place "1.34" priced order.
> >
> > (1) Get Customer_ID from Customer table, where name is "John"
> > (2) If there are no Customer_ID returned (There is no John), insert "John"
> > (3) Get Cu
On 4 Jan 2010, at 9:53, Yan Cheng Cheok wrote:
> For example, "John" place "1.34" priced order.
>
> (1) Get Customer_ID from Customer table, where name is "John"
> (2) If there are no Customer_ID returned (There is no John), insert "John"
> (3) Get Customer_ID from Customer table, where name is "
Customer
==
Customer_ID | Name
Order
==
Order_ID | Customer_ID | Price
To insert an order, here is what I need to do usually,
For example, "John" place "1.34" priced order.
(1) Get Customer_ID from Customer table, where name is "John"
(2) If there are
10 matches
Mail list logo