Close all open databases -- VDataBase_Open()

william humphrey bill at bluewatermaritime.com
Sun Oct 13 21:03:49 CDT 2013


function queryTest
put "**SHOW DATABASES" into tSQL

  *put* VDatabase_SqlSelect( lDatabase, tSQL ) into myCursor

-- try sqlselect instead of sqlquery also

--    put vDatabase_SqlQuery(lDatabase,"**SHOW DATABASES") into myCursor

-- although sql query should work

 *put* VCursor_RecordCount(myCursor) into recNum
   put VCursor_GetRecords(myCursor,1,recNum,**tab,cr) into myData

*put* VCursor_Destructor(myCursor) into myCursor

-- can't leave un-destructed cursors laying around

-- good practice or when database does fancy restore after crash

-- all the data which has open cursor is lost

-- this is not clear in any documentation because journaling that does
fancy stuff

-- was added later
   return myData
end queryTest


On Sun, Oct 13, 2013 at 9:18 PM, Mark Schonewille <
m.schonewille at economy-x-talk.com> wrote:

> Hi Ruslan or anyone else who knows this,
>
> Unfortunately, this script
>
> function queryTest
>    put vDatabase_SqlQuery(lDatabase,"**SHOW DATABASES") into myCursor
>    put VCursor_GetRecords(myCursor,,,**tab,cr) into myData
>    return myData
> end queryTest
>
> returns an empty value. An integer is stored in myCursor, but myData is
> empty. If I run the samein Valentina Studio, I get a small table with all
> databases. What am I doing wrong?
>
>
> --
> Best regards,
>
> Mark Schonewille
>
> Economy-x-Talk Consulting and Software Engineering
> Homepage: http://economy-x-talk.com
> Twitter: http://twitter.com/**xtalkprogrammer<http://twitter.com/xtalkprogrammer>
> KvK: 50277553
>
> Use Color Converter to convert CMYK, RGB, RAL, XYZ, H.Lab and other colour
> spaces. http://www.color-converter.com
>
> Buy my new book "Programming LiveCode for the Real Beginner"
> http://qery.us/3fi
>
> Fill out this survey please
> http://livecodebeginner.**economy-x-talk.com/survey/<http://livecodebeginner.economy-x-talk.com/survey/>
>
> On 10/13/2013 23:15, Ruslan Zasukhin wrote:
>
>> On 10/13/13 8:18 PM, "Mark Schonewille" <m.schonewille at economy-x-talk.**
>> com <m.schonewille at economy-x-talk.com>>
>> wrote:
>>
>> Hi Mark,
>>
>>  Thanks. How do I execute SQL and get the data directly, just like the
>>> revDataFromQuery() function in LiveCode?
>>>
>>
>> Hi Mark,
>>
>> Directly into string?
>>
>> Oops, it seems PDF misses 2 functions of this kind
>> We will add it tomorrow.
>>
>>
>>
>> Class VCursor
>>
>>
>> put VCursor_GetRecord(
>>      cursorRef, [RecIndex], [fldDelimiter] )
>> into VAR
>>
>>
>>
>> put VCursor_GetRecords(
>>      cursorRef, [FromRec], [MaxRecords], [fldDelimiter], [recDelimiter] )
>> into VAR
>>
>>
>>
>>
>>
>>  ______________________________**_________________
> Valentina mailing list
> Valentina at lists.macserve.net
> http://lists.macserve.net/**mailman/listinfo/valentina<http://lists.macserve.net/mailman/listinfo/valentina>
>



-- 
http://www.bluewatermaritime.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macserve.net/pipermail/valentina/attachments/20131013/90ed93d3/attachment.html>


More information about the Valentina mailing list