Hi
I got this error ORA-01403 "no data found" and ORA-06512: at line 8 however I'm sure that there is date in my table dept!!!

Declare
v_deptid dept.deptid%type;
v_deptname dept.deptname%type;
v_location dept.location%type;
v_employeeid dept.employeeid%type;

begin
select deptid, deptname, location, employeeid into v_deptid, v_deptname, v_location, v_employeeid from dept where deptname = 'SALES';
dbms_output.put_line('deptid' || v_deptid);
dbms_output.put_line('deptname' || v_deptname);
dbms_output.put_line('location ' || v_location );
dbms_output.put_line('employeeid' || v_employeeid);
end;
/

select deptid, deptname, location, employeeid into v_deptid, v_deptname, v_location, v_employeeid from dept where deptname = 'SALES';

Run this query directly in sql developer or terminal. See what data comes. Oracle is case sensitive. Make sure "Sales" spelling match with case also.

commented: Yea, and made sure that the deptname in database is exactly 'SALES' without spaces behind or infront. Else will have to use 'like' +6
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.