Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Function VS. Embedded SQL

Status
Not open for further replies.

raisin96

Programmer
Oct 10, 2002
21
US
Hi,

Which is better using functions to execute SQL statements or Embedded SQL...??? I'm currently doing Embedded SQL in C in an AIX environment.

Functions e.g.

PreparedStatement ps = con.prepareStatement("SELECT img FROM images WHERE imgname=?");
ps.setString(1, "myimage.gif");
ResultSet rs = ps.executeQuery();

or

Embedded SQL e.g. "EXEC SQL SELECT img FROM images
WHERE imgname=......"

Thanks.
 
I would stay on using embedded SQL, becaus it is not proprietary to PostgreSQL. With embedded SQL you can change the database much easier, because it is a standard which is provided on several databases.
In the case of changing a db you just precompile your .pgc file with the new db and thats it.

kind regards boaconstrictor
 
Thanks boaconstrictor.

best regards,

raisin96
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top