Execute Immediate in Oracle Reports

Execute Immediate cannot use in Oracle Reports, if you tried to use, i.e. EXECUTE IMMEDIATE ‘CREATE TABLE TEST AS SELECT ‘A’ A FROM DUAL’,

this error message will occured,  “this feature is not supported in client-side programs”. EXECUTE IMMEDIATE is only supported on the server side.

Some substitution could be use, such as create a function on the database and make a simple call.  The other way is use DBMS_SQL.

Here the codes,

DECLARE

l_cursor INTEGER DEFAULT 0;
rc INTEGER DEFAULT 0;

COMPILATION_ERROR EXCEPTION;
PRAGMA EXCEPTION_INIT(COMPILATION_ERROR,-24344);

VWHERE  VARCHAR2(100);

BEGIN

VWHERE := ‘CREATE TABLE TEST AS SELECT ‘A’ A FROM DUAL’ ;
l_cursor := DBMS_SQL.OPEN_CURSOR;
DBMS_SQL.PARSE(l_cursor, VWHERE, 1);
/*DBMS_SQL.NATIVE cannot be use, replace it by the numeric literal 1*/
rc := DBMS_SQL.EXECUTE(l_cursor);
DBMS_SQL.CLOSE_CURSOR(l_cursor);

EXCEPTION
WHEN COMPILATION_ERROR THEN
DBMS_SQL.CLOSE_CURSOR(l_cursor);
WHEN OTHERS THEN
BEGIN
DBMS_SQL.CLOSE_CURSOR(l_cursor);
raise_application_error(-20101,sqlerrm || ‘ when executing ”’ || VWHERE || ”’ ‘);
END;
END;

VB6 on Vista, Error accessing the OLE Registry

When i open VB6 on Vista, i get this message “Automation Error, Error accessing the OLE Registry”.

To avoid this message appears again, i check compatibility to XP and “Run As Administrator”, and now i can work with VB6.

^_^