Home > database >  How to judge whether a table in the PB ISQL exist, even the Oracle database
How to judge whether a table in the PB ISQL exist, even the Oracle database

Time:09-18

How to judge whether a table in the PB ISQL exists, the Oracle database, thank you

CodePudding user response:

SELECT count (*) INTO: ll_count FROM TAB WHERE tname=: ls_tablename;
If ll_count & gt; 0 Then
//there
End If

CodePudding user response:

Select * from all_tables where "TABLE_NAME"='table'

CodePudding user response:

1st floor, how to define variables in the SQL

CodePudding user response:

Need an Oracle and original concept can be generic

CodePudding user response:

1, dba_tables and user_tables access is different, a dba permissions, a is the owner in this table, the online information, check on your own, ha ha,
2, user_tables query directly, have a table_name fields,
Dba_tables have an owner field, you can specify a user,
For example:
SQL> The select table_name from user_tables;

TABLE_NAME
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
The JOBS
REGIONS
LOCATIONS
JOB_HISTORY
The DEPARTMENTS
EMPLOYEES
COUNTRIES
TEST1
TEST33

Selected line 9,

CodePudding user response:

String ls_table
Long ll_cnt

Select count (1) into: ll_cnt from user_tables where table_name=: ls_table;

If ll_cnt & gt; 0 then
Messagebox (', 'table exists)
The else
Messagebox (', 'table does not exist')
end if
  • Related