Re: Create view is not accepting the parameter in postgres functions

From: Alban Hertroys <haramrae(at)gmail(dot)com>
To: "Divyaprakash Y" <divyaprakash(dot)y(at)celstream(dot)com>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Create view is not accepting the parameter in postgres functions
Date: 2012-06-13 07:06:06
Message-ID: 158613BD-80F0-4116-A71A-C03EEC00279A@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 13 Jun 2012, at 7:31, Divyaprakash Y wrote:

> Hi,
>
> Is the following postgres function correct?
>
> CREATE OR REPLACE FUNCTION "MyFun"("IdArgs" INTEGER)

Named parameters --------------------^^^

> CREATE VIEW "A" AS SELECT * FROM "B" WHERE "Id" = $1;

Positional parameters ---------------------------------------------^^

You can't mix those. I don't think SQL functions support named parameters, so using positional parameters throughout would be the solution.

Alban Hertroys

--
If you can't see the forest for the trees,
cut the trees and you'll find there is no forest.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Craig Ringer 2012-06-13 07:09:18 Re: Create view is not accepting the parameter in postgres functions
Previous Message yatler sahri 2012-06-13 06:23:25 Getting this error