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 to generate column names?

I have a query where I'm trying pivot row values into column names and currently I'm using SUM(Case...) As …

sql sql-server sql-server-2005 tsql dynamic-sql
How to Add Quotes to a Dynamic SQL Command?

I am storing and editing some field in a database that involves a long string of one or more sentences. …

sql dynamic-sql
PostgreSQL - Writing dynamic sql in stored procedure that returns a result set

How can I write a stored procedure that contains a dynamically built SQL statement that returns a result set? Here …

postgresql resultset plpgsql execute dynamic-sql
Function to loop through and select data from multiple tables

I'm new to Postgres and have a database with multiple tables of the same structure. I need to select data …

postgresql for-loop plpgsql dynamic-sql set-returning-functions
PL/SQL - Optional conditions in where-clause - without dynamic sql?

I have a query where not all conditions are necessary. Here's an example of what it looks like when all …

oracle plsql oracle10g dynamic-sql
SQL Error: Incorrect syntax near the keyword 'End'

Need help with this SQL Server 2000 procedure. The problem is made difficult because I'm testing procedure via Oracle SQL Developer. …

sql-server stored-procedures sql-server-2000 syntax-error dynamic-sql
Oracle EXECUTE IMMEDIATE into a cursor

I have a stored procedure which used the EXECUTE IMMEDIATE command to execute a very long string. How do I …

sql oracle stored-procedures dynamic-sql sys-refcursor
Creating SQL table using dynamic variable name

I want to create backup SQL tables using variable names. something along the lines of DECLARE @SQLTable Varchar(20) SET @SQLTable = …

sql sql-server database tsql dynamic-sql
Building dynamic where condition in SQL statement

I want to build custom Where condition based on stored procedure inputs, if not null then I will use them …

sql sql-server stored-procedures where-clause dynamic-sql
Is there a dynamic Sql builder library for .Net?

Something like this. http://code.google.com/p/squiggle-sql/wiki/Tutorial. This is required for cases where It is required …

.net sql ado.net dynamic-sql