Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.
Originally posted by: ltollesonI asked about the DB type because there are 2 different methods for binding a value to a query depending on the DB you are trying to query.
In LAE there are 2 different sets of DB nodes that work with different DB types. For Oracle, Teradata, or any ODBC connection we use the (DBQUery, DBExecute, and DBStore) nodes. For any JDBC connection we use the (JDBCQuery, JDBCExecute, and JDBCStore) nodes. Based on which set of nodes you use will determine how we setup the nodes to bind a values to the query.
Let's start with Oracle.
If you want to perform a simple SELECT statement, then you would use the DBQuery node.
If you want to pass in a set of values to query, then you would use the DBExecute node (Interfaces and Adapters). I think this is what you want to use based on the question you originally asked.
Let's assume you have input data coming into your DBExecute node that contains a field called AccountNumber and you want to pass that value into an sql query of a table called Account that contains a field called AcctNbr.
In the DBExecute node you would write the following BrainScript code.
sqlSelect(1, "select * from Account where AcctNbr = :1", AccountNumber)
You will also need to add an input and output to the DbExecute node to allow for input into the node and to produce the output of the query. By default the DBExecute node does not have any inputs or outputs configured.
Let us know if you still have questions.