Re: foxpro, odbc, data types and unnecessary convertions

From: Justin <justin(at)emproshunts(dot)com>
To: "Fernando Moreno" <azazel(dot)7(at)gmail(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: foxpro, odbc, data types and unnecessary convertions
Date: 2009-02-26 15:31:39
Message-ID: 49A6B5DB.2050703@emproshunts.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

<!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&nbsp; it has its quirks as do all languages.&nbsp; Only concern if
this is a new app Foxpro has been killed by MS.&nbsp; 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&nbsp; alltrim&nbsp; ?&nbsp; white spaces don't hurt.<br>
<br>
take a look at Text EndText&nbsp;&nbsp; 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>

Attachment Content-Type Size
unknown_filename text/html 2.3 KB

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Daniel Verite 2009-02-26 15:33:09 Re: Format string for ISO-8601 date and time
Previous Message Daniel Verite 2009-02-26 15:21:55 Re: Format string for ISO-8601 date and time