Direct connection and OraLoader
Direct connection and OraLoader
Hello,
I am using ODAC version 9.7,26 for C++Builder 6.0 Professional and I would like to know if it is possible to use TOraLoader when TOraSession is connected to the Oracle server in direct mode?
Can someone point me an example on using TOraLoader with C++ Builder ?
Thank you very much.
Best regards.
Jayme Jeffman Filho.
I am using ODAC version 9.7,26 for C++Builder 6.0 Professional and I would like to know if it is possible to use TOraLoader when TOraSession is connected to the Oracle server in direct mode?
Can someone point me an example on using TOraLoader with C++ Builder ?
Thank you very much.
Best regards.
Jayme Jeffman Filho.
Re: Direct connection and OraLoader
You can run OraLoader when using ODAC Direct Mode with LoadMode = lmDML. For example, create the following table:
Then we implement the logic for populating the MyLoadedTable table to insert 10 entries in the OraLoaderGetColumnData handler:
Now you can use OraLoader:
Code: Select all
CREATE TABLE MyLoadedTable (ID NUMBER, StrValue VARCHAR2 (128))
Code: Select all
void __fastcall TForm1 :: OraLoaderGetColumnData (TObject * Sender, TDPColumn * Column, int Row, Variant & Value, bool & IsEOF)
{
switch (Column-> Index)
{
case 0: Value = Row; break;
case 1: Value = "Values" + IntToStr (Row); break;
default: Value = Null;
}
IsEOF = Row> 10;
}
Now you can use OraLoader:
Code: Select all
{
...
OraSession-> Connect ();
OraLoader-> LoadMode = lmDML;
OraLoader-> TableName = "MyLoadedTable";
OraLoader-> Load ();
...
}
Re: Direct connection and OraLoader
Hello Maxim,
Thank you very much for answering me.
So, as I can learn from your answer, the "GetColumnData" event is the code point where I should put a "get next CSV line" to feed the columns data.
I have thought TOraLoader was an implementation of the work SQL*Loader does reading text files, but it does more as I can feed columns values from any source.
Is there a better approach to load text files data into Oracle tables ?
Best regards.
Jayme Jeffman Filho
Thank you very much for answering me.
So, as I can learn from your answer, the "GetColumnData" event is the code point where I should put a "get next CSV line" to feed the columns data.
I have thought TOraLoader was an implementation of the work SQL*Loader does reading text files, but it does more as I can feed columns values from any source.
Is there a better approach to load text files data into Oracle tables ?
Best regards.
Jayme Jeffman Filho
Re: Direct connection and OraLoader
Hello Maxim,
I would also like to know about the point of committing data to the database, as long as the component itself does not have any property which can indicate how many rows to load between commits.
Thank you very much.
Best regards.
Jayme Jeffman
I would also like to know about the point of committing data to the database, as long as the component itself does not have any property which can indicate how many rows to load between commits.
Thank you very much.
Best regards.
Jayme Jeffman
Re: Direct connection and OraLoader
The functionality you are interested in is absent in the TOraLoader component
Re: Direct connection and OraLoader
Hi Maxim
Thank you very much for answering me.
I am filling up a TVirtualTable whitin a while loop and calling TOraLoader::LoadFromDataSet when the VirtualTable has a certain number of rows, to break the operation in blocks and let the users get acces to data just imported more quickly.
Best regards.
Jayme Jeffman
Thank you very much for answering me.
I am filling up a TVirtualTable whitin a while loop and calling TOraLoader::LoadFromDataSet when the VirtualTable has a certain number of rows, to break the operation in blocks and let the users get acces to data just imported more quickly.
Best regards.
Jayme Jeffman
Re: Direct connection and OraLoader
We are glad that you could find a necessary solution. Contact us with any questions about using our products