Re: help with tables



In article <29n2q3p0caoh922pmsenajrl1niln3j4m3@xxxxxxx>,
Robert <no@xxxxxx> wrote:
On Thu, 31 Jan 2008 17:38:23 +1300, "Pete Dashwood"
<dashwood@xxxxxxxxxxxxxxxxxxxxxxxxx>
wrote:



"Robert" <no@xxxxxx> wrote in message
news:jof2q31shvbu6d9ia1i7gelptabq9slahe@xxxxxxxxxx
On Wed, 30 Jan 2008 10:39:28 -0700, "Frank Swarbrick"
<Frank.Swarbrick@xxxxxxxxxxxxxx>
wrote:

--------------------------------------------------------------------
SQL0060W The "COBOL" precompiler is in progress.
19 SQL0008N The token "occurs" found in a host variable
declaration is not valid.
41 SQL4943W The number of host variables in the INTO clause
is not the same as the number of items in the SELECT
clause. SQLSTATE=01503

The manual says DB2 doesn't allow a simple SELECT to return multiple rows.
You must do the
SELECT in a cursor declaration and read the table with a single FETCH, as
illustrated by
Frederico.

Thanks for the experiment.


While I don't claim the same level of SQL knowledge that you have
demonstrated, Robert, I have managed to use it successfully for a number of
years.

Obviously you CAN return multiple rows from a query if you can process a
result set, however, in embedded SQL I've always used the cursor and FETCHed
it.

Many Cobol programmers think it's not possible to get a result set,
except by FETCHing one
row at a time. They regard a database as VSAM on drugs.

Ummmmm... many COBOL programmers I know work with DB2, Mr Wagner; didn't
you mention something about what the manual said regarding this in another
post?

(I have, certainly, seen DB2 installations where the database is treated
in programs as though it were VSAM... and then a few of the 'power users'
get access and training in QMF (training for the programmers usually
consisted of 'The managers went to the classes... and they slept; here's a
manual and remember, we're trying to keep things as much in The Old Way as
possible') and rather... pretty confrontations could result.)

DD

.



Relevant Pages

  • SOLVED Embedded SQL and MS ACCESS dates
    ... RDBs before scaling them to something else, and many people with COBOL ... each ISAM record encountered.) ... The data on this file has not been cleansed so the load program does some ... Note the date Host Variables defined as 64 bit floating point. ...
    (comp.lang.cobol)
  • OT: Religion in CLC posts WAS: Re: MF Collection Class speed
    ... COBOL was a powerful cult that ruled the world of EDP for at least 25 years ... There are certainly parallels with religion in that. ... It was administered by High Priests who kept the details ... are also found to a large extent in COBOL programmers. ...
    (comp.lang.cobol)
  • Re: DRAFT COBOL revision
    ... This is error prone and should not be used as a valid example. ... Java has local declaration and I never heard anybody complaining about ... so why not OO Cobol? ... I do programming in Java in a daily basis, ...
    (comp.lang.cobol)
  • Re: The Year 2038 Problem
    ... their own IBM mainframe system (using COBOL). ... were discussing/debating the merits of a possible stock split ... The crux of the problem was that the COBOL programmers ... it was the same length as an existing record type. ...
    (comp.lang.c)
  • Re: Work For The Willing
    ... I might suggest that if you *like* COBOL you should learn Python. ... [Not sure whether I'm irritating COBOL programmers or Pythonistas ... Perl is more like C, in that nothing in the language keeps you from writing ...
    (rec.arts.sf.fandom)