Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Databases General > Re: "code" tabl...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 34 of 43 Topic 3190 of 3295
Post > Topic >>

Re: "code" tables?

by "Roy Hann" <specially@[EMAIL PROTECTED] > Jun 24, 2008 at 02:47 PM

"David Cressey" <cressey73@[EMAIL PROTECTED]
> wrote in message 
news:Y358k.2$0f.1@[EMAIL PROTECTED]
>
> This is extremely interesting to me.  I want to question what you are 
> saying
> and maybe even differ with you,  but I don't want to start another one
of
> those sterile usenet debates.  I've read enough of what you write to
have
> respect for your opinions,  and I hope that's mutual.

Indeed.  But I hear the words of Harvey "The Wolf" Keitel carried faintly
on 
the breeze...  :-)

> So I hope we can
> explore this subject in some detail, and generate more light than heat.

Let's have go.

> I'm more familiar with embedded SQL as an interface to application code 
> than
> I am with ODBC or JDBC interfaces.  (I never programmed in COBOL but I
> taught database programming to COBOL programmers).  I suspect that low 
> level
> programming carries a cost with it,  and that part of that cost is that
> programmers continue to "think like programmers",  instead of learning
to
> think in SQL.  That could be part of the attraction of OTLT and EAV to 
> them.
>
> But the embedded SQL that I used was not "dynamic", as I understand the
> term.  The precompiler processed the embedded SQL,  opened a database 
> whose
> metadata was supposed to be the same as the target database,  rewrote
the
> SQL in some lower level language that I didn't need to know,  and
replaced
> the emebedded SQL with calls to these generated lower level routines 
> before
> passing the result to the compiler.

Yep, that's plain old embedded SQL.

> We had something we called "dynamic"
> SQL as well.  But that involved generating SQL at run time,  and letting

> an
> SQL interpreter parse it.  I suspect you are using "dynamic"  in a 
> different
> sense than I am,  but I'm not sure.

I mean something different (I think).  Dynamic SQL is somewhere
intermediate 
between embedded SQL and coding to an API directly.   With embedded SQL
you 
somehow construct your SQL statement on the fly by concatenating strings
or 
whetever. (It doesn't matter where it comes from; you could even get the 
user to key it by hand at run time.)  You then send the SQL statement off
to 
the server and use the DESCRIBE statement to get a descriptor back that 
tells you what the output (if any) of the query is going to look like. 
You 
then set up a buffer with a sufficient amount of storage and a description

of where each column value will go in the buffer (the details are host 
language-specific).  You then tell the server to execute the statement,
and 
then fetch successive rows into the buffer and iterate over the returned 
columns.  It sounds complicated, but having done it once you  find (1)
it's 
not that hard after all, and (2) the same bit of code is reusable
virtually 
everywhere you need to do such a thing.

> In any event,  the interesting thing is, IMO, not so much at what point 
> the
> SQL is parsed and bound,  but how automatic the process is of generating

> the
> SQL needed to reference and maintain a new code table.

That's a "how long is a bit of string" question.  It could be easy or you 
could want all kinds of bells and whistles.

> Back in the day,
> new code tables didn't occur often enough to do some heavy automation of

> the
> process,  but the necessary coding was so well understood that the
manual
> effort was relatively trivial.

Agreed, although I suspect the turnaround would still be measured in days
at 
least, whereas adding a row to a lookup table takes seconds.  The case we 
have to answer is why we think those days are worth it.  My
argument--which 
I won't spell out here--is that someone still spends days dealing with the

new code, it's just someone else and they do it later, over and over
again. 
The net benefit to the business of being able to improvise new codes 
willy-nilly will usually be near zero or worse in the long term.  I
currenty 
deal with two systems that have development teams that are maybe 25-50% 
bigger than they need to be to because productivity is so low owing to 
mysterious bits of the business model that are encoded in EAV and OTLT 
tables instead of being made manifest in the database design.  The
knowledge 
of these things is transmitted orally, like the folklore it is, and then 
code written to manifest the real business model at run time.

> So the idea of storing all in one table "to
> save programming effort"  seemed like a bad joke to me.  And the "delay 
> due
> to the cranky DBA"  was not the kind of issue in my context that it is
in
> some of today's programmers.
>
> In all my years of visiting newgroups and other forums,  I've never
quite
> learned why programmers think that database programming is so difficult.

It is, doing it the way some of them do it.  I just finished a re-write of
a 
batch job that consisted of over 14,000 lines of code and sent 2.5 million

queries to the server, and ran for 4.5 hours.  When I'd finished with it,
it 
was 600 lines of code and it sent 6 queries to the server and ran in 12 
seconds.  And I am pretty sure one of the six queries isn't needed.

>  I
> think this discussion might help me understand that.  Thanks for a
> considered reply.

Roy
 




 43 Posts in Topic:
"code" tables?
"Frank Swarbrick&quo  2008-06-18 18:16:04 
Re: "code" tables?
Marco Mariani <marco@[  2008-06-19 10:57:06 
Re: "code" tables?
--CELKO-- <jcelko212@[  2008-06-19 10:31:51 
Re: "code" tables?
--CELKO-- <jcelko212@[  2008-06-19 15:45:01 
Re: "code" tables?
--CELKO-- <jcelko212@[  2008-06-20 21:26:24 
Re: "code" tables?
"Frank Swarbrick&quo  2008-06-19 13:51:44 
Re: "code" tables?
"Frank Swarbrick&quo  2008-06-19 13:53:18 
Re: "code" tables?
"Roy Hann" <  2008-06-20 09:49:59 
Re: "code" tables?
Ed Prochak <edprochak@  2008-06-24 04:39:56 
Re: "code" tables?
Ed Prochak <edprochak@  2008-06-24 07:06:10 
Re: "code" tables?
"Frank Swarbrick&quo  2008-06-20 18:20:37 
Re: "code" tables?
"Frank Swarbrick&quo  2008-06-20 18:23:33 
Re: "code" tables?
"Arved Sandstrom&quo  2008-06-21 12:04:00 
Re: "code" tables?
"David Cressey"  2008-06-23 14:15:22 
Re: "code" tables?
"Arved Sandstrom&quo  2008-06-23 20:04:00 
Re: "code" tables?
Gene Wirchenko <genew@  2008-06-23 18:18:26 
Re: "code" tables?
"Arved Sandstrom&quo  2008-06-24 03:42:56 
Re: "code" tables?
"David Cressey"  2008-06-24 11:20:16 
Re: "code" tables?
"Arved Sandstrom&quo  2008-06-24 12:58:37 
Re: "code" tables?
"David Cressey"  2008-06-24 14:01:23 
Re: "code" tables?
"Arved Sandstrom&quo  2008-06-25 05:13:26 
Re: "code" tables?
"David Cressey"  2008-06-25 14:47:13 
Re: "code" tables?
"Arved Sandstrom&quo  2008-06-26 12:08:21 
Re: "code" tables?
"Roy Hann" <  2008-06-26 13:53:32 
Re: "code" tables?
Gene Wirchenko <genew@  2008-06-26 09:52:50 
Re: "code" tables?
"David Cressey"  2008-06-26 17:31:31 
Re: "code" tables?
Marco Mariani <marco@[  2008-06-27 10:31:30 
Re: "code" tables?
"Arved Sandstrom&quo  2008-06-28 10:19:00 
Re: "code" tables?
"David Cressey"  2008-06-26 13:11:03 
Re: "code" tables?
"David Cressey"  2008-06-24 11:05:30 
Re: "code" tables?
"David Cressey"  2008-06-23 14:13:58 
Re: "code" tables?
"Roy Hann" <  2008-06-23 16:23:46 
Re: "code" tables?
"David Cressey"  2008-06-24 11:41:44 
Re: "code" tables?
"Roy Hann" <  2008-06-24 14:47:39 
Re: "code" tables?
"David Cressey"  2008-06-24 14:26:09 
Re: "code" tables?
"Roy Hann" <  2008-06-24 16:05:05 
Re: "code" tables?
"David Cressey"  2008-06-24 18:09:27 
Re: "code" tables?
"Frank Swarbrick&quo  2008-06-23 10:16:23 
Re: "code" tables?
"Frank Swarbrick&quo  2008-06-23 15:47:12 
Re: "code" tables?
"Roy Hann" <  2008-06-24 01:15:59 
Re: "code" tables?
"David Cressey"  2008-06-24 12:36:50 
Re: "code" tables?
"Frank Swarbrick&quo  2008-06-24 13:56:05 
Re: "code" tables?
"Roy Hann" <  2008-06-24 21:13:57 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Dec 5 9:33:25 CST 2008.