Actually Code Tester is made for regular testing of the stored source code as you found out. However, Code Tester also can be used in some additional cases with exploiting the customization options.
I was able to test this SQL statement as a proof of concept:
create table local_assertions as select * from QU_ASSERTION;
As a test I chose the "Specified object exists in the database?" I will explain how to do it in following steps.
- I created a stored procedure which is required by Code Tester. The source code does nothing, we only need this procedure to create a test definition. CREATE OR REPLACE PROCEDURE PRC_TESTER_ANON
- I created a test definition to run tests lately.
- In the customization section of the test case, we are allowed to write the SQL statement. However, it is required to be wrapped in the PL/SQL test code, so we need to transform it to an executable statement. I used execute immediate:
- Now I have a test of the SQL statement in the test definition for procedure PRC_TESTER_ANON and I can run it whenever I want.
If you want to change the tested statement or the test, you can edit the test definition - test case. Or you can add another test case and thus be able to test your old code repeatedly.
If you are interested and need help with a specific statement using this work around, please don't hesitate to write again.