Re: CHATTER: Re: SQL in plain English -Reply

Author: Gene Wirchenko, genew@shuswap.net

Posted: 1999-10-06 at 13:12:43

>Ok, here's my 2 cents:

>

>I believe if it can be done in SQL, then it SHOULD be done in SQL. I had a

>time trying to get an xbase algorithm to work recently, and eventually just

>wrote simple SQL to do the same thing. My SQL code was 3 pages long, whereas

>the xbase code was over 9 pages long. I think the SQL was easier in this

>instance, but of course, it all depends on what's called for in the spec.

OTOH, I've had code that I could have written in SQL, but it was much

easier in xBASE. It depends what you are coding. xBASE is record-oriented

and SQL is set-oriented.

I've taken to grabbing sets in SQL and then manipulating them with

xBASE. It would be more difficult (though not impossible) to do it all in

xBASE. I can't see how I would do it all in SQL. There are too many bits

that need to be done. Selecting the records is only the start. There are

many checks after.

>Now I suppose someone might prefer to write tons of code if they read a

>ComputerWorld article some months ago (I wanted to reference it but I couldn't

>find it!) that said "...programmers should get paid for the number of lines of

>code they write..." or some other crap like that. That paper article deserved

>to be in the restroom to be used for a better purpose, like toilet paper,

>although that might have been too good for it. <g>

And if you spent the day shortening a program to make it run better? I

agree. The article sounds quite nonsensical.

I prefer to write compact code. Whether that is xBASE or SQL or some

mix depends on what I need. Here's one for the SQLers:

I have several DE tables where the primary key could be changed (and my

boss wants this). My xBASE code has a check for this causing a duplicate

key. I simply check for the new key and if the recno() is of the record

being edited, it's OK, otherwise the key already exists and it's an error.

(This method does assume that there aren't already dups in the table.) What

is the SQL solution? How long is it? How *clear* is it?

>Someone else (I think Cindy Winegarden) really hit the nail on the head when

>she said how it is portable and not Foxpro dependent. That is SO true. And

>if for some reason you're in a spot like Matt, you can take your SQL knowledge

>and apply for those many Oracle or other jobs out there where SQL is used.

SQL is not standard enough that the transition is going to be 100%

smooth. I follow comp.databases and comp.databases.theory and I see it

quite often.

I am not wedded to xBASE or SQL. I use what will accomplish the job.

"xBASE" is not a swear word in my books.

[snipped previous]

Sincerely,

Gene Wirchenko

genew@shuswap.net

Computerese Irregular Verb Conjugation:

I have preferences.

You have biases.

He/She has prejudices.

©1999 Gene Wirchenko, genew@shuswap.net