dtl


// simple example for Local BCA ... reading doubles from a table

vector<double> ReadDataLocalBCASingleField()
{
    // declare our BCA locally
    // note how we bind using the COLS class to identify columns
        
    double rowbuf;  // row object used by BCA() to guide binding process
    
    DBView<double> view("DB_EXAMPLE",
        BCA(rowbuf, COLS["DOUBLE_VALUE"] >> rowbuf)
    );

    // copy the doubles from the view into the vector and return
    vector<double> results;
    copy(view.begin(), view.end(), back_inserter(results));
    return results;
}

[DTL Home]

Copyright © 2002, Michael Gradman and Corwin Joy.

Permission to use, copy, modify, distribute and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appears in all copies and that both that copyright notice and this permission notice appear in supporting documentation. Corwin Joy and Michael Gradman make no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty.

This site written using the ORB. [The ORB]

1