Several db functions don't work.

Creating desktop or client-server database solutions?

Moderators: Klaus, FourthWorld, heatherlaine, robinmiller, kevinmiller

Post Reply
DavidBurleigh
Posts: 19
Joined: Sun Apr 05, 2009 9:27 am

Several db functions don't work.

Post by DavidBurleigh » Thu Feb 04, 2010 11:01 pm

Rev 2.9 running on Ubuntu 7.10 using postgres 8.3.3.

revNumberOfRecords returns -1
Query builder doesn't even work. I hit the + sign and nothing happens; all of the items are disabled except for the tabs which do click back and forth.
revOpenDatabase does work.
revQueryDatabase partially works; it returns a cursor. I can move to first record, and to next record, but when I try to extract using
revDatabaseColumnNamed it only prints out a single character - regardless of the field I use. It does print out the correct first letter
of the field, but that is it.

revDataFromQuery, once again, only prints out the first character of what should be a 'return' delimited list of lines.

I'm suspecting that this has to do with the type cast disparity between Rev and Postgres. I remember somewhere where Rev uses, I think,
UTF16? and postgres uses UTF8? or unicode, under an unmodified native installation. I can't find anything that shows that this is
the problem or how to code an SQL statement within Rev to cast the argument return into Rev format.

thanks
incomex@hotmail.com

bangkok
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 839
Joined: Fri Aug 15, 2008 7:15 am

Re: Several db functions don't work.

Post by bangkok » Thu Feb 18, 2010 11:34 pm

DavidBurleigh wrote: revDataFromQuery, once again, only prints out the first character of what should be a 'return' delimited list of lines.

I'm suspecting that this has to do with the type cast disparity between Rev and Postgres.
I had exactly the same problems with revDataFromQuery... but it was with the ODBC driver (and a MS SQL db).

I tried then with RunRev 3.5 : no problem. ;-)

Before that, I was using only MySQL (with RunRev 2.9) , without any problems.

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2874
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Re: Several db functions don't work.

Post by mwieder » Fri Feb 19, 2010 5:14 pm

David- check out the docs for revNumberOfRecords(). This threw me at first as well. What SQL command are you running before calling this? The revNumberOfRecords() functions returns the number of records modified by the previous SQL command, so if you're expecting it to give you for instance a total number of records in a table then you want to get the results of a SQL count() query instead.

...and don't bother with the querybuilder...

Post Reply

Return to “Databases”