nerdexam
Oracle

1Z0-061 · Question #8

Examine the data in the ename and hiredate columns of the employees table: You want to generate a list of user IDs as follows: You issue the following query: What is the outcome?

The correct answer is A. It executes successfully and gives the correct output. REPLACE (text, search_string, replacement_string) Searches a text expression for a character string and, if found, replaces it with a specified replacement string The REPLACE Function The REPLACE function replaces all occurrences of a search item in a source string with a…

Install and Administer Oracle RAC

Question

Examine the data in the ename and hiredate columns of the employees table:

You want to generate a list of user IDs as follows:

You issue the following query:

What is the outcome?

Exhibit

1Z0-061 question #8 exhibit

Options

  • AIt executes successfully and gives the correct output.
  • BIt executes successfully but does not give the correct output.
  • CIt generates an error because the REPLACE function is not valid.
  • DIt generates an error because the SUBSTR function cannot be nested in the CONCAT function.

How the community answered

(24 responses)
  • A
    83% (20)
  • B
    4% (1)
  • C
    4% (1)
  • D
    8% (2)

Explanation

REPLACE (text, search_string, replacement_string) Searches a text expression for a character string and, if found, replaces it with a specified replacement string The REPLACE Function The REPLACE function replaces all occurrences of a search item in a source string with a replacement term and returns the modified source string. If the length of the replacement term is different from that of the search item, then the lengths of the returned and source strings will be different. If the search string is not found, the source string is returned unchanged. Numeric and date literals and expressions are evaluated before being implicitly cast as characters when they occur as parameters to the REPLACE function. The REPLACE function takes three parameters, with the first two being mandatory. Its syntax is REPLACE (source string, search item, [replacement term]). If the replacement term parameter is omitted, each occurrence of the search item is removed from the source string. In other words, the search item is replaced by an empty The following queries illustrate the REPLACE function with numeric and date expressions: Query 1: select replace(10000-3, '9', '85') from dual Query 2: select replace(sysdate, 'DEC', 'NOV') from dual

Topics

#SUBSTR#CONCAT#REPLACE#string functions

Community Discussion

No community discussion yet for this question.

Full 1Z0-061 Practice