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.

How can I drop all indexes of a table in Postgres?

I keep having this problem: I have like 20 indexes on a table that I need to drop in order to …

postgresql indexing metadata dynamic-sql ddl
Return dynamic table with unknown columns from PL/pgSQL function

I need to create a function that checks on a given table if the infowindow field exists. If it exists …

postgresql polymorphism plpgsql dynamic-sql return-type
Creating cursor with Dynamic SQL in MYSQL

I am writing a stored procedure which opens a cursor to a table and then iterate through all records. In …

mysql stored-procedures cursor dynamic-sql
Escape single quote in openquery using dynamic query

I need to retrieve data from a linked server using a parameter, @PickedDate for example. The query works fine if …

sql-server dynamic-sql linked-server openquery
drop all tables sharing the same prefix in postgres

I would like to delete all tables sharing the same prefix ('supenh_agk') from the same database, using one sql …

sql postgresql plpgsql dynamic-sql
Why does running this query with EXECUTE IMMEDIATE cause it to fail?

I am writing a PL/SQL procedure that needs to to dynamically generate some queries, one of which involves creating …

sql oracle plsql dynamic-sql ora-00911
Executing queries dynamically in PL/pgSQL

I have found solutions (I think) to the problem I'm about to ask for on Oracle and SQL Server, but …

postgresql aggregate-functions plpgsql dynamic-sql dynamic-queries
How to use variable as table name in plpgsql

I'm new to plpgsql. I'm trying to run a simple query in plpgsql using a variable as table name in …

postgresql plpgsql dynamic-sql
How to dynamically build an insert command from Datatable in c#

I am facing some problem with making a SQL insert statement dynamically from a dataTable object in c#. I want …

c# ado.net dynamic-sql
"ERROR: extra data after last expected column" when using PostgreSQL COPY

Please bear with me as this is my first post. I'm trying to run the COPY command in PostgreSQL-9.2 to …

postgresql database-design dynamic-sql sqlbulkcopy