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 CAKFQuwaiTzfHmkxU06cxxV=g73xD4mSxSvqSfFh9y0DD41sC9g@mail.gmail.com
Whole thread Raw
In response to YNT: Re: [SQL] Using bind variable within BEGIN END  (gulsumramazanoglu <gulsumramazanoglu@gmail.com>)
List pgsql-sql
On Friday, June 2, 2017, gulsumramazanoglu <gulsumramazanoglu@gmail.com> wrote:
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?

I don't think so but I cannot figure out what your actual confusion is.  Write a function.  Execute a statement that invokes the function.  Remain connected until the function returns.  Learn whether it completed successfully or not and react accordingly. Move on in your HLL (higher level language?) code.

The term procedure in sql often implies autonomous which client invoked code cannot presently do (i.e., disconnect the connection after initiating the code but before it completes).

Your syntax issues are mostly about not having read the right sections of the docs pertaining to those syntactic issues.  Once you get past that you should be able to do most things that you can imagine.

David J.

pgsql-sql by date:

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