void AddNodesFromDB_bn ( dbmgr_cs*  dbmgr,   net_bn*  net,   const char*  column_names,   const char*  tables,   const char*  condition,   const char*  options )

Adds new nodes to net corresponding to variables in the database given by dbmgr (see NewDBManager_cs), if they aren't there already.

For more information on column_names, tables and condition, see AddDBCasesToCaseset_cs.

options may be "favor_discrete" or "favor_continuous" to control whether to add discrete nodes or continuous nodes for questionable database columns.

This function behaves similarly to the Netica Application menu choice Cases -> Add Case File Nodes. You may want to experiment with that before using this function in your code.


Versions 3.22 and later have this function.

See also:

NewDBManager_cs    Creates the dbmgr_cs
ExecuteDBSql_cs    Execute an arbitrary SQL command
InsertFindingsIntoDB_bn    Insert net findings using SQL INSERT
AddDBCasesToCaseset_cs    Retrieve a set of cases using SQL SELECT


// Create a net with two discrete nodes and whatever states are present in the result-set
// retrieved for the two corresponding columns from Table1 in the the database.
// The column names are "Sex" and "Owns a house", so the names assigned to the nodes will 
// be "Sex" and "Owns_a_house", respectively.
dbmgr_cs *dbmgr = NewDBManager_cs (
   "driver={Microsoft Access Driver (*.mdb)}; dbq=.\\myDB.mdb;", "pooling", env);
net_bn* net = NewNet_bn ("testNet", env);
AddNodesFromDB_bn (dbmgr,
                   "Sex, \"Owns a house\"",
                   NULL,   // NULL => no extra conditions