Database Reference
In-Depth Information
EXEC SQL INSERT INTO foo VALUES (1, 2, 'foo1');
EXEC SQL COMMIT;
EXEC SQL DISCONNECT ALL;
return 0;
}
The output of the program is as follows:
==== sqlca ====
sqlcode: -400
sqlerrm.sqlerrml: 58
sqlerrm.sqlerrmc: INSERT has more expressions than target columns
on line 52
sqlerrd: 0 00000
sqlwarn: 0 0000000
sqlstate: 42601
===============
Summary
In this chapter, we have discussed what ECPG is and how to write SQL commands
mixed with C code. We also elaborated on how to establish a connection with the
PostgreSQL server using ECPG, how to run SQL commands, and how to handle
error and warning conditions.
In the next chapter, we will learn the concept of foreign data wrappers and about the
two communities maintaining foreign data wrappers file_fdw and postgres_fdw .
 
Search WWH ::




Custom Search