Declare
v_str varchar2(30);
V_p0 integer;
V_p1 integer;
begin
v_str:='Smith, Joe A';
v_p0:=instr(v_str,' ');
v_p1:=instr(v_str,' ',v_p0+1);
dbms_output.put_line(substr(v_str,1,v_p1-1));
end;
/
SQL (Structured Query Language) is designed to be used in conjunction with relational database products as of a means of working with sets of data. SQL consists of data definition, data manipulation, and procedural elements. Its scope includes data insert, query, update and delete, schema creation and modification, and data access control.
TRUSTED BY
Have a look at instr to locate the second space.
http://www.sqlines.com/oracle/functions/instr
Then use substr to cut the string using the second position of space from instr -1
To cut the string
The -1 might not be necessary.