Home > Archive > Getting Started with dBASE > July 2005 > using DISTINCT in a select statement









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]

 

Author using DISTINCT in a select statement
John Marshall

2005-07-02, 8:23 pm


When using SQL server I get an error 'Table is read only' when I try the following statement:

Select Distinct invoicenumber, postdate from invoice

if I leave off the distinct, it works. What I want to happen is that it eliminates the duplicates. BTW, the table is set up as read/write in the BDE.

Thanks,

JM
John Marshall

2005-07-02, 8:23 pm

One more note: I am able to use this distict statement in a sql file by itself. The intended use is to select distinct invoice numbers from a purchase file and have a second query on the same db that shows the line items (via master roset).


John Marshall Wrote:

>
> When using SQL server I get an error 'Table is read only' when I try the following statement:
>
> Select Distinct invoicenumber, postdate from invoice
>
> if I leave off the distinct, it works. What I want to happen is that it eliminates the duplicates. BTW, the table is set up as read/write in the BDE.
>
> Thanks,
>
> JM


Ken Mayer [dBVIPS]

2005-07-03, 11:23 am

John Marshall wrote:
> When using SQL server I get an error 'Table is read only' when I try the following statement:
>
> Select Distinct invoicenumber, postdate from invoice
>
> if I leave off the distinct, it works. What I want to happen is that it eliminates the duplicates. BTW, the table is set up as read/write in the BDE.


There are many options that cause read-only rowsets, distinct is one of
them.

Ken

--
/(Opinions expressed are purely my own, not those of dataBased
Intelligence, Inc.)/

*Ken Mayer* [dBVIPS]
/Golden Stag Productions/
dBASE at goldenstag dot net
http://www.goldenstag.net/GSP
http://www.goldenstag.net/dbase
John Marshall

2005-07-04, 7:23 am

Yes, but shouldn't it still read the data? This app is a display only ... All I want to do is to gather a list of invoices from a transaction file without duplicates (and prefereably without writingto a new file). I thought that distict was an option.

JM


Ken Mayer [dBVIPS] Wrote:

> John Marshall wrote:
>
> There are many options that cause read-only rowsets, distinct is one of
> them.
>
> Ken
>
> --
> /(Opinions expressed are purely my own, not those of dataBased
> Intelligence, Inc.)/
>
> *Ken Mayer* [dBVIPS]
> /Golden Stag Productions/
> dBASE at goldenstag dot net
> http://www.goldenstag.net/GSP
> http://www.goldenstag.net/dbase


Ken Mayer [dBVIPS]

2005-07-04, 1:23 pm

John Marshall wrote:
> Yes, but shouldn't it still read the data? This app is a display only ... All I want to do is to gather a list of invoices from a transaction file without duplicates (and prefereably without writingto a new file). I thought that distict was an option.



It should read and display the data. I don't know what the issue is, I
guess.

Ken

--
/(Opinions expressed are purely my own, not those of dataBased
Intelligence, Inc.)/

*Ken Mayer* [dBVIPS]
/Golden Stag Productions/
dBASE at goldenstag dot net
http://www.goldenstag.net/GSP
http://www.goldenstag.net/dbase
Roland Wingerter

2005-07-05, 3:23 am

John Marshall wrote:
> Yes, but shouldn't it still read the data? This app is a display
> only ... All I want to do is to gather a list of invoices from a
> transaction file without duplicates (and prefereably without
> writingto a new file). I thought that distict was an option.

------
Ask again in the sql-servers newsgroup, I expect someone will be able to
help.

Roland


David Kerber

2005-07-05, 1:23 pm

In article <5SwMRMJgFHA.1756@news-server>,
john. marshall@mainstreetp
rinceton.com says...
> Yes, but shouldn't it still read the data? This app is a display only ... All I want to do is to gather a list of invoices from a transaction file without duplicates (and prefereably without writingto a new file). I thought that distict was an option.


>


It will display the data just fine if you set the .requestlive property
to false. With it set to true (the default), you are telling it to give
you an updateable rowset, and when it cannot do so, it is erroring off.

....

--
Remove the ns_ from if replying by e-mail (but keep posts in the
newsgroups if possible).
Nianxin Zhang

2005-07-05, 8:23 pm

David Kerber Wrote:

> In article <5SwMRMJgFHA.1756@news-server>,
> john. marshall@mainstreetp
rinceton.com says...
n.[color=darkred]
>
> It will display the data just fine if you set the .requestlive property
> to false. With it set to true (the default), you are telling it to give
> you an updateable rowset, and when it cannot do so, it is erroring off.
>
> ...
>
> --
> Remove the ns_ from if replying by e-mail (but keep posts in the
> newsgroups if possible).



In fact when joining the tables in the query we will get same error. Set query property requestLive will solve this kind of problem.
Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com