Correct Answer : Get Lastest Questions and Answer : Exp: The syntax for the Oracle/PLSQL SUBSTR function is: SUBSTR( string, start_position, [ length ] ) Parameters or Arguments string is the source string. start_position is the position for extraction. The first position in the string is always 1.
length is optional. It is the number of characters to extract. If this parameter is omitted, the SUBSTR function will return the entire string. NOTE : If start_position is 0, then the SUBSTR function treats start_position as 1 (ie: the first position in the string). If start_position is a positive number, then the SUBSTR function starts from the beginning of the string. If start_position is a negative number, then the SUBSTR function starts from the end of the string and counts backwards. If length is a negative number, then the SUBSTR function will return a NULL value. Let's look at some Oracle SUBSTR function examples and explore how to use the SUBSTR function in Oracle/PLSQL. For example: SUBSTR('This is a test', 6, 2) Result: 'is' SUBSTR('This is a test', 6) Result: 'is a test' SUBSTR('TechOnTheNet', 1, 4) Result: 'Tech' SUBSTR('TechOnTheNet', -3, 3) Result: 'Net' SUBSTR('TechOnTheNet', -6, 3) Result: 'The' SUBSTR('TechOnTheNet', -8, 2) Result: 'On'
Question : What value is returned after executing the following statement? INSTR('Tech on the net', 'e') 1. the first occurrence of 'e' 2. the last occurrence of 'e' 3. Access Mostly Uused Products by 50000+ Subscribers 4. None of the above
string is the string to search. string can be CHAR, VARCHAR2, NCHAR, NVARCHAR2, CLOB, or NCLOB.
substring is the substring to search for in string. substring can be CHAR, VARCHAR2, NCHAR, NVARCHAR2, CLOB, or NCLOB.
start_position is the position in string where the search will start. This argument is optional. If omitted, it defaults to 1. The first position in the string is 1. If the start_position is negative, the INSTR function counts back start_position number of characters from the end of string and then searches towards the beginning of string.
nth_appearance is the nth appearance of substring. This is optional. If omitted, it defaults to 1.
NOTE
If substring is not found in string, then the INSTR function will return 0.
Question : What value is returned after executing the following statement? INSTR('Tech on the net', 'e', -3, 2) 1. the first occurrence of 'e' 2. the last occurrence of 'e' 3. Access Mostly Uused Products by 50000+ Subscribers 4. None of the above
Correct Answer : Get Lastest Questions and Answer : Exp: The syntax for the Oracle/PLSQL INSTR function is: INSTR( string, substring [, start_position [, nth_appearance ] ] ) Parameters or Arguments string is the string to search. string can be CHAR, VARCHAR2, NCHAR, NVARCHAR2, CLOB, or NCLOB. substring is the substring to search for in string. substring can be CHAR, VARCHAR2, NCHAR, NVARCHAR2, CLOB, or NCLOB. start_position is the position in string where the search will start. This argument is optional. If omitted, it defaults to 1. The first position in the string is 1. If the start_position is negative, the INSTR function counts back start_position number of characters from the end of string and then searches towards the beginning of string. nth_appearance is the nth appearance of substring. This is optional. If omitted, it defaults to 1. If substring is not found in string, then the INSTR function will return 0. Let's look at some Oracle INSTR function examples and explore how to use the INSTR function in Oracle/PLSQL.
For example: INSTR('Tech on the net', 'e') Result: 2 (the first occurrence of 'e') INSTR('Tech on the net', 'e', 1, 1) Result: 2 (the first occurrence of 'e') INSTR('Tech on the net', 'e', 1, 2) Result: 11 (the second occurrence of 'e') INSTR('Tech on the net', 'e', 1, 3) Result: 14 (the third occurrence of 'e') INSTR('Tech on the net', 'e', -3, 2) Result: 2
1. The SALES1 table is created with no rows but only a structure. 2. The SALES1 table would have primary key and unique constraints on the specified columns. 3. Access Mostly Uused Products by 50000+ Subscribers 4. The SALES1 table would have not null and unique constraints on the specified columns. 5. The SALES1 table would not be created because column-specified names in the select and create table clauses do not match