Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 816973
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T01:55:16+00:00 2026-05-15T01:55:16+00:00

I need to create a configuration file from a data file that looks as

  • 0

I need to create a configuration file from a data file that looks as follows:

MAN1_TIME '01-JAN-2010 00:00:00.0000 UTC'
MAN1_RX 123.45
MAN1_RY 123.45
MAN1_RZ 123.45
MAN1_NEXT 'MAN2'
MAN2_TIME '01-MAR-2010 00:00:00.0000 UTC'
MAN2_RX 123.45
[...]
MAN2_NEXT 'MANX'
[...]
MANX_TIME [...]

This file describes different “legs” of a trajectory. In this case, MAN1 is chained to MAN2, and MAN2 to MANX. In the original file, the chains are not as obvious (i.e., they are non-sequential).

I’ve managed to read the file and store in an Sqlite3 database (I’m using the Python interface). The table is stored with three columns: Id, Par, and Val; for instance, Id='MAN1', Par='RX', and Val='123.45'.

I’m interested in querying such database for obtaining the information related to ‘n’ legs. In English, that would be:

"Select RX,RY,RZ for the next five legs starting on MAN1"

So the query would go to MAN1, retrieve RX, RY, RZ, then read the parameter NEXT and go to that Id, retrieve RX, RY, RZ; read the parameter NEXT; go to that one … like this five times.

How can I pass such query with “dynamic parameters”?

Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T01:55:16+00:00Added an answer on May 15, 2026 at 1:55 am

    I found the answer to my own question in the SQLAlchemy website. From the documentation:

    The adjacency list pattern is a common
    relational pattern whereby a table
    contains a foreign key reference to
    itself. This is the most common and
    simple way to represent hierarchical
    data in flat tables. The other way is
    the “nested sets” model, sometimes
    called “modified preorder”. Despite
    what many online articles say about
    modified preorder, the adjacency list
    model is probably the most appropriate
    pattern for the large majority of
    hierarchical storage needs, for
    reasons of concurrency, reduced
    complexity, and that modified preorder
    has little advantage over an
    application which can fully load
    subtrees into the application space.

    SQLAlchemy commonly refers to an
    adjacency list relationship as a
    self-referential mapper. In this
    example, we’ll work with a single
    table called treenodes to represent a
    tree structure:

    A graph such as the following:

    root --+---> child1
           +---> child2 --+--> subchild1
           |              +--> subchild2
           +---> child3
    

    Would be represented with data such as:

    id       parent_id     data
    ---      -------       ----
    1        NULL          root
    2        1             child1
    3        1             child2
    4        3             subchild1
    5        3             subchild2
    6        1             child3
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a need to build a website and several DLLs that it references
I have a project ongoing at the moment which is create a Windows Service
I have wcf client. It uses .NET 3.5. When I compile the client I
I'd like to set up a publisher-subscriber based communication protocol between a server producing
Simple issue, actually. Just curious if others recognize the problem and perhaps have a
I can't see to wrap my head creating an ssh key for GitHub. I
Background: I’ve inherited a project, about 10k loc implementing an odbc driver. To configure
I've been plowing through tutorials all day trying to install RMagick, and have gotten
Windows XP. Ruby 1.9.2. Rails installed. MySQL installed. When I try to run gem
I want to run my new web application with forms authentication under the ASP.NET

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.