Skip to Main Content

SQLcl: MCP Server & SQL Prompt

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

sqlcl script run query based on database version

Marek LällMar 18 2020 — edited Mar 19 2020

Hi,

At sqlcl startup/login I would like to execute different select statements in login.sql based on database version.

Example:

if "database version" >= 18

  execute: "select INSTANCE_NAME, HOST_NAME, VERSION_FULL from v$instance"

else

  execute: "select INSTANCE_NAME, HOST_NAME, VERSION from v$instance"

Scripting seems one solution for that.

Any hints about how to identify short and native way the database version?

Regards,

Marek Läll

This post has been answered by Marek Läll on Mar 18 2020
Jump to Answer
Comments
Post Details
Added on Mar 18 2020
3 comments
441 views