Re: Get "user" tables On 29 Apr, 17:37, "Dave Hughes" <d...@waveform.plus.com> wrote:
> WP wrote:
[snip]
>
> Okay, you're using an "implicit" connection which means the Java app is
> connecting as the user it's running under. If you wanted to find out
> which tables a specific user has created you could do something like:
>
> SELECT TABSCHEMA, TABNAME FROM SYSCAT.TABLES WHERE OWNER = 'USERNAME'
>
> (If you're using DB2 v8 or below, user DEFINER instead of OWNER). To
> find out which tables the currently connected user has created:
>
> SELECT TABSCHEMA, TABNAME FROM SYSCAT.TABLES WHERE OWNER = USER
SELECT TABSCHEMA, TABNAME FROM SYSCAT.TABLES WHERE OWNER = USER; works
just fine and I think I'm going to use that. Right now, the java
program and the db2 database can be assumed to be running on the same
machine but I'm thinking maybe I should reconfigure things so the java
program has to specify username when connecting (and password maybe).
Hmm.
Thanks for the quick replies!
[snip]
>
> BTW, don't use != for inequality - it's deprecated. <> is standard SQL.
Ah, thanks, I will remember that. First I tried "IS NOT" but that
didn't work, heh.
By the way, I'm using verion 9.5.
>
> Cheers,
>
> Dave.
- WP |