>select sernum from pers where pers.sernum = m.sernum into array temp;
>if _tally <> 0
>yadda yadda
>
In Oracle, you have an index on the field Sernum in the Pers table? Next problem is you can not rely on _tally for the number of records returned by a SQL query against an Oracle table. Use tje RecCount function. _Tally is probably working because its value has not been reset to 0 after it already performed a VFP function that had already set it to a non-zero value.
If you are using SQL Passthru, do you build your select statement like:
lcSQL = "select sernum from pers where pers.sernum = " + m.sernum + " into array temp"
This assumes m.sernum is character. If numeric:
"... = " + str(m.sernum, nLength, nDecimals) + " into array temp"
I think you are better off retrieving into a cursor [delete the
into array temp clause], then copy the results into an array from the cursor.
lnRetval = SQLExec(nConnectionHandle, lcSQL, "Results_Cursor_Name_Here")
Mark McCasland
Midlothian, TX USA