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.

SQL Set IDENTITY Field Using Variable

All, I want to start the numbering of an IDENTITY field based on the current maximum obtained from another table. …

sql-server-2008 tsql dynamic-sql identity-column
Dynamic query results into a temp table or table variable

I have a stored procedure that uses sp_executesql to generate a result set, the number of columns in the …

sql-server dynamic-sql temp-tables table-variable sp-executesql
Test for null in function with varying parameters

I have a Postgres function: create function myfunction(integer, text, text, text, text, text, text) RETURNS table(id int, match …

postgresql null postgresql-9.1 plpgsql dynamic-sql
Passing column names dynamically for a record variable in PostgreSQL

Using PostgreSQL, column values from a table for 1st record are stored in a record variable. for ex: let the …

postgresql types plpgsql dynamic-sql hstore
DROP FUNCTION without knowing the number/type of parameters?

I keep all my functions in a text file with 'CREATE OR REPLACE FUNCTION somefunction'. So if I add or …

postgresql plpgsql dynamic-sql sql-drop
How to solve ORA-29471 on dbms_sql.open_cursor?

I'm using Oracle 11.2.0.1.0 and am trying to get the dbms_sql package to work. However, I keep getting the ORA-29471 …

oracle plsql dynamic-sql
Using OPENROWSET to dynamically retrieve SP results when SP contains # temp tables

My Scenario I'm working on a database which will contain many details from various Stored Procedures in different databases across …

sql sql-server tsql dynamic-sql openrowset
What is the SQL Server equivalent of Oracle bind variables in dynamic SQL?

In Oracle, when writing dynamic SQL one does something like this: create or replace procedure myProc(n in number) as …

sql-server tsql dynamic-sql
PostgreSQL parameterized Order By / Limit in table function

I have a sql function that does a simple sql select statement: CREATE OR REPLACE FUNCTION getStuff(param character varying) …

sql database postgresql dynamic-sql plpgsql
Ad hoc queries vs stored procedures vs Dynamic SQL

Ad hoc queries vs stored procedures vs Dynamic SQL. Can anyone say pros and cons?

sql stored-procedures dynamic-sql adhoc-queries