![]() | |
![]() |
| | Thread Tools | Display Modes |
#11
| |||
| |||
|
|
On Jan 13, 2009, at 11:24 AM, Roy Hann wrote: If someone else wanted to take it on, I'd suggest a full-blown data transformation utility. :-) That's actually how Datallegro did it at one point, although I don't know about the "full-blown" part. Someone wrote a text to binary formatter that was meant to sit in front of fastload. I think it was relatively basic though. (I never had anything to do with the convert utility, so my knowledge is limited.) A reasonably complete data transformer that glued itself onto the core bits of the COPY statement (perhaps even using the API) would seem to be a good way to approach the general problem. That way you wouldn't be tied to the existing COPY syntax, nor the existing COPY libq implementation. |
#12
| |||
| |||
|
|
A reasonably complete data transformer that glued itself onto the core bits of the COPY statement (perhaps even using the API) would seem to be a good way to approach the general problem. |
#13
| |||
| |||
|
|
Karl & Betty Schendel wrote: A reasonably complete data transformer that glued itself onto the core bits of the COPY statement (perhaps even using the API) would seem to be a good way to approach the general problem. http://manuals.sybase.com/onlinebook...View/1806;hf=0 http://www.freetds.org/reference/a00287.html I think you're describing Sybase's bcp utility. It loads text files into tables; it uses the table metadata to drive client-side conversion. Like COPY, the bits on the wire are row images. A lot of the code has been written already, for FreeTDS. Just a SMP. If you don't like the unlovely syntax of Sybase's utility, here's an idea for a better one: http://www.schemamania.org/dbstreams/dbcat.pdf |
#14
| |||
| |||
|
|
First off, I do like the idea of a command-line utility to do this job. But am I right in thinking the focus of FreeTDS is on developing the libTDS API, and that dbcat is just a sample implementation? |
|
As it stands I can see how adding a tds_convert_uuid() function to the API might be quite straight-forward. But we are still left with the problem that neither Ingres nor dbcat (for example) know that a particular field in a file is intended to be treated as a UUID to be converted to the 16 byte binary form. There needs to be some means to request conversions like that. I see the need for a moderately complex language to specify that kind of thing. |
#15
| |||
| |||
|
|
Roy Hann wrote: But we are still left with the problem that neither Ingres nor dbcat (for example) know that a particular field in a file is intended to be treated as a UUID to be converted to the 16 byte binary form. There needs to be some means to request conversions like that. I see the need for a moderately complex language to specify that kind of thing. Yes and no. The datatypes of the target table can be ascertained from the metadata returned by "select * from tablename where 0=1". In the simplest case, the file is mapped 1:1 to the columns. When the target column is a UUID, the tds_convert_uuid() function is used. |
#16
| |||
| |||
|
|
The datatypes of the target table can be ascertained from the metadata returned by "select * from tablename where 0=1". In the simplest case, the file is mapped 1:1 to the columns. When the target column is a UUID, the tds_convert_uuid() function is used. Yes, but my point is that even Ingres doesn't know the column contains UUIDs. |
![]() |
| Thread Tools | |
| Display Modes | |
| |