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


Groups > comp.lang.clipper.visual-objects > #1829

Re: Attention Clipper Programmers

From pete@nospam.demon.co.uk
Newsgroups comp.lang.clipper, comp.lang.clipper.visual-objects, comp.lang.xharbour
Subject Re: Attention Clipper Programmers
Date 2011-08-17 04:31 +0000
Organization PDL
Message-ID <1313555519snz@nospam.demon.co.uk> (permalink)
References <88118913-6047-4190-b3c2-b5cc1beb0545@glegroupsg2000goo.googlegroups.com> <417b66b3-94e8-45f8-bea5-76a7de986ab7@w22g2000prj.googlegroups.com> <XdGdne1UG7-GStfTnZ2dnUVZ_tCdnZ2d@giganews.com> <3cca4449-dec5-495a-8c59-654d39c16e9c@o9g2000vbo.googlegroups.com>

Cross-posted to 3 groups.

Show all headers | View raw


In article <3cca4449-dec5-495a-8c59-654d39c16e9c@o9g2000vbo.googlegroups.com>
           dlzc1@cox.net "dlzc" writes:

> Dear Joe Wright
> 
> On Aug 16, 1:46 pm, Joe Wright <joewwri...@comcast.net> wrote:
> > On 8/16/2011 14:58, dlzc wrote:
> ...
> > > Once that decision is made...
> >
> > > With small revisions to code, you can usually
> > > migrate into Harbour / xHarbour with minimal
> > > changes if the code does not rely on 3rd party
> > > applications.  From there it is a small step
> > > to SQL, and probably then into some other
> > > language (that you can get support for).
> ...
> > Can you expand on the "small step to SQL" thing?
> > I'm facing a massive xBASE to SQL move and I
> > don't have a clue.
> 
> A couple of ways to do this:
> #1 you could just move to ADS which is SQL-like, low entry fee, but
> another major blow to get to full SQL, or
> #2 SQLRDD
> http://www.xharbour.com/products/addons.php
> ... which will let you use SQL with minimal changes, then optimize to
> productive and SQL-efficent code as it is running.  As I understand
> it.
> 
> David A. Smith

There is another way (and maybe many more) if you are comfortable 
using SQL:

#3 Write a small Clipper prog (or series of progs) to create a SQL 
script containing your DBF data to be inserted into the new SQL table, 
then just run that script using SQLTools or whatever you have at your 
disposal.  E.g. your prg might be something like

    fh = FCREATE("myscript.sql")
    FWRITE(fh, "CREATE TABLE whatever columns/types/etc" + crlf)
    USE (yourDBF)
    FOR-EACH record in DBF
    {
        convert_each_field_to_correct_format, join_as_csv_string
        FWRITE(fh, "INSERT INTO whatever VALUES(" + string + ");" + crlf)
    }
    FWRITE(fh, "COMMIT" + crlf)

This approach might not be suitable for you if you have hundreds of 
DBFs to convert, but it will work -- I've had to do it myself!

Pete
-- 
   "We have not inherited the earth from our ancestors,
    we have borrowed it from our descendants."

Back to comp.lang.clipper.visual-objects | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Re: Attention Clipper Programmers dlzc <dlzc1@cox.net> - 2011-08-16 11:58 -0700
  Re: Attention Clipper Programmers Joe Wright <joewwright@comcast.net> - 2011-08-16 16:46 -0400
    Re: Attention Clipper Programmers dlzc <dlzc1@cox.net> - 2011-08-16 14:36 -0700
      Re: Attention Clipper Programmers Joe Wright <joewwright@comcast.net> - 2011-08-16 21:46 -0400
        Re: Attention Clipper Programmers dlzc <dlzc1@cox.net> - 2011-08-16 21:30 -0700
          Re: Attention Clipper Programmers Johan Nel <johan.nel@xsinet.co.za> - 2011-08-17 03:36 -0700
            Re: Attention Clipper Programmers Joe Wright <joewwright@comcast.net> - 2011-08-17 07:03 -0400
              Re: Attention Clipper Programmers Navin Mehta <navinmehta@gmail.com> - 2011-08-17 07:28 -0700
                Re: Attention Clipper Programmers Navin Mehta <navinmehta@gmail.com> - 2011-08-17 08:53 -0700
                Re: Attention Clipper Programmers dlzc <dlzc1@cox.net> - 2011-08-17 10:13 -0700
                Re: Attention Clipper Programmers Navin Mehta <navinmehta@gmail.com> - 2011-08-18 06:38 -0700
                Re: Attention Clipper Programmers Mike Pitcher <mike_no_spam_please_@pamuk.demon.co.uk> - 2011-08-17 08:51 -0700
      Re: Attention Clipper Programmers pete@nospam.demon.co.uk - 2011-08-17 04:31 +0000
    Moving from xBase to SQL "Jayadev" <Jayadevu_@_rediffmail.com> - 2011-08-17 11:27 +0530
  Re: Attention Clipper Programmers Martin <spam@spam.spam> - 2011-08-18 16:11 +0100

csiph-web