3

Is there a view in which I can check it? I need to create a script using the SUBSTR function by / (Linux) or \ (Windows).

SUBSTR('anything', 1, INSTR('anything', '/', 1, 1)) -- Linux

SUBSTR('anything', 1, INSTR('anything', '\\', 1, 1)) -- Windows
1
  • Where is that path used? Are you sure it wouldn't be more relevant to determine the client's environment rather than the server's?
    – jcaron
    Nov 2, 2023 at 13:02

1 Answer 1

18
SQL> select platform_name from v$database;

PLATFORM_NAME
--------------------------------------------------------------------------------
Linux x86 64-bit

To answer your original problem:

SQL> select sys_context('userenv', 'platform_slash') from dual;

SYS_CONTEXT('USERENV','PLATFORM_SLASH')
--------------------------------------------------------------------------------
/

SYS_CONTEXT

PLATFORM_SLASH

The slash character that is used as the file path delimiter for your platform.

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.