Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.clipper.visual-objects > #13367 > unrolled thread

SQL long field names

Started byHenry Fidler <zodcomag@gmail.com>
First post2021-07-04 02:39 -0700
Last post2021-07-12 16:23 +0200
Articles 4 — 2 participants

Back to article view | Back to comp.lang.clipper.visual-objects


Contents

  SQL long field names Henry Fidler <zodcomag@gmail.com> - 2021-07-04 02:39 -0700
    Re: SQL long field names "Wolfgang Riedmann" <wriedmann@gmail.com> - 2021-07-04 15:30 +0200
      Re: SQL long field names Henry Fidler <zodcomag@gmail.com> - 2021-07-12 03:52 -0700
        Re: SQL long field names "Wolfgang Riedmann" <wriedmann@gmail.com> - 2021-07-12 16:23 +0200

#13367 — SQL long field names

FromHenry Fidler <zodcomag@gmail.com>
Date2021-07-04 02:39 -0700
SubjectSQL long field names
Message-ID<b2294a19-f5b8-44e8-b474-416249d349c7n@googlegroups.com>
I try to connect, via SQL objects, to an external internet host MySQL, and build from it local dbf files.
The external MySQL has file names longer then 10, so DbCreate() truncate them.
Any idea how to solve the problem?

Henry

[toc] | [next] | [standalone]


#13369

From"Wolfgang Riedmann" <wriedmann@gmail.com>
Date2021-07-04 15:30 +0200
Message-ID<ikdreqFu46iU1@mid.individual.net>
In reply to#13367
Hi Henry,

> I try to connect, via SQL objects, to an external internet host
> MySQL, and build from it local dbf files.  The external MySQL has
> file names longer then 10, so DbCreate() truncate them.  Any idea how
> to solve the problem?

if you are using your own dbServer subclass you could maintain an
internal array of mapped fieldnames.

I would use the first 8 characters of every fieldname and than add a 2
characters numeric suffix, and store that in some external
configuration file.
Then, when opening the DBF, read the aliases from your configuration
file and map that in a subclassed
FieldGet()/FieldPut()/IVarGet()/IVarPut() method.

But there is also something like this already built in: please look at
the DBFieldInfo() function or the DBServer:FieldInfo() method, using
the constant DBS_ALIAS should do what you need (I have not tested that,
so you have to try it yourself).

Wolfgang


-- 

[toc] | [prev] | [next] | [standalone]


#13384

FromHenry Fidler <zodcomag@gmail.com>
Date2021-07-12 03:52 -0700
Message-ID<3e814551-8cd6-41e6-bc7e-91ebf9ac9029n@googlegroups.com>
In reply to#13369
Wolfgang many thanks.

An internal array could be a logical idea, until someone changes the original names of the SQL in the host.
Dbs_Alias gave me little help. After assigning FieldInfo(Dbs_Alias, ...), the next time the file is opened, the alias has back the field name.

I hoped the SQL method will have a built in possibility to solve the problem.

Interesting: dbCreate() truncate the original field´s names,  and build a db with few fields which have the same name.

Henry

[toc] | [prev] | [next] | [standalone]


#13386

From"Wolfgang Riedmann" <wriedmann@gmail.com>
Date2021-07-12 16:23 +0200
Message-ID<il31j9F1ss6U1@mid.individual.net>
In reply to#13384
Hi Henry,

> An internal array could be a logical idea, until someone changes the
> original names of the SQL in the host.  Dbs_Alias gave me little
> help. After assigning FieldInfo(Dbs_Alias, ...), the next time the
> file is opened, the alias has back the field name.

of course, this is not a permanent option, so you have to store the
aliases somewhere in a persistent manner

> Interesting: dbCreate() truncate the original field´s names,  and
> build a db with few fields which have the same name.

the DBF data structure limits the field names to 10 bytes, so changing
that in the format would break backwards compatibility.
AFAIK FoxPro has done something like this, but they have have an
external file with the supplemental informations.

Wolfgang

-- 

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.clipper.visual-objects


csiph-web