Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

while query identity field encounter a strange issue

4 posts in Cluster Last posting was on 2012-09-11 10:23:46.0Z
wangtw Posted on 2012-09-11 02:34:04.0Z
Sender: 7aa1.504e997a.1804289383@sybase.com
From: wangtw
Newsgroups: sybase.public.ase.cluster
Subject: while query identity field encounter a strange issue
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <504ea31c.7ee4.1681692777@sybase.com>
NNTP-Posting-Host: 172.20.134.41
X-Original-NNTP-Posting-Host: 172.20.134.41
Date: 10 Sep 2012 19:34:04 -0700
X-Trace: forums-1-dub 1347330844 172.20.134.41 (10 Sep 2012 19:34:04 -0700)
X-Original-Trace: 10 Sep 2012 19:34:04 -0700, 172.20.134.41
Lines: 15
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.cluster:258
Article PK: 48538

hello&#65292;all&#65306;i meet a problem while query
identity field:
Operating system&#65306;Linux Red hat 5.5&#65292;32bit
Sybase version:Ase-15-0
i has a table, it has a identity field as
field4&#65292;numeric,width 12
i use jdbc insert&#12289;query&#12289;update this
table&#65292;every oper has a single thread&#65292;one
thread batch insert record to table;one thread query, sql is
"select field1,field2,field3 from table where field4
between num1 and num1+500&#65292; num1 set to
max(field4)&#65292;my problem is in some time this query
might miss some record between num1 and num1+500&#65292;i
checked my code and log&#65292;can't find the
problem&#65292;please someone can help me&#65311;


Luc Van der Veurst Posted on 2012-09-11 09:30:57.0Z
From: "Luc Van der Veurst" <dba_azvub@hotmail.com>
Newsgroups: sybase.public.ase.cluster
References: <504ea31c.7ee4.1681692777@sybase.com>
Subject: Re: while query identity field encounter a strange issue
Lines: 25
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5931
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157
X-RFC2646: Format=Flowed; Original
X-Forwarded: by - (DeleGate/5.8.7)
X-Forwarded: by - (DeleGate/5.8.7)
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <504f04d1$1@forums-1-dub>
Date: 11 Sep 2012 02:30:57 -0700
X-Trace: forums-1-dub 1347355857 172.20.134.152 (11 Sep 2012 02:30:57 -0700)
X-Original-Trace: 11 Sep 2012 02:30:57 -0700, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.cluster:260
Article PK: 48536

And also, is this on a cluster edition of ASE ?
Please post the output of
select @@version
as well.

Luc.

<wangtw> wrote in message news:504ea31c.7ee4.1681692777@sybase.com...
> hello&#65292;all&#65306;i meet a problem while query
> identity field:
> Operating system&#65306;Linux Red hat 5.5&#65292;32bit
> Sybase version:Ase-15-0
> i has a table, it has a identity field as
> field4&#65292;numeric,width 12
> i use jdbc insert&#12289;query&#12289;update this
> table&#65292;every oper has a single thread&#65292;one
> thread batch insert record to table;one thread query, sql is
> "select field1,field2,field3 from table where field4
> between num1 and num1+500&#65292; num1 set to
> max(field4)&#65292;my problem is in some time this query
> might miss some record between num1 and num1+500&#65292;i
> checked my code and log&#65292;can't find the
> problem&#65292;please someone can help me&#65311;


wangtw Posted on 2012-09-11 10:23:46.0Z
Sender: 1e7a.504f10d1.1804289383@sybase.com
From: wangtw
Newsgroups: sybase.public.ase.cluster
Subject: Re: while query identity field encounter a strange issue
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <504f1132.1e85.1681692777@sybase.com>
References: <504f04d1$1@forums-1-dub>
NNTP-Posting-Host: 172.20.134.41
X-Original-NNTP-Posting-Host: 172.20.134.41
Date: 11 Sep 2012 03:23:46 -0700
X-Trace: forums-1-dub 1347359026 172.20.134.41 (11 Sep 2012 03:23:46 -0700)
X-Original-Trace: 11 Sep 2012 03:23:46 -0700, 172.20.134.41
Lines: 168
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.cluster:261
Article PK: 48539

thanks your replys!
ase is not cluster
select @@version output:
Adaptive Server Enterprise/15.0.3/EBF 16555 ESD#1/P/Linux
Intel/Linux 2.6.9-42.ELsmp i686/ase1503/2680/32-bit/FBO/Thu
Mar 5 04:50:21 2009

My pseudo code&#65306;
static int num1 = 0;
while(true) {
sql = "select field1,field2,field3,field4 form table where
field4 between num1 and num1+500";
resultset = db.exe(sql);
if (resultset.hasNext()) {
int maxV = 0;
while(resultset.next) {
if(resultset.getInt(4) > maxV ) {
naxV = resultset.getInt(4);
}
//other code
}
num1 = maxV + 1;
}
else {
//query min field from table
select min(field4) from table;
if (min(field4) > num1) {
num1 = min(field4);
}
}
}
in my act environment&#65292;things as follows&#65306;
in progarm query sql is "select
create_time,send_time,plan_send_time,priority,counter from
table o where ((plan_Send_Time=null and counter between
72336 and 72835))",create_time is record
created_time,send_time is record doned time,plan_send_time
is record to be process time,couner is a
identity&#65292;this sql query out 62
records&#65292;max(counter) is 72803,min(counter) is
72341&#12290;

but int the table&#65292;records are:
create_time,send_time,plan_send_time,priority,counter
2012-09-07 08:41:15.816,2012-09-07 08:41:19.273,,'1',72341
2012-09-07 08:41:15.843,2012-09-07 08:41:19.273,,'1',72347
2012-09-07 08:41:15.873,2012-09-07 08:41:19.273,,'1',72354
2012-09-07 08:41:15.89,2012-09-07 08:41:19.273,,'1',72356
2012-09-07 08:41:15.9,2012-09-07 08:41:19.273,,'1',72359
2012-09-07 08:41:15.916,2012-09-07 08:41:19.273,,'1',72363
2012-09-07 08:41:15.933,2012-09-07 08:41:19.273,,'1',72369
2012-09-07 08:41:15.97,2012-09-07 08:41:19.273,,'1',72377
2012-09-07 08:41:16.016,2012-09-07 08:41:19.273,,'1',72384
2012-09-07 08:41:16.046,2012-09-07 08:41:19.273,,'1',72392
2012-09-07 08:41:16.073,2012-09-07 08:41:19.273,,'1',72398
2012-09-07 08:41:16.116,2012-09-07 08:41:19.273,,'1',72404
2012-09-07 08:41:16.143,2012-09-07 08:41:19.273,,'1',72410
2012-09-07 08:41:16.17,2012-09-07 08:41:19.273,,'1',72417
2012-09-07 08:41:16.2,2012-09-07 08:41:19.273,,'1',72420
2012-09-07 08:41:16.226,2012-09-07 08:41:19.273,,'1',72427
2012-09-07 08:41:16.253,2012-09-07 08:41:19.273,,'1',72434
2012-09-07 08:41:16.28,2012-09-07 08:41:19.273,,'1',72440
2012-09-07 08:41:16.306,2012-09-07 08:41:19.273,,'1',72444
2012-09-07 08:41:16.326,2012-09-07 08:41:19.273,,'1',72449
2012-09-07 08:41:16.356,2012-09-07 08:41:19.273,,'1',72457
2012-09-07 08:41:16.39,2012-09-07 08:41:19.273,,'1',72461
2012-09-07 08:41:16.42,2012-09-07 08:41:19.273,,'1',72466
2012-09-07 08:41:16.446,2012-09-07 08:41:19.273,,'1',72474
2012-09-07 08:41:16.476,2012-09-07 08:41:19.27,,'1',72481
2012-09-07 08:41:16.523,2012-09-07 08:41:19.27,,'1',72489
2012-09-07 08:41:16.573,2012-09-07 08:41:19.27,,'1',72495
2012-09-07 08:41:16.6,2012-09-07 08:41:19.27,,'1',72502
2012-09-07 08:41:16.626,2012-09-07 08:41:19.273,,'1',72507
2012-09-07 08:41:16.656,2012-09-07 08:41:19.27,,'1',72511
2012-09-07 08:41:16.693,2012-09-07 08:41:19.27,,'1',72517
2012-09-07 08:41:16.733,2012-09-07 08:41:19.273,,'1',72528
2012-09-07 08:41:16.76,2012-09-07 08:41:19.27,,'1',72536
2012-09-07 08:41:16.786,2012-09-07 08:41:19.273,,'1',72541
2012-09-07 08:41:16.826,2012-09-07 08:41:19.273,,'1',72548
2012-09-07 08:41:16.853,2012-09-07 08:41:19.273,,'1',72556
2012-09-07 08:41:16.88,2012-09-07 08:41:19.273,,'1',72562
2012-09-07 08:41:16.913,2012-09-07 08:41:19.273,,'1',72563
2012-09-07 08:41:16.926,2012-09-07 08:41:19.273,,'1',72564
2012-09-07 08:41:16.956,2012-09-07 08:41:19.273,,'1',72565
2012-09-07 08:41:16.98,2012-09-07 09:15:09.54,,'1',72568
2012-09-07 08:41:17.01,2012-09-07 09:15:09.54,,'1',72575
2012-09-07 08:41:17.036,2012-09-07 09:15:09.54,,'1',72581
2012-09-07 08:41:17.073,2012-09-07 09:15:09.54,,'1',72589
2012-09-07 08:41:17.1,2012-09-07 09:15:09.54,,'1',72595
2012-09-07 08:41:17.13,2012-09-07 09:15:09.54,,'1',72601
2012-09-07 08:41:17.16,2012-09-07 09:15:09.54,,'1',72609
2012-09-07 08:41:17.186,2012-09-07 09:15:09.54,,'1',72615
2012-09-07 08:41:17.233,2012-09-07 09:15:09.54,,'1',72621
2012-09-07 08:41:17.26,2012-09-07 09:15:09.54,,'1',72627
2012-09-07 08:41:17.286,2012-09-07 09:15:09.54,,'1',72629
2012-09-07 08:41:17.316,2012-09-07 09:15:09.54,,'1',72636
2012-09-07 08:41:17.343,2012-09-07 09:15:09.54,,'1',72644
2012-09-07 08:41:17.346,2012-09-07 09:15:09.54,,'1',72646
2012-09-07 08:41:17.37,2012-09-07 09:15:09.54,,'1',72653
2012-09-07 08:41:17.396,2012-09-07 09:15:09.54,,'1',72656
2012-09-07 08:41:17.436,2012-09-07 09:15:09.54,,'1',72663
2012-09-07 08:41:17.466,2012-09-07 09:15:09.54,,'1',72671
2012-09-07 08:41:17.493,2012-09-07 08:41:19.273,,'1',72677
2012-09-07 08:41:17.536,2012-09-07 08:41:19.273,,'1',72684
2012-09-07 08:41:17.566,2012-09-07 08:41:19.273,,'1',72691
2012-09-07 08:41:17.593,2012-09-07 08:41:19.273,,'1',72698
2012-09-07 08:41:17.64,2012-09-07 08:41:19.273,,'1',72703
2012-09-07 08:41:17.666,2012-09-07 08:41:19.273,,'1',72709
2012-09-07 08:41:17.693,2012-09-07 08:41:19.273,,'1',72716
2012-09-07 08:41:17.723,2012-09-07 08:41:19.273,,'1',72721
2012-09-07 08:41:17.75,2012-09-07 08:41:19.273,,'1',72728
2012-09-07 08:41:17.776,2012-09-07 08:41:19.273,,'1',72735
2012-09-07 08:41:17.803,2012-09-07 08:41:19.273,,'1',72740
2012-09-07 08:41:17.84,2012-09-07 08:41:19.273,,'1',72747
2012-09-07 08:41:17.866,2012-09-07 08:41:19.273,,'1',72752
2012-09-07 08:41:17.896,2012-09-07 08:41:19.273,,'1',72759
2012-09-07 08:41:17.923,2012-09-07 08:41:19.273,,'1',72763
2012-09-07 08:41:17.95,2012-09-07 08:41:19.273,,'1',72770
2012-09-07 08:41:17.97,2012-09-07 08:41:19.273,,'1',72775
2012-09-07 08:41:17.976,2012-09-07 08:41:19.273,,'1',72778
2012-09-07 08:41:18.003,2012-09-07 08:41:19.273,,'1',72782
2012-09-07 08:41:18.043,2012-09-07 08:41:19.273,,'1',72789
2012-09-07 08:41:18.07,2012-09-07 08:41:19.273,,'1',72797
2012-09-07 08:41:18.096,2012-09-07 08:41:19.273,,'1',72803
2012-09-07 08:41:18.143,2012-09-07 08:41:20.466,,'1',72810
2012-09-07 08:41:18.17,2012-09-07 08:41:20.466,,'1',72817
2012-09-07 08:41:18.196,2012-09-07 08:41:20.466,,'1',72824
2012-09-07 08:41:18.246,2012-09-07 08:41:20.466,,'1',72831

counter from 72568 to 72671 are missed records&#65292;They
had processed when i restart my program&#65292;the send_time
is 2012-09-07 09:15:09.
becourse my english is poor&#65292;please forgive me!
thands!

> And also, is this on a cluster edition of ASE ?
> Please post the output of
> select @@version
> as well.
>
> Luc.
>
> <wangtw> wrote in message
> > news:504ea31c.7ee4.1681692777@sybase.com...
hello&#65292;
> > ;all&#65306;i meet a problem while query identity field:
> > Operating system&#65306;Linux Red hat 5.5&#65292;32bit
> > Sybase version:Ase-15-0
> > i has a table, it has a identity field as
> > field4&#65292;numeric,width 12
> > i use jdbc insert&#12289;query&#12289;update this
> > table&#65292;every oper has a single thread&#65292;one
> > thread batch insert record to table;one thread query,
> > sql is "select field1,field2,field3 from table where
> > field4 between num1 and num1+500&#65292; num1 set to
> > max(field4)&#65292;my problem is in some time this query
> > might miss some record between num1 and
> > num1+500&#65292;i checked my code and log&#65292;can't
> > find the problem&#65292;please someone can help
> me&#65311;
>
>


Luc Van der Veurst Posted on 2012-09-11 09:18:06.0Z
From: "Luc Van der Veurst" <dba_azvub@hotmail.com>
Newsgroups: sybase.public.ase.cluster
References: <504ea31c.7ee4.1681692777@sybase.com>
Subject: Re: while query identity field encounter a strange issue
Lines: 27
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5931
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157
X-RFC2646: Format=Flowed; Original
X-Forwarded: by - (DeleGate/5.8.7)
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <504f01ce$1@forums-1-dub>
Date: 11 Sep 2012 02:18:06 -0700
X-Trace: forums-1-dub 1347355086 172.20.134.152 (11 Sep 2012 02:18:06 -0700)
X-Original-Trace: 11 Sep 2012 02:18:06 -0700, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.cluster:259
Article PK: 48537


<wangtw> wrote in message news:504ea31c.7ee4.1681692777@sybase.com...
> hello&#65292;all&#65306;i meet a problem while query
> identity field:
> Operating system&#65306;Linux Red hat 5.5&#65292;32bit
> Sybase version:Ase-15-0
> i has a table, it has a identity field as
> field4&#65292;numeric,width 12
> i use jdbc insert&#12289;query&#12289;update this
> table&#65292;every oper has a single thread&#65292;one
> thread batch insert record to table;one thread query, sql is
> "select field1,field2,field3 from table where field4
> between num1 and num1+500&#65292; num1 set to
> max(field4)&#65292;my problem is in some time this query
> might miss some record between num1 and num1+500&#65292;i
> checked my code and log&#65292;can't find the
> problem&#65292;please someone can help me&#65311;

You say that num1 is set to max(field4), but from the looks of the
query, num1 is a column of table 'table'. I think it's best to describe
your problem with the exact code and also give an example of
a query and a row that seems to be missing.

Luc.