SQL_SetAffinity

Синтаксис

native SQL_SetAffinity(const driver[]);

Употреба

driver
The name of a driver to use.

Описание

Sets driver affinity. You can use this to force a particular driver implementation.
This will automatically change all SQL natives in your plugin to be "bound" to
the module in question.

Забележка

Using this while you have open handles to another database type will
cause problems. I.e., you cannot open a handle, switch affinity,
then close the handle with a different driver.

Забележка

Switching affinity is an O(n * m) operation, where n is the number of
SQL natives and m is the number of used natives in total.

Забележка

Intuitive programmers will note that this causes problems for
threaded queries. You will have to either force your script to work
under one affinity, or to pack the affinity type into the query data,
check it against the current, then set the new affinity if necessary.
Then, restore the old one for safety.

Връщаща стойност

If no module with the given name is found, returns 0.
Unless your plugin is bult to handle different driver
types at once, you should let this error pass.