Newbie having SQL select problems with array in 2.5.8

Walton Sumner wsumner at im.wustl.edu
Fri Feb 1 15:26:41 CST 2008


Here is a snippet of code that works only when the extra line is present:

function updateTable pName,pFieldList,pArray
    local tKey, tCursor, tCount, tSQL, tItem, tValues, i, tResult
    if pArray[1] = "" then return "Error: empty key value in array"
    put "SELECT * FROM" && pName && "WHERE" && item 1 of pFieldList \
         into tSQL

   --THIS IS THE EXTRA LINE:
    replace ":1" with "'" & pArray[1] & "'" in tSQL


    put VDataBase_SqlSelect( sDatabase, tSQL,"kClientSide", \
        "kReadWrite", "kForwardOnly", pArray ) into tCursor
    get errorCheck()
    put VCursor_RecordCount( tCursor ) into tCount

With the extra line, it works fine. Obviously I can loop through and do this
for each array element, but that would be ridiculous. Without the extra
line, tSQL looks something like this:

SELECT * FROM ICD_Term WHERE Code=:1

When the VDataBase_SqlSelect function is called,
tCursor becomes ERROR 0x7004
and my errorCheck() function says:

"Using clause required for dynamic parameters"

The documentation I have for Rev is "V4REV_Reference_3_en.pdf". It does not
say anything at all about Using clauses with select statements. Perhaps I am
trying to access features that 2.5.8 does not have. This would account for a
lot of my confusion (possibly including my inability to use the "SHOW
TABLES" statement). Apparently there used to be a
"V4REV_Reference_2_en.pdf", but I can not find it on the internet.

Questions: 
1. Where can I get "V4REV_Reference_2_en.pdf"? Shouldn't this be available
to all superbundle purchasers? I can not find it installed with Valentina.

2. Should I be able to use :N notation in a 2.5.8 select statement? How?

Thanks,

Walt
 




More information about the Valentina mailing list