Multiple choice technology databases

Which character function can be used to return a specified portion of a character string?

  1. INSTR

  2. SUBSTRING

  3. SUBSTR

  4. POS

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

SUBSTR is the Oracle character function that extracts a specific portion of a string. It takes parameters for the input string, starting position (1-based), and optionally the length. For example, SUBSTR('Oracle', 1, 3) returns 'Ora'. INSTR finds the position of a substring but doesn't extract it. SUBSTRING doesn't exist in Oracle (that's SQL Server syntax). POS is not a valid Oracle function.