![]() | ![]() Products ![]() ![]() ![]() ![]() |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB SQL » View Thread |
Messages 1 to 5 of 5 total |
![]() |
Wed, May 5 2010 11:27 AM | Permanent 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 PM | Permanent 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 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. ![]() | 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 PM | Permanent 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 AM | Permanent Link |
Dieter Nagy | Uli,
no it ist declared as VARCHAR ![]() 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 |
This web page was last updated on Wednesday, August 14, 2024 at 07:31 PM | Privacy Policy![]() © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? ![]() |