Embedded SQL
Embedded SQL is a technique of joining the computing power of a programming language and the database management capabilities of SQL. Embedded SQL statements are SQL statements are written inline with the program source code of the host language. Embedded SQL provides environments to develop application programs. The main idea behind embedded SQL is to allow statement in a program written in high level programing language like C, C++.
Example of Embedded SQL
Declare
A number;
B number;
C number;
D varchar2(10);
Begin
Select emp_name, dept_name, emp_sal into B, C, D from table_emp where emp_no=&A;
Dbms_output.put_line(B);
Dbms_output.put_line(C);
Dbms_output.put_line(D);
End;
No comments:
Post a Comment