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.

CreateQuery Question

2 posts in General Discussion (old) Last posting was on 2000-02-17 14:00:03.0Z
Jerry Leckness Posted on 2000-02-16 11:39:42.0Z
Newsgroups: sybase.public.easerver
From: "Jerry Leckness" <jleckness@protective.com>
Subject: CreateQuery Question
Date: Wed, 16 Feb 2000 05:39:42 -0600
Lines: 10
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2314.1300
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
NNTP-Posting-Host: proxy2.protective.com 204.17.150.155
Message-ID: <347_Ujk7RfNe$GA.332@forums.sybase.com>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.easerver:28535
Article PK: 160680

When you use the following:

connection.CreateQuery("select * from product")

Is the result set returned to the browser?


Michael F. Nicewarner [TeamSybase] Posted on 2000-02-17 14:00:03.0Z
Newsgroups: sybase.public.easerver
From: "Michael F. Nicewarner [TeamSybase]" <mike.nicewarner@ibpinc.com>
Subject: Re: CreateQuery Question
Date: Thu, 17 Feb 2000 08:00:03 -0600
Lines: 58
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2314.1300
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
NNTP-Posting-Host: secure.ibpinc.com 198.133.192.2
Message-ID: <347_khYRe$Ue$GA.332@forums.sybase.com>
References: <347_Ujk7RfNe$GA.332@forums.sybase.com>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.easerver:28519
Article PK: 160668

Not by itself. You have to handle the records. For instance:
myQuery.CreateQuery('select * from myTable where myKey = 1234 order by 1');
if (myQuery.GetEmpty())
document.writeln('No data was found.<br>');
else
{
document.writeln('<table border=1><tr valign="bottom">');
// Write out table header <TH> line
document.writeln('<th>myKey<th>Col2<th>Col3<th>Col4');
do
{
document.writeln('<tr>');
document.writeln('<td>' + myQuery.GetValue(1));
document.write('<td><nobr>');
t = myQuery.GetValue(5);
switch (t)
{ case 'CHAR':
document.write(t + '(' + myQuery.GetValue(6) + ')');
break;
case 'DECIMAL':
document.write(t + '(' + myQuery.GetValue(6) + ',' +
myQuery.GetValue(7) + ')');
break;
}
document.writeln('<td>' + (myQuery.GetValue(8)=='Y'?'Yes':'No'));
document.writeln('<td>' + myQuery.GetValue(21));
} while (myQuery.MoveNext())
document.writeln('</table>');
}

You dynamically build the table to display the results of the query. Note
the DO {} WHILE loop with the MoveNext() method. That cycles through the
entire resultset. You have very fine control over how the data is handled
with PowerDynamo commands.

Does this help?

--

Michael F. Nicewarner [TeamSybase]
mailto:mike.nicewarner@ibpinc.com
http://www.datamodel.org

Jerry Leckness <jleckness@protective.com> wrote in message
news:Ujk7RfNe$GA.332@forums.sybase.com...
> When you use the following:
>
> connection.CreateQuery("select * from product")
>
> Is the result set returned to the browser?
>
>
>
>
>