How do I bind SalesLogix data in a DataGrid from 2 different tables in Oracle? I am trying to do like this way:
Datagrid.SQL.Text = “SELECT * FROM TABLE1 T1, TABLE2 T2 WHERE T1.FIELD1=T2.FIELD2…..”
Is that possible at all? Because I didnt see fields from secondary table.
The ‘term’ you are looking for is not Bind. It’s JOIN.
It’s a clause in a SQL statement.
Datagrid.SQL.Text = “SELECT * FROM TABLE1 T1 INNER JOIN TABLE2 T2 ON(T2.Keyfield=T1.Keyfield) WHERE …….
or LEFT OUTER JOIN if the keyfield item doesn’t always exist in table 2
NEVER use SELECT * unless you truly need to….if you need 6 fields, then specify the 6 fields exactly….
An exception is when you SELECT * to open up a 1 record buffer to perform an INSERT.
SELECT * FROM TABLE1, TABLE2 would be a cartesian join that could quickly grab a million records and crash your server!