I have created a table using sqlplus without any data. How can I write a test in DBFit to check if a table with that name exists?
So you want an assertion that the table exists. Simply a matter of checking of the Oracle data dictionary.
Without knowing DBfit syntax the query would be:
select count(*) from user_tables where table_name = 'YOUR_TEST_TABLE';
If that returns 1 the table exists with that name. If 0 it doesn't.
you can use Query Stats for this.
syntax is like this.
!| Query Stats | | query | is empty?| |select * from user_tables where table_name = 'table_name' |false |
Following the answer from APC, in DBFIt you would do something like this:
!|Query| !- select count(*) KNT from user_tables where table_name = 'YOUR_TEST_TABLE' -!| |KNT| |1|
Although, if its not a table of your creation, you may wish to use all_tables instead of user_tables.
Copyright © 2021 Jogjafile Inc.
So you want an assertion that the table exists. Simply a matter of checking of the Oracle data dictionary.
Without knowing DBfit syntax the query would be:
If that returns 1 the table exists with that name. If 0 it doesn't.