|
Home > Archive > SQL Anywhere ultralite > August 2005 > Query error
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
| Usmanov A. 2005-08-12, 9:24 am |
| Hi.
I build UL-app(9.0.2.3131) via C++ StaticAPI under PalmOS (MW CW9)
Defined ultralite statement SKUInGroup dont work on remote database.
Text of this statement:
select sku_id
from ROSPSKU
where deleted=0
and isgroup=0
and fullpath like ?
order by seq
Code for executing in app:
bool DBM::FilterSKUByGrou
p(char* fullpath, CArray<long>& arr)
{
const char* context=StringByID(C
txFilterSKUString);
arr.DeleteAll();
long sku_id;
SKUInGroup rs;
rs.Open(&m_conn,fullpath);
if (!m_conn.LastCodeOK()) {
ShowErrorMessage(con
text);
return false;
}
while (rs.Next()){
if (rs.GetSku_id(sku_id))
arr.Add(sku_id);
}
rs.Close();
return true;
}
I see in debugger that statement was opened without errors, but recordset is
empty (rs.Next() return false)
In the same time, if this statement run in InteractiveSQL, it rerturn many
records.
If I write in statement same condition as passed in rs.Open, statement in
app also return records.
It looks as condition distort on statements open, but it is nonsense.
Any ideas?
--
Best regards,
Alex Usmanov
| |
| Usmanov A. 2005-08-12, 11:23 am |
| For table ROSPSKU was defined index:
CREATE INDEX "ListIdx" ON "DBA"."ROSPSKU" ( "deleted" ASC, "isgroup" ASC,
"fullpath" ASC, "seq" ASC ) IN "SYSTEM";
Now instead this index I created two indexes:
CREATE INDEX "ListIdx" ON "DBA"."ROSPSKU" ( "deleted" ASC, "isgroup" ASC,
"fullpath" ASC ) IN "SYSTEM";
and
CREATE INDEX "SortIdx" ON "DBA"."ROSPSKU" ( "seq" ASC ) IN "SYSTEM";
After this procedure statement in the UL-app works properly.
Can anybody explain me why? This may help me in the future.
--
Best regards,
Alex Usmanov
| |
| Michael Thode 2005-08-12, 11:23 am |
| Does it work if you take out "and fullpath like ?" ?
Mike
"Usmanov A." <alex_u@pochtamt.ru> wrote in message
news:42fcaac1@forums
-2-dub...
> Hi.
> I build UL-app(9.0.2.3131) via C++ StaticAPI under PalmOS (MW CW9)
> Defined ultralite statement SKUInGroup dont work on remote database.
> Text of this statement:
> select sku_id
> from ROSPSKU
> where deleted=0
> and isgroup=0
> and fullpath like ?
> order by seq
>
> Code for executing in app:
> bool DBM::FilterSKUByGrou
p(char* fullpath, CArray<long>& arr)
> {
> const char* context=StringByID(C
txFilterSKUString);
> arr.DeleteAll();
> long sku_id;
> SKUInGroup rs;
> rs.Open(&m_conn,fullpath);
> if (!m_conn.LastCodeOK()) {
> ShowErrorMessage(con
text);
> return false;
> }
>
> while (rs.Next()){
> if (rs.GetSku_id(sku_id))
> arr.Add(sku_id);
> }
> rs.Close();
> return true;
> }
>
> I see in debugger that statement was opened without errors, but recordset
is
> empty (rs.Next() return false)
> In the same time, if this statement run in InteractiveSQL, it rerturn
many
> records.
> If I write in statement same condition as passed in rs.Open, statement in
> app also return records.
> It looks as condition distort on statements open, but it is nonsense.
> Any ideas?
>
> --
>
> Best regards,
> Alex Usmanov
>
>
| |
| Michael Thode 2005-08-23, 11:24 am |
| I've shown your issue to our query expert, and he thinks this may be a bug.
Please open a tech support case for this.
(Sorry for the delay, much of our staff has been on vacation recently)
Mike
"Usmanov A." <alex_u@pochtamt.ru> wrote in message
news:42fcaac1@forums
-2-dub...
> Hi.
> I build UL-app(9.0.2.3131) via C++ StaticAPI under PalmOS (MW CW9)
> Defined ultralite statement SKUInGroup dont work on remote database.
> Text of this statement:
> select sku_id
> from ROSPSKU
> where deleted=0
> and isgroup=0
> and fullpath like ?
> order by seq
>
> Code for executing in app:
> bool DBM::FilterSKUByGrou
p(char* fullpath, CArray<long>& arr)
> {
> const char* context=StringByID(C
txFilterSKUString);
> arr.DeleteAll();
> long sku_id;
> SKUInGroup rs;
> rs.Open(&m_conn,fullpath);
> if (!m_conn.LastCodeOK()) {
> ShowErrorMessage(con
text);
> return false;
> }
>
> while (rs.Next()){
> if (rs.GetSku_id(sku_id))
> arr.Add(sku_id);
> }
> rs.Close();
> return true;
> }
>
> I see in debugger that statement was opened without errors, but recordset
is
> empty (rs.Next() return false)
> In the same time, if this statement run in InteractiveSQL, it rerturn
many
> records.
> If I write in statement same condition as passed in rs.Open, statement in
> app also return records.
> It looks as condition distort on statements open, but it is nonsense.
> Any ideas?
>
> --
>
> Best regards,
> Alex Usmanov
>
>
|
|
|
|
|