Re: [SQL] Using bind variable within BEGIN END - Mailing list pgsql-sql

From David G. Johnston
Subject Re: [SQL] Using bind variable within BEGIN END
Date
Msg-id CAKFQuwbFbv9FRJ_Ghb0f6ZhYtPaXzFaFzh3PWhigBtrBSc4_kA@mail.gmail.com
Whole thread Raw
In response to Re: [SQL] Using bind variable within BEGIN END  (anand086 <anand086@gmail.com>)
Responses Re: [SQL] Using bind variable within BEGIN END  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-sql
On Friday, June 2, 2017, anand086 <anand086@gmail.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.

pgsql-sql by date:

Previous
From: anand086
Date:
Subject: Re: [SQL] Using bind variable within BEGIN END
Next
From: "David G. Johnston"
Date:
Subject: Re: [SQL] Using bind variable within BEGIN END