Re: help with tables





"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.

(In C# I deal with result sets, and there are specific operations to step
through them)

I was very interested to see your posts in this thread and hope I've learned
something for the next time I have to deal with Oracle :-)

It was partly limitations like this in embedded SQL which caused me to start
looking at LINQ.

At the moment there is some debate as to whether the addition of LINQ
functionality into DotNET languages, and, specifically C#, have caused the
gap to widen between C# and Java. I saw a post from a Java guy who
definitely thinks so, and he explored various options that Sun could do to
try and catch up. None of them were very attractive.

Here's a link:
http://www.sdtimes.com/printArticle/LatestNews-20080115-20.html

I'd be interested to see comments from people here.

For myself, I'm still learning functional programming and LINQ, but find it
fascinating and VERY cool :-) (I haven't been able to spend enough time on
it recently, but hope to get back to it as the weather here deterioriates...
:-) (No sign of that yet... we are having a fantastic summer; far too good
to waste indoors :-)))

I believe it is approaches such as this that will simply render embedded SQL
obsolete, but time will tell...

Pete.
--
"I used to write COBOL...now I can do anything."


.



Relevant Pages

  • Re: Host variables in embedded SQL
    ... I would like to use the fields defined in the print file as host variables in my embedded SQL. ... The documentation I found online says an externally described file's fields can be used as host variables. ... I think it might be because the printer file is opened for output only. ...
    (comp.sys.ibm.as400.misc)
  • Re: Host variables in embedded SQL
    ... I would like to use the fields defined in the print file as host variables in my embedded SQL. ... The documentation I found online says an externally described file's fields can be used as host variables. ... I think it might be because the printer file is opened for output only. ...
    (comp.sys.ibm.as400.misc)
  • Re: Host variables in embedded SQL
    ... I would like to use the fields defined in the print file as host variables in my embedded SQL. ... The documentation I found online says an externally described file's fields can be used as host variables. ... I wondering if this only applies to database files and not to printer files. ...
    (comp.sys.ibm.as400.misc)
  • Re: Embedded SQL in C#
    ... Will C# support truly embedded SQL in the future? ... Have a look at the proposed C# 3.0 language specs and LINQ at the above link. ...
    (microsoft.public.dotnet.languages.csharp)