Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2004
    Posts
    53

    Unanswered: translating data into temp table

    Hi all

    I have this snippet of data

    hierId nodeId nodeName parentId childId
    ----------- ----------- -------------------------------------- ----------- -----------
    437 1582275 Accountants 1582270 1582275
    437 1582276 Asset financiers 1582270 1582276
    437 1582270 Banking & financial institutions NULL NULL
    437 1582286 Private banks 1582277 1582286
    437 1582277 Banks 1582270 1582277


    I want to loop through this data and put the results into a temp table so it looks like this:


    hierId nodeName ids
    ------------------------------------------------------------------------------------------------------
    437 Banking & financial institutions -> Accountants 1582270 | 1582275
    437 Banking & financial institutions -> Asset financiers 1582270 | 1582276
    437 Banking & financial institutions -> Banks 1582270 | 1582277
    437 Banking & financial institutions -> Banks -> Private banks 1582270 | 1582277 | 1582286
    437 Banking & financial institutions 1582270


    Can anyone help me with achieving this

    Thanks in advance

  2. #2
    Join Date
    Jan 2004
    Posts
    40
    you want to loop through the data, such as using a cursor/recordset/resultset?


    if you want to format it to another table, you can just insert them.

    insert into temp (select hierId + 'Banking & financial institutions' + nodeName from perm)

  3. #3
    Join Date
    Jan 2004
    Posts
    53
    Sorry to be a bit thick here, can you give me an example of using a cursor/rs etc to do this, i've tried all sorts but getting no where

    thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •