Unix Technical Forum

Using as in a cursor

This is a discussion on Using as in a cursor within the DB2 forums, part of the Database Server Software category; --> Hello Folks, I've created a SP witch returns a resultset. When I'm calling from the query manager, everthing is ...


Go Back   Unix Technical Forum > Database Server Software > DB2

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-27-2008, 09:17 AM
Sebastian Moderlak
 
Posts: n/a
Default Using as in a cursor

Hello Folks,

I've created a SP witch returns a resultset.
When I'm calling from the query manager, everthing is fine. (result here:
AGREEMENT and STORNO)
When I'm calling from ODBC, the related cols are so called as the sourcename
is (result here: col1 and col2)

What is going wron on ODBC - or on me?

Thanks for help.
Bas

#### the source ###########

CREATE PROCEDURE psht3agr(in strAdar char(1), in strAdnr char(8))
DYNAMIC RESULT SETS 1
LANGUAGE SQL
CALLED ON NULL INPUT
READS SQL DATA
INHERIT SPECIAL REGISTERS

BEGIN
DECLARE c1 CURSOR FOR
select col1 as AGREEMENT, col2 as STORNO
from table1
where col3 = strAdar
and col4 = strAdnr;

OPEN c1;
END;



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-27-2008, 09:18 AM
Serge Rielau
 
Posts: n/a
Default Re: Using as in a cursor

Sebastian Moderlak wrote:
> Hello Folks,
>
> I've created a SP witch returns a resultset.
> When I'm calling from the query manager, everthing is fine. (result here:
> AGREEMENT and STORNO)
> When I'm calling from ODBC, the related cols are so called as the sourcename
> is (result here: col1 and col2)
>
> What is going wron on ODBC - or on me?

The DB2 server provides the exposed column name and the base column name.
Are you sure you are looking at the right attribute in ODBC?

Cheers
Serge

PS: Platform, version would be helpful
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab

IOD Conference
http://www.ibm.com/software/data/ond...ness/conf2006/
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-27-2008, 09:18 AM
Sebastian Moderlak
 
Posts: n/a
Default Re: Using as in a cursor

> The DB2 server provides the exposed column name and the base column name.
> Are you sure you are looking at the right attribute in ODBC?

Hi Serge,

thanks for your help. I've looked for the exposed column name and found
them.
Now it works fine.

Greetings from Germany
Bas


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 04:29 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com