YNT: Re: Using bind variable within BEGIN END

From: gulsumramazanoglu <gulsumramazanoglu(at)gmail(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, anand086 <anand086(at)gmail(dot)com>
Cc: "pgsql-sql(at)postgresql(dot)org" <pgsql-sql(at)postgresql(dot)org>
Subject: YNT: Re: Using bind variable within BEGIN END
Date: 2017-06-02 18:35:42
Message-ID: 466nunoq41l42iinq53w766p.1496428542771@email.android.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql



David hi, if PostgreSQL doesnt have stored procedures and function can only be used by a SQL command, so we cannot make a call to an SQL script (of any kind, name it procedure or something) directly from a HLL program.. do i understand correctly?

Samsung cihazımdan gönderildi

-------- Orjinal mesaj --------
Kimden: "David G. Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Tarih: 2 06 2017 9:21 PM (GMT+02:00)
Alıcı: anand086 <anand086(at)gmail(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Konu: Re: [SQL] Using bind variable within BEGIN END

On Friday, June 2, 2017, anand086 <anand086(at)gmail(dot)com> wrote:
Another example where we are getting the same error is from the call of the

below code --

ctx.update(""

                                                                + "begin \n"

                                                                + "

access.register_type( \n"

                                                                + "

p_entity_system                 => ?, \n"

                                                                + "

p_entity_type                      => ?, \n"

                                                                + "

p_attribute_name             => ?, \n"

                                                                + "

p_creator_id                        => ?, \n"

                                                                + "

p_description                       => ? \n"

                                                                + " );"

                                                                + "end;",

                                                                systemName,

                                                                entityType,

attributeName,

                                                                creatorID,

attributeDescription);

access.register_type is a function

PostgreSQL doesn't alllow named arguments when calling functions and function calls must be part of a SQL statement: select func(?,?,?,?.?);  this applied even to functions that do not return results.  IOW, PostgreSQL doesn't have stored procedures.
David J.

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message gulsumramazanoglu 2017-06-02 18:38:14 YNT: Re: Using bind variable within BEGIN END
Previous Message David G. Johnston 2017-06-02 18:27:12 Re: Using bind variable within BEGIN END