prepare,declare,open PROBLEM WITH INDEXES
Posted in 1996
Found something interesting with 4GL "prepare, declare, open" coding method and the relationship to "indexes" Sequence ONE create temp table . . . create index . . . prepare "sql statement that joins permanent table with temp table" declare open . . . This will cause the sql statement TO USE the created index in a join Sequence TWO create temp table . . . prepare "sql statement that joins permanent table with temp table" create index . . . declare open . . . This will cause the sql statement DO AN AUTOINDEX Could someone confirm that this will actually create another index identical to the one that was previously created? I am having a really WIERD problem that appeared as a result of a RECOMPILE of a module. I am wondering if this is somehow related. In this module the prepare's are done at the beginning for many different sql statements. The temp tables are created just so the prepare can be done and then they are dropped. Various control loops in the program drop, recreate and rebuild temp tables, doing declares and opens in the process. As a second thought. What triggers the sql engine to use an index when a temp table is involved? Does is figure it out or should and "update statistics" be done on temp tables? -- Michael J. Kuhn Computer Systems Consultant phone:410-254-7060 Email: mkuhn@csd.clark.net, csd@clark.net mkuhn@rhlab.com c/o Baltimore Rh Typing Laboratory, Inc. phone:410-225-9595