Using embedded SQL v15
These two examples show how to use embedded SQL with EDB Postgres Advanced Server.
Example: A simple query
The first code sample shows how to execute a SELECT
statement that returns a single row, storing the results in a group of host variables. After declaring host variables, it connects to the edb
sample database using a hard-coded role name and the associated password and queries the emp
table. The query returns the values into the declared host variables. After checking the value of the NULL
indicator variable, it prints a simple result set onscreen and closes the connection.