Home » Community » Newbie corner » SqlVal to int (Typecast) (Typecasting from sqlval type to other types)
Re: SqlVal to int (Typecast) [message #45224 is a reply to message #45176] |
Sat, 10 October 2015 01:01   |
 |
Alboni
Messages: 216 Registered: January 2012 Location: Kajaani, Finland
|
Experienced Member |
|
|
Hi, I'm using the same code for MySql and SqLite versions of my program and I'd like to point out that using
can behave rather quirky.. in combination with functions like Sum() or Count()
Depending of which db you use, Count, Sum etc. could be presented as int or a String type. Confusing.
A better way (especially if you would select more than one column) is to use the As function:
UserQuerySql * SqlSelect (SqlCount(MBVARINDEX).As(MBVARINDEX)).From ( PARAMETER );
while ( UserQuerySql.Fetch() )
{
ro=sql[MBVARINDEX];
}
I also like to use SqlSelect, SqlSum, SqlCount etc. because the other terms are so generic there are often clashes.
[Updated on: Sat, 10 October 2015 01:04] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Fri Jun 20 16:09:54 CEST 2025
Total time taken to generate the page: 0.04093 seconds
|