Alaska Software Inc. - DBF to SQL
Username: Password:
AuthorTopic: DBF to SQL
Salvatore Megna DBF to SQL
on Tue, 22 Oct 2019 13:08:14 +0200
Hi,
someone knows a software freeware for converter dbf to sql?

Thanks
Anand GuptaRe: DBF to SQL
on Tue, 22 Oct 2019 13:34:45 +0200
Salvatore Megna <smegna@tiscali.it> wrote in message news:ff03053$813a5c$69c08@news.alaska-software.com...
>Hi,
>someone knows a software freeware for converter dbf to sql?
>
>Thanks

Hi Salvatore, 

Since you are looking for freeware, see if this helps,
https://stackoverflow.com/questions/52822/how-to-import-a-dbf-file-in-sql-server

Regards,

Anand
Jorge L. BorlandoRe: DBF to SQL
on Tue, 22 Oct 2019 09:55:44 -0300
Hi Salvatotre,

it is very simple to do it in xbase, the code would be more or less like 
this,
the RealStr () function would convert OEM into the format you use. you need, 
same as mysql_to-date () for the date


   aSt           := dbStruct()
   For l := 1 To Len( aSt )
         If ( aSt[l,DBS_TYPE] = 'C' )
            cRet := cRet + "'" + Trim( ::RealStr( FieldGet( l ) ) ) + "',"
         ElseIf ( aSt[l,DBS_TYPE] = 'D' )
            cRet := cRet + mysql_date_sql( FieldGet( l ) ) + ","
         ElseIf (  aSt[l,DBS_TYPE] = 'L' )
            cRet := cRet + If( FieldGet( l ), "1", "0" ) + ","
         Else
            cRet := cRet + LTrim( Str( FieldGet( l ), aSt[l,DBS_LEN], 
aSt[l,DBS_DEC] ) ) + ","
         EndIF
   Next l
   cRet          := Stuff( cRet, Len( cRet ), 1, ')' )

Regards


"Salvatore Megna"  escribió en el mensaje de 
noticias:ff03053$813a5c$69c08@news.alaska-software.com...

Hi,
someone knows a software freeware for converter dbf to sql?

Thanks
Jim LeeRe: DBF to SQL
on Tue, 22 Oct 2019 22:41:24 +0200
hi,

> someone knows a software freeware for converter dbf to sql?

which SQL Server ?

the fastest Way is to import a CSV. here Sample for PostgreSQL

create Table Notes and import DATA.CSV

CREATE TABLE nodes(
  name numeric,
  hitem numeric,
  parent numeric,
  caption text,
  recnegativ numeric,
  __record serial,
  CONSTRAINT nodes_pkey PRIMARY KEY (__record) ) ;
  COPY nodes FROM 'X:\ALASKA\PG\DATA.CSV' DELIMITER ','



---
Diese E-Mail wurde von AVG auf Viren geprüft.
http://www.avg.com
Matej JuracRe: DBF to SQL
on Wed, 23 Oct 2019 08:39:24 +0200
Answer is "it depends".


For classical data import (data that contains no memo-text/binary blobs) best case for beginner is import csv/text/xml data via management tools that come with databases (Mysql Workbench for mysql, Microsoft sql management studio for M$ SQL, pgAdmin for postgres, Oracle Enterprise Import export tool for Oracle) Those are all GUI apps and work once you read how-to's.

So convert dbf data to csv and test those tools. Unless you do not have foreign characters in data you will not have to take care for codepage translations.

But for complex data there are many additional paths.

Jim Lee's solution will only work when you have direct access to server to store data migration files directly onto a accesible directory but you will rarely get that in secure environments but is pretty allright when you work on Windows machine as server.

Jorge's will work only to generate data to somekind of generic sql but it will fail as soon as single quote (') will be part of data or any other character that needs to be sent as escape combination. Also it needs handling of date string or empty (null date) string, memo fields and
But it is start to begin routine for custom routine for upload once you add INSERT statement and comm and error handling part.



Salvatore Megna <smegna@tiscali.it> wrote in message news:ff03053$813a5c$69c08@news.alaska-software.com...
>Hi,
>someone knows a software freeware for converter dbf to sql?
>
>Thanks
Tim CallahanRe: DBF to SQL
on Sat, 26 Oct 2019 10:51:03 -0700
On Tue, 22 Oct 2019 13:08:14 +0200, Salvatore Megna
<smegna@tiscali.it> wrote:

>Hi,
>someone knows a software freeware for converter dbf to sql?
>
>Thanks

Hi - I had a similar need where the contents of all of our DBF tables
needed to be loaded into MS SQL Server for a data mart. I wrote a .NET
app using the FoxPro ODBC driver that created the tables in SQL server
and copied the data. It's a private app so I can't share but it was
not that hard to develop.
HTH,
Tim