Search Postgresql Archives

Re: foxpro, odbc, data types and unnecessary convertions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





Fernando Moreno wrote:
Hi all, I'm using visual foxpro 9 -not my decision- for a client
application. Statements are writen as the typical sql string and sent
through ODBC.
  
i like foxpro  it has its quirks as do all languages.  Only concern if this is a new app Foxpro has been killed by MS.  Version 9 is the last so no 64 bit support and at the mercy of MS to keep 32 bit support working down the road
For numbers, I have to convert them first to string and then remove
the spaces, the code looks like this: sql_string = "some sql" +
alltrim( str( some_number ) ) + " more sql"; I can combine alltrim and
  
Why the  alltrim  ?  white spaces don't hurt.

take a look at Text EndText   with TextMerge it has a few gotchas here and there but on complex sql string it makes life allot easier.


str in a third function but it's still tricky. A shorter and
presumably better way to do the same is: sql_string = "some_column =
?foxpro_variable ". 
don't use ? its from the DOS days, it does some odd conversions because it is a hold over

The problem with the last option is that, watching
the pgsql log, values are sent this way: '12345'::float(8), so for
every numeric value, no matter its type, I'm sending 12 characters
more and the server is doing convertions that I don't need.

Having a lot of foreign keys and other numeric data, I think this
behaviour is not so good for network (remote and poor connection) and
server performance. I'm almost decided to keep doing the trim/str
thing, but my question is: am I exaggerating? what would you do

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux