Category "dynamic-sql"

How do I execute clob in execute immediate

I have a table with one row and clob as column (whose size is 5239). This column contains a table script extracted with the help of dbms_metadata.get_ddl. Along

Generate JSON object from a dynamic set of input functions

I am trying to write a function (f_all) that basically just calls other "partial" functions (e.g. f_1,f_2,f_3) and merges the results of them into one final JSO

GBQ Execute Immediate into a CTE

I am building an application/script for users that do not have write access to the database. Normally I would use Execute Immediate and save that result into a

Postgresql - SQL query to list all sequences in database

I would like to select all sequences in the database, get the schema of sequence, dependent table, the schema of a table, dependent column. I've tried the follo

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 already exists? The current script simply has: CREATE ROLE