Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.databases.ms-sqlserver > #1258

Re: SQL Cursors

Received by 10.224.27.14 with SMTP id g14mr501856qac.1.1346889519872; Wed, 05 Sep 2012 16:58:39 -0700 (PDT)
Received by 10.52.72.16 with SMTP id z16mr28119vdu.15.1346889519852; Wed, 05 Sep 2012 16:58:39 -0700 (PDT)
Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!b19no38822qas.0!news-out.google.com!da15ni51772qab.0!nntp.google.com!b19no38821qas.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups comp.databases.ms-sqlserver
Date Wed, 5 Sep 2012 16:58:39 -0700 (PDT)
In-Reply-To <k28krp$omu$1@dont-email.me>
Complaints-To groups-abuse@google.com
Injection-Info glegroupsg2000goo.googlegroups.com; posting-host=92.40.104.75; posting-account=dELd-gkAAABehNzDMBP4sfQElk2tFztP
NNTP-Posting-Host 92.40.104.75
References <k24s53$1ph$1@news.newsland.it> <k2577t$kqr$1@dont-email.me> <k26rme$tgn$1@adenine.netfront.net> <k278v1$sq0$1@dont-email.me> <k27bci$19h8$1@adenine.netfront.net> <k27e25$o1o$1@dont-email.me> <b8a56d24-3706-4798-a7b9-c382a1d96557@googlegroups.com> <k28krp$omu$1@dont-email.me>
User-Agent G2/1.0
MIME-Version 1.0
Message-ID <3dbc1b4a-df8a-44f7-a50c-490c1b8c5ad5@googlegroups.com> (permalink)
Subject Re: SQL Cursors
From rja.carnegie@gmail.com
Injection-Date Wed, 05 Sep 2012 23:58:39 +0000
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding quoted-printable
Xref csiph.com comp.databases.ms-sqlserver:1258

Show key headers only | View raw


On Wednesday, September 5, 2012 11:59:01 PM UTC+1, Bob Barrows wrote:
> rja.carnegie@gmail.com wrote:
> 
> > Of course you assumed that the ranking column [num] runs 1, 2, 3, 4,
> > 5, ... with no numbers missing or duplicated.
> 
> I could only go by the data offered.

Yes.  I continue to say that ranking can get funny.

> >  Otherwise, reviving
> > the question of a cursor looks good to me......
> 
> Why? What would it solve, and how?

You could run throu‰gh the table, storing the value from each row in a
variable and using it to calculate the new value to set in the next row.
Some catches in ranking can be easily avoided, and the programmer 
who asked the question apparently is cursor-minded.  That's usually 
seen as a lack, but for now, they would be getting a program design
that they understand instead of a mysterious magic spell.  ;-)

Whatever works and the language allows - after that, you're just 
putting on polish.  (Although there are reasons, such as having a 
program be clear, modifiable, extendable, acceptably fast...)

Back to comp.databases.ms-sqlserver | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

SQL Cursors simisa@tiscalinet.it (simisa) - 2012-09-04 14:29 +0200
  Re: SQL Cursors "Bob Barrows" <reb01501@NOyahooSPAM.com> - 2012-09-04 11:27 -0400
    Re: SQL Cursors sim <simisa@tiscalinet.it> - 2012-09-05 08:32 +0200
      Re: SQL Cursors "Bob Barrows" <reb01501@NOSPAMyahoo.com> - 2012-09-05 06:18 -0400
        Re: SQL Cursors sim <simisa@tiscalinet.it> - 2012-09-05 13:00 +0200
          Re: SQL Cursors "Bob Barrows" <reb01501@NOSPAMyahoo.com> - 2012-09-05 07:45 -0400
            Re: SQL Cursors sim <simisa@tiscalinet.it> - 2012-09-05 18:19 +0200
            Re: SQL Cursors rja.carnegie@gmail.com - 2012-09-05 15:36 -0700
              Re: SQL Cursors "Bob Barrows" <reb01501@NOSPAMyahoo.com> - 2012-09-05 18:44 -0400
                Re: SQL Cursors rja.carnegie@gmail.com - 2012-09-05 16:58 -0700
                Re: SQL Cursors Gene Wirchenko <genew@ocis.net> - 2012-09-05 17:23 -0700
                Re: SQL Cursors rja.carnegie@gmail.com - 2012-09-06 02:50 -0700
              Re: SQL Cursors "Bob Barrows" <reb01501@NOSPAMyahoo.com> - 2012-09-05 18:44 -0400
                Re: SQL Cursors sim <simisa@tiscalinet.it> - 2012-09-06 09:37 +0200

csiph-web