Re: help with tables



In article <47A053E0.6F0F.0085.0@xxxxxxxxxxxxxx>,
Frank Swarbrick <Frank.Swarbrick@xxxxxxxxxxxxxx> wrote:
On 1/29/2008 at 9:37 PM, in message
<15ovp3p40dmvcovmgc3co257gi595dn3ii@xxxxxxx>, Robert<no@xxxxxx> wrote:
If you don't like BULK COLLECT syntax, leave it out. Selecting into an
array does the
same thing and isn't tied to Oracle. It works on DB2 the same way. For
example:

01 table2-area.
05 table2-entry occurs 1 to 100 depending on sqlerrd (3).
10 t2-name pic x(30).
10 t2-dept pic x(04).

compute sqlerrd(3) = length of table2-area / length of table2-entry
select name, department into table2-entry from table2
where name in (select distinct name from table1)
display 'There are ' sqlerrd(3) ' departments.'

This does not appear to work, at least not using the DB2 pre-processor.

Oh, these silly 'professionals' and their demands that things do stuff
like... *work*. I seem to recall that in DB2 there's a specific SQLcode
that comes back if more than one row in a table satisfies the criteria of
a given SELECT.

Some folks would get rather upset when they saw this... I've seen it turn
a fellow from a genial, clean-talking guy into quite the curse-er.

DD
.



Relevant Pages

  • Re: help with tables
    ... declaration is not valid. ... 51 SQL0306N The host variable "TABLE2-ENTRY" is undefined. ... Here is an sample from the IBM DB2 manual: ... "DB2 Call Level Interface (CLI) versus embedded dynamic SQL ...
    (comp.lang.cobol)
  • Re: help with tables
    ... department into table2-entry from table2 ... This does not appear to work, at least not using the DB2 pre-processor. ... EXEC SQL ... 41 SQL4943W The number of host variables in the INTO clause ...
    (comp.lang.cobol)
  • Re: help with tables
    ... declaration is not valid. ... 51 SQL0306N The host variable "TABLE2-ENTRY" is undefined. ... SQL0095N No bind file was created because of previous ... Here is an sample from the IBM DB2 manual: ...
    (comp.lang.cobol)
  • Re: How to determine database market share?
    ... with your meaningful contributions to to .oracle lists over the time ... It was not "Something about measuring database market penetration by ... > On the DB2 side, many of the people who are DB2 DBA's have been doing ... > On the SQL Server side, there are 2 questions involved, how many real ...
    (comp.databases.oracle.server)
  • Re: Migrating to Oracle on Windows
    ... I am looking into migrating a database from DB2 on z/OS to Oracle ... essentially no excuse for moving to Windows, ... The example I gave of migrating from DB2 on z/OS to Oracle on Windows ...
    (comp.databases.oracle.server)