<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
<br>
<br>
Fernando Moreno wrote:
<blockquote
cite="mid:b1c45530902251340r6b62cd0u9da123e0d91e9356(at)mail(dot)gmail(dot)com"
type="cite">
<pre wrap="">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.
</pre>
</blockquote>
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<br>
<blockquote
cite="mid:b1c45530902251340r6b62cd0u9da123e0d91e9356(at)mail(dot)gmail(dot)com"
type="cite">
<pre wrap="">
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
</pre>
</blockquote>
Why the alltrim ? white spaces don't hurt.<br>
<br>
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. <br>
<br>
<br>
<blockquote
cite="mid:b1c45530902251340r6b62cd0u9da123e0d91e9356(at)mail(dot)gmail(dot)com"
type="cite">
<pre wrap="">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 ". </pre>
</blockquote>
don't use ? its from the DOS days, it does some odd conversions because
it is a hold over <br>
<br>
<blockquote
cite="mid:b1c45530902251340r6b62cd0u9da123e0d91e9356(at)mail(dot)gmail(dot)com"
type="cite">
<pre wrap="">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</pre>
</blockquote>
</body>
</html>