A Gentle Introduction to

SQL

NEW.

These questions have been submitted by users.



What are the advantages of using host language variables as parameters in embedded sql compared with ? placeholders

In my opinion there is no advantage - but it is entirely a matter of preference.

When using SQL from a programming language we need a mechanism to transfer values between the "host language" (such as perl) and the SQL interface.

I prefer to see the data obtained explicitly using the fetchrow_array call.

As an alternative you can bind perl variable to columns of the SQL using the bind_col call. Every call to fetch then implicitly updates these variables - yuck.

oracle variations:
None

access
db2
mysql
oracle
postgres
sqlserver