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.

ORA-01747: invalid user.table.column, table.column, or column specification

Get the above error when the execute immediate is called in a loop Update CustomersPriceGroups set 1AO00=:disc Where cuno=:…

oracle plsql dynamic-sql
Why do I get "Procedure expects parameter '@statement' of type 'ntext/nchar/nvarchar'." when I try to use sp_executesql?

Why do I get this error Procedure expects parameter '@statement' of type 'ntext/nchar/nvarchar'. when I try to …

sql sql-server tsql dynamic-sql
Create PostgreSQL ROLE (user) if it doesn't exist

How do I write an SQL script to create a ROLE in PostgreSQL 9.1, but without raising an error if it …

sql postgresql roles dynamic-sql
In SQL Server, how do I generate a CREATE TABLE statement for a given table?

I've spent a good amount of time coming up with solution to this problem, so in the spirit of this …

sql-server scripting dynamic-sql
nvarchar(max) still being truncated

So I'm writing a stored procedure in MS SQL Server 2008. It's a really long query and I have to write …

sql sql-server-2008 dynamic-sql
sql use statement with variable

I'm trying to switch the current database with a SQL statement. I have tried the following, but all attempts failed: …

sql-server sql-server-2005 dynamic-sql
Table name as a PostgreSQL function parameter

I want to pass a table name as a parameter in a Postgres function. I tried this code: CREATE OR …

function postgresql plpgsql dynamic-sql identifier
dynamic sql query in postgres

I was attempting to use Dynamic SQL to run some queries in postgres. Example: EXECUTE format('SELECT * from result_%s_…

postgresql dynamic-sql psql
PostgreSQL convert columns to rows? Transpose?

I have a PostgreSQL function (or table) which gives me the following output: Sl.no username Designation salary etc.. 1 A …

sql postgresql pivot-table dynamic-sql crosstab
T-SQL Dynamic SQL and Temp Tables

It looks like #temptables created using dynamic SQL via the EXECUTE string method have a different scope and can't be …

sql-server tsql stored-procedures dynamic-sql temp-tables