![]() | ![]() Products ![]() ![]() ![]() ![]() |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB General » View Thread |
Messages 1 to 2 of 2 total |
![]() |
Sat, May 9 2015 9:28 PM | Permanent Link |
Barry | I have a stored procedure that looks like:
Declare _Cursor Sensitive Cursor for _Stmt; Prepare 'select * from table where Num1 = 0'; Open _Cursor; Fetch First From _Cursor; if EOF(_Cursor) then Insert into _Cursor ('col1','col2'...) values('val1','val2'); set _Ok = RowsAffected(_Stmt) > 0; -- _Ok is always FALSE even if a row is added. end if; It seems RowsAffected(_Stmt) always returns 0 when a new row is Inserted, although RowsAffected(_Stmt) returns 1 if I Update a row. Does RowsAffected(Statement) not work for Insert statements? I'm using v 2.13 B2 Unicode. TIA Barry |
Fri, May 15 2015 2:29 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. ![]() | Barry,
<< It seems RowsAffected(_Stmt) always returns 0 when a new row is Inserted, although RowsAffected(_Stmt) returns 1 if I Update a row. >> No, it always returns 0 when you're using a *cursor* insert to perform the insertion. If you were to use an actual INSERT statement, then it would return the correct value. Cursor inserts *always* work, or they return an exception, and they are always a single operation (rows affected=1). Tim Young Elevate Software www.elevatesoft.com |
This web page was last updated on Wednesday, July 2, 2025 at 06:46 PM | Privacy Policy![]() © 2025 Elevate Software, Inc. All Rights Reserved Questions or comments ? ![]() |