Re: Create view is not accepting the parameter in postgres functions - Mailing list pgsql-general

From Alban Hertroys
Subject Re: Create view is not accepting the parameter in postgres functions
Date
Msg-id 158613BD-80F0-4116-A71A-C03EEC00279A@gmail.com
Whole thread Raw
In response to Create view is not accepting the parameter in postgres functions  ("Divyaprakash Y" <divyaprakash.y@celstream.com>)
Responses Re: Create view is not accepting the parameter in postgres functions  (Craig Ringer <ringerc@ringerc.id.au>)
Re: Create view is not accepting the parameter in postgres functions  (Chris Travers <chris.travers@gmail.com>)
List 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
wouldbe 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.


pgsql-general by date:

Previous
From: yatler sahri
Date:
Subject: Getting this error
Next
From: Craig Ringer
Date:
Subject: Re: Create view is not accepting the parameter in postgres functions