I'm trying to do the following:
Pertinent Info - using Oracle11g, accessing via "All Around Automations PL/SQL Developer" right now, but later intending to use PHP to pull the data.
Here's how I'm trying right now
The part I'm having trouble with is either A) my approach is wrong, or B) I can't use "myusers.username.table_name" - most likely because it doesn't exist, or at least it doesn't exist like I'm trying to use it.
My background is mostly in shell scripting and php so some of the PLSQL conventions are just a little different than what I'm used to. Do I perhaps need another variable declaration to hold the value of the username?
Thanks!
- select all of the users on the system
- loop over that list of users and see if a certain table exists
- if it does print out the username
Pertinent Info - using Oracle11g, accessing via "All Around Automations PL/SQL Developer" right now, but later intending to use PHP to pull the data.
Here's how I'm trying right now
Code:
DECLARE
cnt NUMBER;
BEGIN
FOR myusers in ( select username from all_users )
LOOP
SELECT COUNT(*) INTO cnt from myusers.username.table_name;
IF ( cnt > 0 )THEN
dbms_output.put_line(myusers.username);
END IF;
END LOOP;
END;
/
The part I'm having trouble with is either A) my approach is wrong, or B) I can't use "myusers.username.table_name" - most likely because it doesn't exist, or at least it doesn't exist like I'm trying to use it.
My background is mostly in shell scripting and php so some of the PLSQL conventions are just a little different than what I'm used to. Do I perhaps need another variable declaration to hold the value of the username?
Thanks!