dbTalk Databases Forums  

Assertion failed with number(*) function

sybase.public.sqlanywhere.general sybase.public.sqlanywhere.general


Discuss Assertion failed with number(*) function in the sybase.public.sqlanywhere.general forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Bofcilo
 
Posts: n/a

Default Assertion failed with number(*) function - 12-07-2009 , 02:24 PM






PROCEDURE :

create procedure READER_KS_MAGSTA (IN l_vd char(2), IN l_bd char(10))
begin

declare l_kssifra char(13);
declare l_id integer;

set l_id = 1;

for loop1 as cur1 cursor for
select txtcode as ds_code,
txtkol as ds_kol
from reader_text
order by ids
do

set l_kssifra = (select korsifra from rb_korsifra where eancode =
ds_code);

/* THIS IS WRONG CODE I KNOW number(*) ? */
insert into ks_magsta(sifvrd, brodok, ids, korsifra, eancode,
kolicina)
values (l_vd, l_bd, number(*) , l_kssifra, ds_code, ds_kol);

/* THIS IS CORRECT CODE WHAT I NEED */
insert into ks_magsta(sifvrd, brodok, ids, korsifra, eancode,
kolicina)
values (l_vd, l_bd, l_id, l_kssifra, ds_code, ds_kol);
set l_id = l_id + 1;

end for;

commit;

exception
when others then
rollback;
end
&&


With wrong part of code i receive error : assertion failed
106901....unexpectedly NULL in write.
First version of procedure was : insert into .... select ,,number
(*)....
For some reason i need loop with cursor and insert into ... values
(...).

It is my mistake.. number(*) function couldn't use in VALUES (...).
But my database goes to be temporally invalid (validate return error :
orphaned page in database). After restarting database, validating
database returns NO ERROR.

Reply With Quote
  #2  
Old   
Bofcilo
 
Posts: n/a

Default Re: Assertion failed with number(*) function - 12-07-2009 , 02:40 PM






On Dec 7, 9:24*pm, Bofcilo <sprin... (AT) gmail (DOT) com> wrote:
Quote:
PROCEDURE :

create procedure READER_KS_MAGSTA (IN l_vd char(2), IN l_bd char(10))
begin

declare l_kssifra char(13);
declare l_id integer;

set l_id = 1;

for loop1 as cur1 cursor for
* * select txtcode as ds_code,
* * * * * * txtkol as ds_kol
* * from reader_text
* * order by ids
do

* * set l_kssifra = (select korsifra from rb_korsifra where eancode=
ds_code);

/* THIS IS WRONG CODE I KNOW *number(*) ? */
* insert into ks_magsta(sifvrd, brodok, ids, korsifra, eancode,
kolicina)
* * values (l_vd, l_bd, number(*) , l_kssifra, ds_code, ds_kol);

/* THIS IS CORRECT CODE WHAT I NEED */
* * insert into ks_magsta(sifvrd, brodok, ids, korsifra, eancode,
kolicina)
* * values (l_vd, l_bd, l_id, l_kssifra, ds_code, ds_kol);
* * set l_id = l_id + 1;

end for;

commit;

exception
when others then
* * *rollback;
end
&&

With wrong part of code i receive error : assertion failed
106901....unexpectedly NULL in write.
First version of procedure was : insert into .... select ,,number
(*)....
For some reason i need loop with cursor and insert into ... values
(...).

It is my mistake.. number(*) function couldn't use in VALUES (...).
But my database goes to be temporally invalid (validate return error :
orphaned page in database). After restarting database, validating
database returns NO ERROR.
Version of database 10.0.3415 ........

Reply With Quote
  #3  
Old   
Glenn Paulley [Sybase iAnywhere]
 
Posts: n/a

Default Re: Assertion failed with number(*) function - 12-07-2009 , 02:48 PM



What version of SQL Anywhere are you running?

We will try to reproduce the assertion failure with NUMBER(*) in the
VALUES() list - this should cause a simple run-time failure of the
statement with a syntax error.

The validation problem may be due merely to transient changes to the
database file, which are corrected upon shutdown.

Glenn

Bofcilo wrote:
Quote:
PROCEDURE :

create procedure READER_KS_MAGSTA (IN l_vd char(2), IN l_bd char(10))
begin

declare l_kssifra char(13);
declare l_id integer;

set l_id = 1;

for loop1 as cur1 cursor for
select txtcode as ds_code,
txtkol as ds_kol
from reader_text
order by ids
do

set l_kssifra = (select korsifra from rb_korsifra where eancode =
ds_code);

/* THIS IS WRONG CODE I KNOW number(*) ? */
insert into ks_magsta(sifvrd, brodok, ids, korsifra, eancode,
kolicina)
values (l_vd, l_bd, number(*) , l_kssifra, ds_code, ds_kol);

/* THIS IS CORRECT CODE WHAT I NEED */
insert into ks_magsta(sifvrd, brodok, ids, korsifra, eancode,
kolicina)
values (l_vd, l_bd, l_id, l_kssifra, ds_code, ds_kol);
set l_id = l_id + 1;

end for;

commit;

exception
when others then
rollback;
end
&&


With wrong part of code i receive error : assertion failed
106901....unexpectedly NULL in write.
First version of procedure was : insert into .... select ,,number
(*)....
For some reason i need loop with cursor and insert into ... values
(...).

It is my mistake.. number(*) function couldn't use in VALUES (...).
But my database goes to be temporally invalid (validate return error :
orphaned page in database). After restarting database, validating
database returns NO ERROR.
--
Glenn Paulley
Director, Engineering (Query Processing)
Sybase iAnywhere

Blog: http://iablog.sybase.com/paulley

EBF's and Patches: http://downloads.sybase.com
choose SQL Anywhere Studio >> change 'time frame' to all

To Submit Bug Reports: http://case-express.sybase.com

SQL Anywhere Studio Supported Platforms and Support Status
http://my.sybase.com/detail?id=1002288

Whitepapers, TechDocs, and bug fixes are all available through the
Sybase iAnywhere pages at
http://www.sybase.com/products/datab...chnicalsupport

Reply With Quote
  #4  
Old   
Bofcilo
 
Posts: n/a

Default Re: Assertion failed with number(*) function - 12-07-2009 , 03:00 PM



On Dec 7, 9:48*pm, "Glenn Paulley [Sybase iAnywhere]"
<paul... (AT) ianywhere (DOT) com> wrote:
Quote:
What version of SQL Anywhere are you running?

We will try to reproduce the assertion failure with NUMBER(*) in the
VALUES() list - this should cause a simple run-time failure of the
statement with a syntax error.

The validation problem may be due merely to transient changes to the
database file, which are corrected upon shutdown.

Glenn



Bofcilo wrote:
PROCEDURE :

create procedure READER_KS_MAGSTA (IN l_vd char(2), IN l_bd char(10))
begin

declare l_kssifra char(13);
declare l_id integer;

set l_id = 1;

for loop1 as cur1 cursor for
* * select txtcode as ds_code,
* * * * * * txtkol as ds_kol
* * from reader_text
* * order by ids
do

* * set l_kssifra = (select korsifra from rb_korsifra where eancode =
ds_code);

/* THIS IS WRONG CODE I KNOW *number(*) ? */
* insert into ks_magsta(sifvrd, brodok, ids, korsifra, eancode,
kolicina)
* * values (l_vd, l_bd, number(*) , l_kssifra, ds_code, ds_kol);

/* THIS IS CORRECT CODE WHAT I NEED */
* * insert into ks_magsta(sifvrd, brodok, ids, korsifra, eancode,
kolicina)
* * values (l_vd, l_bd, l_id, l_kssifra, ds_code, ds_kol);
* * set l_id = l_id + 1;

end for;

commit;

exception
when others then
* * *rollback;
end
&&

With wrong part of code i receive error : assertion failed
106901....unexpectedly NULL in write.
First version of procedure was : insert into .... select ,,number
(*)....
For some reason i need loop with cursor and insert into ... values
(...).

It is my mistake.. number(*) function couldn't use in VALUES (...).
But my database goes to be temporally invalid (validate return error :
orphaned page in database). After restarting database, validating
database returns NO ERROR.

--
Glenn Paulley
Director, Engineering (Query Processing)
Sybase iAnywhere

Blog:http://iablog.sybase.com/paulley

EBF's and Patches:http://downloads.sybase.com
* choose SQL Anywhere Studio >> change 'time frame' to all

To Submit Bug Reports:http://case-express.sybase.com

SQL Anywhere Studio Supported Platforms and Support Statushttp://my.sybase.com/detail?id=1002288

Whitepapers, TechDocs, and bug fixes are all available through the
Sybase iAnywhere pages athttp://www.sybase.com/products/databasemanagement/sqlanywhere/technic...
Version 10.0.1.3415

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



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.