Running Create OR Replace scripts

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
snorris
Posts: 1
Joined: Tue 17 Apr 2012 03:00

Running Create OR Replace scripts

Post by snorris » Tue 17 Apr 2012 14:31

Hello All, I'm new to your UniDac (4.1.5/Delphi 7/Oracle11g) product and I'm trying to find the best process for loading an Oracle "CREATE OR REPLACE" procedure.

The overview is I have a simple file with the procedure. I may have may versions available so the application will find the correct version and I would like for it to load within my database.

I get the following error "ORA-24344 Success with complilation error". I can recompile the procedure in the Oracle Management Console with no errors. Below you will find a simple procedure I'm currently working with for testing:

CREATE OR REPLACE PROCEDURE Test_CreateTable
(
i_table IN VARCHAR2
) AS

v_cursor INTEGER;
v_create_line VARCHAR2(200);
v_working_table VARCHAR2(80);

CURSOR c_get_columns IS
SELECT column_name
FROM user_tab_columns
WHERE table_name = upper(i_table) AND nullable = 'N';

BEGIN

v_working_table := 'TEST_' || UPPER(i_table);

v_create_line := 'CREATE TABLE ' || v_working_table ||
' AS SELECT * FROM ' || i_table ||
' WHERE 1 = 2';
END Test_CreateTable;
/

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Wed 18 Apr 2012 10:31

Hello,

If you are using the UniScript component, then your code is executed with no errors, as this component allows execution of several commands, i.e. the Create itself and '/' are two different commands, and they are executed by turn. But if you are using UniSQL, you should remove '/' in the end of the script for execution without errors, as this component doesn't allow execution of several commands

Post Reply