Re: foxpro, odbc, data types and unnecessary convertions - Mailing list pgsql-general

From Justin
Subject Re: foxpro, odbc, data types and unnecessary convertions
Date
Msg-id 49A6B5DB.2050703@emproshunts.com
Whole thread Raw
In response to foxpro, odbc, data types and unnecessary convertions  (Fernando Moreno <azazel.7@gmail.com>)
List pgsql-general
Fernando Moreno wrote:
<blockquote
 cite="mid:b1c45530902251340r6b62cd0u9da123e0d91e9356@mail.gmail.com"
 type="cite">
  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
<blockquote
 cite="mid:b1c45530902251340r6b62cd0u9da123e0d91e9356@mail.gmail.com"
 type="cite">

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.


<blockquote
 cite="mid:b1c45530902251340r6b62cd0u9da123e0d91e9356@mail.gmail.com"
 type="cite">
  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

<blockquote
 cite="mid:b1c45530902251340r6b62cd0u9da123e0d91e9356@mail.gmail.com"
 type="cite">
  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

pgsql-general by date:

Previous
From: "Daniel Verite"
Date:
Subject: Re: Format string for ISO-8601 date and time
Next
From: "Daniel Verite"
Date:
Subject: Re: Format string for ISO-8601 date and time