mferreira744
27th January 2006, 16:03
I was reading in a Oracle book that one main way to achieve better performance in the database is by using bind variables in SQL instructions.
Good, but now i have a question: when programing Baan Tools in a Oracle environment, we got to use bind pattern only when using 'wherebind' instruction or we do get this with simple selects with ':variable' case.
Anyone has an idea?

NPRao
27th January 2006, 23:33
Refer to the following document -
Document Information
Title SSA® Baan Design Principles
Version 2005
Created on 5/26/2005 9:42:42 AM
© Copyright 2004 by SSA Global Technologies, Inc.
use simple selects with ':variable'.
Use wherebind when you know the posting of the pattern in a variable, else you have to use 'like'. Be aware of -
Using like
Problem

The like condition is evaluated in the driver and not in the RDBMS. So, all selected records are copied from RDBMS to driver before checking the like condition.
Secondly, it is good to know that the like condition cannot evaluate Multi Byte fields.
Solution

Replace the like function by tests on substrings if possible.
Example
Bad situation
select books.*
from books
where books.number inrange 1 and 10
and books.author like "P.*"

Improved
select books.*
from books
where books.number inrange 1 and 10
and books.author(1;1) = "P"