pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: jacquesdereims@gmail.com
To: pgsql-docs@lists.postgresql.org
Subject: Re: thoroughly broken examples on the Dynamic SQL page
Date: Fri, 28 Feb 2020 10:24:23 +0100
Message-ID: <1fab9e57c5d715a1d344b03d137ef7c6d7ec7513.camel@cybertec.at> (raw)
In-Reply-To: <158281875655.30439.3164486065108716610@wrigleys.postgresql.org>
References: <158281875655.30439.3164486065108716610@wrigleys.postgresql.org>

On Thu, 2020-02-27 at 15:52 +0000, PG Doc comments form wrote:
> Has anyone tried the examples on the
> https://www.postgresql.org/docs/11/ecpg-dynamic.html Dynamic SQL page? The
> very first line in each example immediately throws a syntax error: "syntax
> error at or near "exec"". Could we get this updated or a bug fixed? I'm
> migrating from SQL Server and really need to know how to migrate dynamic SQL
> in existing code.

You are confused.
This page is about embedded SQL in C.

If you want to write a stored procedure or function that uses dynamic SQL,
read https://www.postgresql.org/docs/current/plpgsql-statements.html#PLPGSQL-STATEMENTS-EXECUTING-DYN

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com






view thread (2+ messages)

Message-ID: <1fab9e57c5d715a1d344b03d137ef7c6d7ec7513.camel@cybertec.at>
Permalink:  ../1fab9e57c5d715a1d344b03d137ef7c6d7ec7513.camel@cybertec.at/
Also on:    postgresql.org/message-id/1fab9e57c5d715a1d344b03d137ef7c6d7ec7513.camel@cybertec.at

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-docs@postgresql.org
  Cc: laurenz.albe@cybertec.at, jacquesdereims@gmail.com, pgsql-docs@lists.postgresql.org
  Subject: Re: thoroughly broken examples on the Dynamic SQL page
  In-Reply-To: <1fab9e57c5d715a1d344b03d137ef7c6d7ec7513.camel@cybertec.at>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox