Crash
Ruslan Zasukhin
ruslan_zasukhin at valentina-db.com
Tue Aug 4 02:00:04 CDT 2015
On 8/4/15, 9:46 AM, "Ivan Smahin" <ivan_smahin at paradigmasoft.com> wrote:
> Hi Mark,
>
>> On Aug 3, 2015, at 5:52 PM, Mark Schonewille
>> <m.schonewille at economy-x-talk.com> wrote:
>>
>> Hi Ivan,
>>
>> Thanks for your reply. If I replace vDatabase_SqlQuery() with
>> vDatabase_SqlSelect() I get a record, so myCursor must be a cursor reference.
>> If it weren't, it would be a bug in Valentina.
>
> There are different methods. They are very similar but return different result
> types.
> Doing "put vDatatabase_SqlQuery() into vCursorType" you just trying to treat
> result (vQueryResult) as vCursor.
> But they are completely different types.
>
> If you know what the nature of your query (like in this case - you know that
> result is cursor) you can use SqlSelect method.
> But if the query is coming from somewhere or it is vary (say, there are tons
> of "if" in your app logic building query text) you can't be sure. For such
> cases you can use SqlQuery() which is able to perform both query types
> (execute and select) and return single result which can be as "affected record
> count" so "cursor".
In other words
vDatabase_SqlQuery()
Returns NOT cursor, it returns object of type vQueryResult.
You must at first ask what is inside of vQueryResult.
Can be 2 variants:
A) cursor
B) integer - affected rows count from e.g. UPDATE DELETE INSERT
When you know what is inside you need ASK that result from vQueryResult
using one of its methods:
GetCursor or GetInteger
--
Best regards,
Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc
Valentina - Joining Worlds of Information
http://www.paradigmasoft.com
[I feel the need: the need for speed]
More information about the Valentina
mailing list