Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. Recursion

Recursion

Scheduled Pinned Locked Moved The Lounge
16 Posts 9 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Preyatham

    did anyone try writing a recusion procedure without using recursion priciple.....also do not use cursors...any luck, do let me know ;)

    bzinez

    M Offline
    M Offline
    Marc Clifton
    wrote on last edited by
    #5

    Preyatham wrote:

    did anyone try writing a recusion procedure without using recursion priciple.....also do not use cursors...

    Sure. You just need a big enough hammer, and *splat* everything breaks up into nice small chuncks. Marc

    Thyme In The Country Interacx My Blog

    P 1 Reply Last reply
    0
    • C Colin Angus Mackay

      Have you tried this?[^] :-D

      Upcoming FREE developer events: * Developer Day Scotland Recent blog posts: * The Value of Smaller Methods * Creating Many-to-Many joins My website | blog

      P Offline
      P Offline
      Preyatham
      wrote on last edited by
      #6

      yeah i tried this for a requirement and successfull..and i am just trying to make it generic so that i can publish here.....

      bzinez

      1 Reply Last reply
      0
      • M Maximilien

        Preyatham wrote:

        also do not use cursors

        what does that mean ? anyway, if I remember correctly, one can transform a recursive function to a iterative function; is that what you mean ?

        Maximilien Lincourt Your Head A Splode - Strong Bad

        P Offline
        P Offline
        Preyatham
        wrote on last edited by
        #7

        firstly i am talking in sql and not in any other technology... see here is the exact question...write a procedure in which you need to display all direct reports of you..if you do not have a direct report then go for your manager and list his direct reports...write this proc without recursion and without using cursors in the procedure....

        bzinez

        1 Reply Last reply
        0
        • P Preyatham

          did anyone try writing a recusion procedure without using recursion priciple.....also do not use cursors...any luck, do let me know ;)

          bzinez

          C Offline
          C Offline
          Chris Austin
          wrote on last edited by
          #8

          I am so glad I don't do this boring stuff anymore.

          A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for insects. - -Lazarus Long

          P 1 Reply Last reply
          0
          • P Preyatham

            did anyone try writing a recusion procedure without using recursion priciple.....also do not use cursors...any luck, do let me know ;)

            bzinez

            S Offline
            S Offline
            SuperJdynamite
            wrote on last edited by
            #9

            What you're looking for is "Common Table Expressions" -- a query type introduced in SQL Server 2005.

            P 1 Reply Last reply
            0
            • C Chris Austin

              I am so glad I don't do this boring stuff anymore.

              A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for insects. - -Lazarus Long

              P Offline
              P Offline
              Preyatham
              wrote on last edited by
              #10

              i too thought this was a boring stuff..but when started to work for this, it pissed me....once i make a generic procedure i will publish here to take your comments CEO...:)

              Preyatham

              C 1 Reply Last reply
              0
              • S SuperJdynamite

                What you're looking for is "Common Table Expressions" -- a query type introduced in SQL Server 2005.

                P Offline
                P Offline
                Preyatham
                wrote on last edited by
                #11

                I dont know "Common Table Expression". But my intension is to write such a most wanted procedure using only loops and developer friendly with no complexities :-D ....

                Preyatham

                S 1 Reply Last reply
                0
                • M Marc Clifton

                  Preyatham wrote:

                  did anyone try writing a recusion procedure without using recursion priciple.....also do not use cursors...

                  Sure. You just need a big enough hammer, and *splat* everything breaks up into nice small chuncks. Marc

                  Thyme In The Country Interacx My Blog

                  P Offline
                  P Offline
                  Preyatham
                  wrote on last edited by
                  #12

                  hahahaha...will do that..:)

                  Preyatham

                  1 Reply Last reply
                  0
                  • P Preyatham

                    I dont know "Common Table Expression". But my intension is to write such a most wanted procedure using only loops and developer friendly with no complexities :-D ....

                    Preyatham

                    S Offline
                    S Offline
                    SuperJdynamite
                    wrote on last edited by
                    #13

                    "I dont know "Common Table Expression"." It was tacitly implied that you should Google it and learn more about it. "But my intension is to write such a most wanted procedure using only loops" SQL + loops = terrible idea.

                    1 Reply Last reply
                    0
                    • C Colin Angus Mackay

                      Have you tried this?[^] :-D

                      Upcoming FREE developer events: * Developer Day Scotland Recent blog posts: * The Value of Smaller Methods * Creating Many-to-Many joins My website | blog

                      Mike HankeyM Offline
                      Mike HankeyM Offline
                      Mike Hankey
                      wrote on last edited by
                      #14

                      Good eye! :laugh: :laugh: :laugh: Mike

                      Life is not measured by the number of breaths we take, but by the moments that take our breath away. "George Carlin

                      Semper Fi http://www.hq4thmarinescomm.com[^]

                      1 Reply Last reply
                      0
                      • P Preyatham

                        i too thought this was a boring stuff..but when started to work for this, it pissed me....once i make a generic procedure i will publish here to take your comments CEO...:)

                        Preyatham

                        C Offline
                        C Offline
                        Chris Austin
                        wrote on last edited by
                        #15

                        Preyatham wrote:

                        .once i make a generic procedure i will publish here

                        Thats a great approach. Peer review is great way to improve your skills.

                        Preyatham wrote:

                        i too thought this was a boring stuff..but when started to work for this, it pissed me

                        Same for me. Nothing annoyed me more that working with SQL.

                        Preyatham wrote:

                        o take your comments CEO..

                        It's CPs closest description to what I do. I own and run 3 businesses, and do all I can to avoid extra work. :laugh:

                        A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for insects. - -Lazarus Long

                        1 Reply Last reply
                        0
                        • C Colin Angus Mackay

                          Have you tried this?[^] :-D

                          Upcoming FREE developer events: * Developer Day Scotland Recent blog posts: * The Value of Smaller Methods * Creating Many-to-Many joins My website | blog

                          G Offline
                          G Offline
                          Garth J Lancaster
                          wrote on last edited by
                          #16

                          I think the subtlness of that was lost !!! - I was thinking of replying with the saying 'to first understand recursion you must understand recursion' and hit your link, which illustrates it nicely - snicker :-) 'g'

                          1 Reply Last reply
                          0
                          Reply
                          • Reply as topic
                          Log in to reply
                          • Oldest to Newest
                          • Newest to Oldest
                          • Most Votes


                          • Login

                          • Don't have an account? Register

                          • Login or register to search.
                          • First post
                            Last post
                          0
                          • Categories
                          • Recent
                          • Tags
                          • Popular
                          • World
                          • Users
                          • Groups