Using COUNT DISTINCT

Using PGNP with Microsoft .NET

Using COUNT DISTINCT

Postby paulsk » Wed Apr 15, 2009 7:19 am

[PGNP32-1.2.8.1110 with .NET 2.0]

I am using the following SQL:

SELECT COUNT(DISTINCT GroupID) AS count FROM MyTable

but i am getting a System.NullReferenceException being thrown when the SQL is executed. I can't see what could be wrong with the SQL, especially since this same SQL is used successfully for Oracle and SqlServer.
paulsk
 
Posts: 8
Joined: Wed Apr 15, 2009 4:42 am

Re: Using COUNT DISTINCT

Postby Moderator » Wed Apr 15, 2009 9:30 am

We were unable to reproduce the bug. We used the following code:
Code: Select all
dbcmd = new OleDbCommand("select count(distinct id) from testtbl", dbcon);
Console.WriteLine("Count: {0}", dbcmd.ExecuteScalar());


The returned value is Int64. Could you send the table definition and the fragment of code that executes the query?
User avatar
Moderator
Site Admin
 
Posts: 317
Joined: Wed Oct 29, 2008 11:27 pm

Re: Using COUNT DISTINCT

Postby paulsk » Thu Apr 16, 2009 12:56 am

My code snippet is this.

Code: Select all
    System.Data.OleDb.OleDbConnection con = new System.Data.OleDb.OleDbConnection("db-connection-string")
    System.Data.OleDb.OleDbCommand stmt = con.CreateCommand();
    stmt.CommandText = "SELECT COUNT(DISTINCT GroupID) AS count FROM MyTable";
    System.Data.OleDb.OleDbDataReader rs = stmt.ExecuteReader();


I have also found the source of my problem :D, it is the
Code: Select all
AS count
part of the SQL. When this is removed I can use either ExecuteReader() or ExecuteScalar() okay.

It is worth noting that my SQL snippet is used okay for Oracle and Sqlserver with .NET, and also with Oracle, Sqlserver and Postgres with Java. Any thoughts as to why it will not work with your driver?
paulsk
 
Posts: 8
Joined: Wed Apr 15, 2009 4:42 am

Re: Using COUNT DISTINCT

Postby Moderator » Thu Apr 16, 2009 11:52 pm

There was a bug in <select_element> production rule definition. We have extended the rule to allow COUNT and some other words in the column alias.

We'll publish the fix in the next release of the provider. Please PM or e-mail us if you need the fix immediately.

Thank you for the good catch!
User avatar
Moderator
Site Admin
 
Posts: 317
Joined: Wed Oct 29, 2008 11:27 pm

Re: Using COUNT DISTINCT

Postby paulsk » Fri Apr 17, 2009 12:24 am

I have worked around this issue so an immediate fix is not necessary. When will 1.3 be released?
paulsk
 
Posts: 8
Joined: Wed Apr 15, 2009 4:42 am

Re: Using COUNT DISTINCT

Postby Moderator » Mon Apr 20, 2009 12:13 am

We are trying to determine the approximate release date. Most likely it will be middle of Summer 2009.
User avatar
Moderator
Site Admin
 
Posts: 317
Joined: Wed Oct 29, 2008 11:27 pm

All Online four card keno game king

Postby Macexek » Fri Mar 13, 2015 10:56 am

Her eyes then lit on Van Helsing and on me too, and gladdened.
celebrex buy buy mevacor The invalid was suffering with acute pain in the region of the heart, and breathed with great difficulty, having all the ordinary symptoms of asthma. buy online renova altace buy Yet her features were not of that regular mould which we have been falsely taught to worship in the classical labors of the heathen. cheap tegretol buy lamictal online She kissed his face and held it between her hands.
cheap sporanox buy online xenical There must be no chance lost, and in Varna we must be ready to act the instant when that ship arrives. buy online exelon It seemed so funny to hear you order me about, as if I were a bad child! I had asked him, it will be remembered, if he still slept. mestinon buy online buy cheap xylocaine cheap bactrim
buy sporanox online order sporanox As a result, nothing was going to be too good for them. sustiva buy online celebrex buy Yes, boss, said the driver, and Bond noticed the alacrity with which he took the knife and knelt on the floor to unstrap the ball-pocket of the golf bag. buy cheap duphaston order mobic Were it later-for example, were it the year of our Lord eighteen hundred and forty-five, we should be deprived of this extraordinary spectacle.
buy trental online buy cialis online The state of the room and of the bodies was described by this witness as we described them yesterday. cymbalta buy Lucy this morning had gone back a bit. It would be wise to expect that the medicine inside would be of the bitterest. xenical buy diflucan buy buy online deltasone
cheap cleocin deltasone buy online True, I know the grammar and the words, but yet I know not how to speak them. mestinon buy buy online maxalt Thats why I was so suspicious of you when I found you on my beach. cheap rocaltrol vepesid buy We beg, with regard to the desire of your Lordship, expressed by Mr.
buy cheap cyclogyl buy pyridium Least of all, could it have been that my fancy, shaken from its half slumber, had mistaken the head for that of a living person. buy cheap bactrim For a time this would be fun. And thus, the thicket of the Barriere du Roule having been already suspected, the idea of placing the articles where they were found, might have been naturally entertained. buy hyzaar online buy altace online buy cheap estrace
buy cheap requip cheap levitra Thank God for that mercy at all events, though the proving it has been dreadful. order micardis cheap vibramycin The blush that rose to my own cheeks somehow set us both at ease, for it was a tacit answer to her own. buy danocrine buy advair online Bond took out his knife and the lighter and threw off the kimono.
buy cheap maxalt cheap bystolic Youre a real friend, said he. buy xylocaine It was the girl who had got him there. I can send for it some other time. buy online diovan buy online propecia crixivan buy
buy risperdal online cheap nizoral My friends, this is much, it is a terrible task that we undertake, and there may be consequence to make the brave shudder. order vibramycin mellaril buy How would you like to breakfast on an elephant? cheap lithobid cheap evista She said with synthetic charm, Thank you, gentlemen.
lotemax buy mellaril buy online I should much like to see him, and especial when his mind is disturbed. order bactrim Pooh looked after her as she went. Now, it is expected that the Casino at Royale will see the highest gambling in Europe this summer. buy ocuflox order amaryl buy elavil
buy cheap indocin order requip The tiny field of hairs bent gently. vepesid buy cheap lexapro There was a plate of sandwiches and a Thermos full of coffee beside the turned-down bed. buy renova parlodel buy online I must go and get ready to play croquet with the Queen, and she hurried out of the room.
buy cheap lexapro buy online premarin I may have no right to make it. order glucophage Donovan Grant was the result of a midnight union between a German professional weight-lifter and a Southern Irish waitress. We ride to death of some one. buy cheap sinequan noroxin buy zestril buy
zofran buy minocin buy online Now, if it were my design to return at all-if I had in contemplation merely a stroll with the individual in question-it would not be my policy to bid St. buy deltasone buy cheap boniva In Texas even the fleas are so rich they can hire themselves dogs. buy nizoral online buy sustiva Endeavour at all costs hold substitute carrier ascertain if operations endangered eliminate him and report.
buy cheap evista buy biaxin And your police, they would interfere, would they not? inderal buy online What the hell was it doing now? During the whole of the day I continued to near the ice. order ocuflox buy amaryl cheap requip
buy cheap aricept buy lotemax The other players were leaving their seats. order renova zofran buy online When they dismiss the men, which shall be shortly, they shall themselves look after the horses. buy zyprexa online pyridium buy Here is some dual life that is not as the common.
cleocin buy buy online topamax There was a loud blast as of many trumpets! buy crixivan online They swooped down quietly through the soft singing dusk into Kingston and turned to the left along the harbour side. Can it be that there is a malign influence of the sun at periods which affects certain natures, as at times the moon does others? cheap requip buy online zithromax order desyrel
buy cheap altace biaxin buy online There was also an electric razor, Lentheric aftershave lotion, and two nylon hairbrushes and combs. buy cheap aricept buy online urispas When he got to the place on the mountainside, what would he find? buy online renagel buy cheap atarax The man brought it up to his lips.
buy periactin buy cheap viagra Well, she succeeded somewhat, for, though sympathy cant alter facts, it can make them more bearable. order nexium Or a piece of a honeycomb, said Pooh, so as not to waste too much. Because in the struggle which we have before us to rid the earth of this terrible monster we must have all the knowledge and all the help which we can get. buy online moduretic buy cheap aristocort zofran buy
buy prograf online buy online moduretic He continued, The second of these considerations also applies to the girl. propecia buy online buy online noroxin He had been able to retain his self-command whilst the poor lady was present, for he knew her state and how mischievous a shock would be. cheap effexor buy cheap alesse There was something Dali-esque about the eyebrows, which were fine and black, and sharply upswept as if they had been painted on as makeup for a conjurer.
buy online singulair hyzaar buy His brow was of the coldness of ice. cheap combivir In a louder, prouder voice the chef de partie took up the cry, hoping to draw big money away from the neighbouring chemin? Having reached his closet, I noiselessly entered, leaving the lamp, with a shade over it, on the outside. buy cheap propecia buy flomax online cheap xenical
buy prograf online buy coumadin online And, with a final smile which embraced them both, he moved to another table. buy online minocin cyclogyl buy online Therefore cease to regard that sea, and give your whole attention to the mass of houses that lie beneath us. cheap mevacor nizoral buy online Thats a good idea, said Pooh, and he got to work too.
buy effexor online buy online alesse One day Ill try and return the compliment. buy arcoxia online Why had this particular clump been burned? It had been locked after I left the Count. atarax buy phoslo buy crixivan buy online
buy mobic online buy mestinon He will say it again, said Pooh, and I shall go on humming. cytotec buy cheap ocuflox Christopher Robin shook his head again. prograf buy online buy bystolic Hang on to life like youve hung on to the knife between your teeth.
buy nolvadex cheap feldene Indeed, I am writing now, with my book on my knee, and listening to the talk of three old men who are sitting beside me. buy cheap flagyl But out of this our cloud upon the precipices edge, there grows into palpability, a shape, far more terrible than any genius or any demon of a tale, and yet it is but a thought, although a fearful one, and one which chills the very marrow of our bones with the fierceness of the delight of its horror. I mean that it oppresses us both. buy online stromectol cheap lopressor buy online naprosyn
cheap lamictal bactrim buy online They must have been on to you for several days before you arrived. danocrine buy online amaryl buy So he has a very slight advantage over me. order minocin tofranil buy Cheerful start to flying the Atlantic, reflected Bond, and then they were all walking across the tarmac and up into the big Boeing and, with a burst of oil and metanol smoke, the engines fired one by one.
zetia buy boniva buy online God keep me, if only for the sake of those dear to me! vibramycin buy online The Greek, after taking a third card, could achieve no better than a four to the banks seven. When I came in view again the cloud had passed, and the moonlight struck so brilliantly that I could see Lucy half reclining with her head lying over the back of the seat. cheap viagra cleocin buy online buy online topamaxgeodon buycheap ataraxbuy sporanoxbuy actoplus onlinebuy cheap urispasbuy topamax onlineorder duphastonbuy evista onlineorder nolvadexcheap nexium
Macexek
 
Posts: 61
Joined: Fri Mar 13, 2015 1:04 am


Return to .NET

Who is online

Users browsing this forum: No registered users and 1 guest

cron