Any preference on which to use? I know that revdb_execute was introduced in version 1.1 and revExecuteSQL was introduced in version 2.0. Is revExecuteSQL an update for redb_execute?
Thanks,
Peter
revdb_execute vs revExecuteSQL
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: revdb_execute vs revExecuteSQL
Specifically the return value from the revdb_execute function should contain the number of rows affected by the query which should be available in the "it" variable. revExecuteSQL will return a value in "the result" which indicates the number of rows affected, or any error message.The Livecode dictionary under the entry for revdb_execute wrote:Comments:
Evaluating the revdb_execute function has the same effect as executing the revExecuteSQL command. The only difference is that one is a function call and the other is a command.
Re: revdb_execute vs revExecuteSQL
Are there situations in which you would want to use one over the other? Or is it personal perference?
Thanks,
Peter
Thanks,
Peter
-
- VIP Livecode Opensource Backer
- Posts: 977
- Joined: Sat Apr 08, 2006 7:47 am
- Contact:
Re: revdb_execute vs revExecuteSQL
Nope, the two are equivalent, so it is a matter of programming style. The revdb_execute function was there first, when the revDB external was introduced back in version 1.1.1 - and all of the commands and functions in that external library were prefixed with 'revdb_' to make it easier to know where they were coming from. Around version 2.0, synonyms were added that simply start with 'rev' but were less low-level technical sounding (revdb_connect <> revOpenDatabase). And for fans of the command-query separation principle, it makes more sense to have a command than a function if you're modifying data.
I don't think either form will go away - but I personally hope that at some point in the future, the database calls get nice syntax baked into the language
Jan Schenkel.
I don't think either form will go away - but I personally hope that at some point in the future, the database calls get nice syntax baked into the language

Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com
www.quartam.com