Prepare for select statement

Prepare for select statement

Post by Greg Lon » Sat, 18 Oct 1997 04:00:00

If I change the values of some bound parameters of a previously used
statement and re-execute it I end up with the same result set as before.

Any ideas why?

I'm connecting to SQL Server 6.5 using the ODBC 3.0 demo driver.


Greg Long


1. Prepared statement vs Exec sql insert/update/select

Is there any benefit to preparing and executing sql statements
rather than just having them in an exec sql insert/update/select....

The code runs under Oracle and Informix which is why I am posting
this in both newsgroups.  Hopefully I will get responses for both

I have read that statements should be prepared when the
statement is complex and called repeatedly.  What is meant
by complex?  Many columns?  many joins?

It used to be that we needed to prepare/execute the sql because
we didn't know some of the the table names at compile time.
But now we have moved to using 1 table and partitioning it,
so now the table names are known.  (We have also had prepares
for stmts where we have known the table name).  A few years
ago, an Informix consultant who turned out to be not very good,
told us to use prepares everywhere.  (This is when we only ran
under Informix.)  When we added Oracle to the code stream, we
kept the prepares.

Most of our sql statments have many columns and no joins.
They are executed repeatedly.  The system runs 7 x  24
with high volumes of transactions to process.

    thanks for any help,   Lisa

2. help: ap/pro indexing

3. How to execute queries stored in a variable inside a stored procedure..

4. performance question : prepared statement or statement?

5. Help with a screen problem


7. I am Curious - Locate and Tcursors

8. Error 40002 -- 37000 Satement could not be prepared (create index statement)

9. Temporary stored procedures for prepared Statements

10. --- Associated statement is not prepared - SQL Agent

11. JDBC Driver, Prepared Statements and Performance

12. Strang problem when insert record by prepare statement.