The "Session Scripts" plugin could do it for you. It adds a "Session
Scripts..." item to the "Plugins" main menu. You should have selected
the plugin during the SQuirreL SQL installation.
– Stanimir
Fri, 20 Nov 2020 03:16:56 +0000 (UTC), /Alarcón Vladimir/:
> Maybe there's another way of resolving this, but I haven't fonud it:
> I need to set the default schema for an Oracle connection; otherwise,
> I need to type the schema on every query I write. In my use case I'm
> connecting to an Oracle database with a read-only user (production
> db), and this user does not correspond to the schema where the data
> is stored.
>
> So far, I can see three options:
>
> 1. Type the schema on every query. I really don't want to do this.
>
> 2. Run the SQL statement: "ALTER SESSION SET CURRENT_SCHEMA
> prod-schema", every time I connect or reconnect.
>
> 3. Stackoverflow says I can create a trigger on my user schema that
> automatically runs option #2 when connecting. Unfortunately I can't
> do this since I have read-only access.
>
> I was wondering Squirrel SQL's Session Properties could be enhanced
> with an "Initial SQL Statement" provided by the user. I think Spring
> implements this strategy at startup.
>
> Maybe there's a better way I haven't found yet. Alternatively, if
> someone tells me where to fix it, I could fork Squirrel SQL and later
> submit the change.
--
|