Top "Dynamic-sql" questions

Dynamic SQL is a technique using SQL (Structured Query Language) whose main difference from traditional SQL is that Dynamic SQL allows to build SQL statements dynamically at runtime, which eases the automatic generation and execution of program statements.

Dynamic SQL (EXECUTE) as condition for IF statement

I want to execute a dynamic SQL statement, with its returned value being the conditional for an IF statement: IF …

postgresql dynamic-sql plpgsql
how to select columns as rows?

So, I've been searching around and I've found things similar to my problem, but I need more help to get …

sql sql-server tsql dynamic-sql
Dynamically generate columns for crosstab in PostgreSQL

I am trying to create crosstab queries in PostgreSQL such that it automatically generates the crosstab columns instead of hardcoding …

postgresql plpgsql dynamic-sql postgresql-9.1 crosstab
Elegant way of handling PostgreSQL exceptions?

In PostgreSQL, I would like to create a safe-wrapping mechanism which returns empty result if an exception occurs. Consider the …

sql postgresql exception-handling plpgsql dynamic-sql
Refactor a PL/pgSQL function to return the output of various SELECT queries

I wrote a function that outputs a PostgreSQL SELECT query well formed in text form. Now I don't want to …

sql database postgresql plpgsql dynamic-sql
What is dynamic SQL?

I just asked an SQL related question, and the first answer was: "This is a situation where dynamic SQL is …

mysql sql stored-procedures dynamic-sql
Binding Parameters to Oracle Dynamic SQL

I have a stored procedure that accepts multiple parameters (i.e. pName, pHeight, pTeam) I have the query built up …

oracle parameters dynamic-sql
Define table and column names as arguments in a plpgsql function?

It must be simple, but I'm making my first steps into Postgres functions and I can't find anything that works... …

function postgresql variables plpgsql dynamic-sql
Select columns with particular column names in PostgreSQL

I want to write a simple query to select a number of columns in PostgreSQL. However, I keep getting errors …

sql database postgresql select dynamic-sql
INSERT with dynamic table name in trigger function

I'm not sure how to achieve something like the following: CREATE OR REPLACE FUNCTION fnJobQueueBEFORE() RETURNS trigger AS $$ DECLARE shadowname …

postgresql triggers dynamic-sql plpgsql