Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 5 of 5 total
Thread Update
Wed, May 5 2010 11:27 AMPermanent Link

Dieter Nagy

Hello,

there is a problem with the following proc.

BEGIN
DECLARE STATCURSOR CURSOR WITH RETURN FOR STMT;
DECLARE C1 SMALLINT;
.......
DECLARE D1 SMALLINT;
.........

PREPARE STMT FROM 'SELECT * FROM ZAHLEN';
OPEN STATCURSOR;
FETCH FIRST FROM STATCURSOR(Z1,.......) INTO C1,.....;
WHILE NOT EOF(STATCURSOR) DO
SET D1 = 'A'+CAST(C1 AS VARCHAR);
.....

UPDATE STATCURSOR SET D1 = 1;   <=== ERROR: THE COLUMN D1 DOES NOT EXIST.

......

I will find the column for update with the 'A'+CAST(C1 AS VARCHAR).

Is there a way to do that?

Please help me.

TIA Dieter
Wed, May 5 2010 2:38 PMPermanent Link

Uli Becker

Dieter

> DECLARE D1 SMALLINT;

You declared D1 as an integer. Is the field you want to update really
named "D1"?

Or do you mean something like this:

OPEN STATCURSOR;
FETCH FIRST FROM STATCURSOR(Z1,.......) INTO C1,.....;
WHILE NOT EOF(STATCURSOR) DO
  SET D1 = 'A'+CAST(C1 AS VARCHAR);
  ....
  UPDATE STATCURSOR SET MyField = D1;
  ...

Uli

Wed, May 5 2010 5:42 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Dieter,

<< I will find the column for update with the 'A'+CAST(C1 AS VARCHAR).

Is there a way to do that? >>

Not currently, but it is a highly-requested feature, so I will see if I can
fit it in the next build.

--
Tim Young
Elevate Software
www.elevatesoft.com
Wed, May 5 2010 11:54 PMPermanent Link

Dieter Nagy

Thanks Tim.

Dieter







"Tim Young [Elevate Software]" wrote:

Dieter,

<< I will find the column for update with the 'A'+CAST(C1 AS VARCHAR).

Is there a way to do that? >>

Not currently, but it is a highly-requested feature, so I will see if I can
fit it in the next build.

--
Tim Young
Elevate Software
www.elevatesoft.com
Thu, May 6 2010 12:01 AMPermanent Link

Dieter Nagy

Uli,

no it ist declared as VARCHAR Smiley

thanks,
Dieter





Uli Becker wrote:

Dieter

> DECLARE D1 SMALLINT;

You declared D1 as an integer. Is the field you want to update really
named "D1"?

Or do you mean something like this:

OPEN STATCURSOR;
FETCH FIRST FROM STATCURSOR(Z1,.......) INTO C1,.....;
WHILE NOT EOF(STATCURSOR) DO
  SET D1 = 'A'+CAST(C1 AS VARCHAR);
  ....
  UPDATE STATCURSOR SET MyField = D1;
  ...

Uli
Image