Which SQL statement is used in embedded SQL to fetch data into host variables?

2024

Which SQL statement is used in embedded SQL to fetch data into host variables?

Answer: D. SELECT INTOIn embedded SQL, the SELECT INTO statement is used to fetch data from a database and store it directly into host variables. This allows the application to…

  1. A.

    INSERT INTO

  2. B.

    UPDATE

  3. C.

    DELETE

  4. D.

    SELECT INTO

  5. E.

    Question not attempted

Attempted by 1132 students.

Show answer & explanation

Correct answer: D

In embedded SQL, the SELECT INTO statement is used to fetch data from a database and store it directly into host variables. This allows the application to retrieve specific data from a table and use it in the host program. The syntax is: SELECT column1, column2 INTO :host_var1, :host_var2 FROM table_name WHERE condition; The INTO clause specifies the host variables where the retrieved data will be stored. This is essential for retrieving data in a structured way within a host language like C or COBOL.

Explore the full course: Uppsc Polytechnic Lecturer 2025 Cs

Loading lesson…