Jach/testr — Issue #49: [DDB-26] Create Table As UDP
Author: Jach
Created: 2011-12-30 00:16:03+00:00
State: closed
Labels: UDR Library

[created="Sun, 14 Mar 2010 19:38:27 -0700", resolved="Thu, 8 Apr 2010 19:55:32 -0700"]

Create a UDP that creates a table from a generic cursor input, then optionally loads the table from the input cursor

call applib.CREATE_TABLE_AS(target_schema, target_table, input select statement, should_load);

required:

target_table_name - Name

input select statement - The input cursor. a Select statement that will produce a cursor.

optional:

target_schema - the schema to create the new table in. If null use the schema on the calling connection.

should_load - defaults to true, which means that after the new table is created the table is populated with the select statement.

Implementation notes:

if at all possible, the select statement should only be prepared, not executed during table creation

Testing Notes:

Test to make sure datatypes/precisions match

Test for errors thrown if table already exists

Test for select statements from tables, UDXs, and remote tables