Results 1 to 5 of 5

Thread: query to select upstream network

  1. #1

    query to select upstream network

    I want to create a query to
    - select the upstream network of a conduit (all upstream links)
    - select all the subcatchments that go to this network
    - get the value of “population” of these subcatcments and add them all
    - fill the solution in user tekst 5 of this conduit.
    I have difficulties with step 1: select upstream network.
    Is this possible in a query ?

  2. #2

    Join Date
    Oct 2013
    Posts
    4
    I don't know if it's possible within a query, but my solution would be to use trace and select links upstream tool and then build the query from this - but I'm no SQL expert

  3. #3
    I'm this far. I now have the error "Error preparing clausule 5 : 'while$count100UPDAT SET...': SET clause must begin with the keyword SET or the keyword UPDATE. When I remove the While-wend the syntax is correct.
    Is it possible work with while-wend in Infoworks-SQL?

    UPDATE [All Nodes] SET $node_selected = 0;
    UPDATE [ALL Links] SET $link_selected = 0;
    UPDATE SELECTED SET $link_selected = 1;
    LET $count = 1;
    while $count<100
    UPDATE SET us_node.$node_selected = 1 WHERE $link_selected = 1;
    UPDATE [ALL Nodes] SET us_links.$link_selected = 1 WHERE $node_selected = 1;
    $count = $count + 1;
    wend;
    SELECT FROM [All Links] WHERE $link_selected = 1;
    SELECT FROM [All Nodes] WHERE $node_selected = 1;


  4. #4
    I've found the reason
    The SQL sequence will only work in CS v13.5 or later. The WHILE function was one of a number of SQL enhancements added at the v13.5 release

  5. #5

    Join Date
    Dec 2014
    Posts
    1
    Hi,

    Did you manage to build the complete query?
    I'm trying to write a similar one.

Tags for this Thread

Posting Permissions

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