Skip to Content
0
Former Member
Feb 16, 2011 at 04:28 PM

Oracle SQL command

76 Views

I have read this statement on these forums many times:

Just keep 1 thin in mind... CR will send any SQL statement, exactly as it is written, to the database. That means that if you can execute it from TOAD or the Oracle SQL Developer, you should be able to do it from CR as well.

I have an SQL command that I have simplified so that it contains just a snippet from the original that populates a temporary table.

Since there is a DECLARE there must be a BEGIN and END. The required SELECT * to get the fields to show up in the field explorer will not work before the END statement. If I put it after the END statement I get an ORA-06550 error. "FOUND SELECT WHEN EXPECTING..." . I got on the ORACLE website and they told me to put / before and after the SELECT. When I try this in CR SQL command, I get ORA-06550 "ENCOUNTERED /".

I have tried this in SQL Plus and don't get any errors.

DECLARE Pallet VARCHAR2(8);

Box VARCHAR2(8);

ItemBox VARCHAR2(8);

CODE VARCHAR2(6);

BEGIN

CODE := '20151';

CODE := CONCAT(CODE, '%');

DELETE LoadItems_temp;

COMMIT;

END;

/

SELECT * FROM LOADITEMS_TEMP;

/