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 SQL function that extracts a portion of a string. The syntax is SUBSTR(string, start_position, length). INSTR finds the position of a substring (returns a number). SUBSTRING and POS are not valid Oracle character functions. SUBSTR returns the actual substring portion.

AI explanation

SUBSTR is the standard SQL/PLSQL function used to extract a specified portion of a character string, taking a starting position and (optionally) a length. SUBSTRING is the ANSI SQL/other-dialect equivalent but isn't the function name in Oracle's SQL dialect being tested here, INSTR finds the position of a substring rather than extracting one, and POS isn't a real function for this purpose.