OracleDirectPathLoader , 10g and ORA-24329 Invalid character set

Max K.

Member²
Hello!
I downloaded DOA 4 trial version for Delphi6, installed it and tried to test OracleDirectPathLoader.
I tested it on Oracle 8.1.6, Novell and on Win2k Oracle 10g.

Changing Help example:


Code:
// Create a Loader at run time
  Loader := dm1.DataModule2.OracleDirectPathLoader1;
  try
    // Set the session and table name
    Loader.Session := dm1.DataModule2.OracleSession1;
    Loader.TableName := 'cscman.T_IDNUMBERS';
    // Get the default columns for the record_data table
    Loader.GetDefaultColumns(False);

    // Prepare the loader
    Loader.Prepare;
    // Process all data in batches of <MaxRows> records
    Row := 0;
    for i := 0 to {Records.Count - 1} 1000-1 do
    begin
      // Copy one record to the array
///      Loader.Columns[0].SetData(Row, @Records[i].Line, 0);
///      loader.Columns[1].SetData(Row, @Records[i].Text[1],
///                                     Length(Records[i].Text));

   s := 'Test_' + intToStr(i);
   Loader.Columns[0].SetData(Row, @s[1], Length(s) );

      Inc(Row);
      // The array is filled, or we have preocessed all records:
      // load this batch of records
///      if (Row = Loader.MaxRows) or (i = Records.Count - 1) then
      if (Row = Loader.MaxRows) or (i = 999) then
      begin
        try
          Loader.Load(Row);
        except
          // In case of an error: show where things went wrong
          // and abort the load operation
          on E:EOracleError do

          begin
            ShowMessage(E.Message + #13#10 +
                        'Row = ' + IntToStr(Loader.LastRow) + #13#10 +
                        'Col = ' + IntToStr(Loader.LastColumn));
            Loader.Abort;
            raise;
          end;
        end;
        Row := 0;
      end;
    end;
    // Commit the loaded data
    Loader.Finish;
  finally

    Loader.Free;
  end;
As you can see, in the table cscman.T_IDNUMBERS
Loader must insert one-column rows like that:

Test_1
Test_2
...
Test_999

But on Novel Oracle 816 I have rows:

IDNUMBER
________

999
Test_99
Test_99

Test_99
999
Test_99

999
...
{}
...
Test_999
Test_998
Test_999
Test_998
Test_999
_________

And here is the main problem: if I try to do the same with Oracle 10g, error "ORA-24329 Invalid character set" occur. It happens on line


Code:
// Prepare the loader
    Loader.Prepare;
So, how can I
1) Cause Loader to load correct information to Oracle816 ?
2) Load anything to 10g ?
 
The problem here is that the string data is volatile, because it is stored in a local variables "s" that is reused. When you use TDirectPathColumn.SetData, the memory that the data pointer points to must remain valid until you call TOracleDirectPathLoader.Load.
This loads the data from memory into the database.

The DirectPath demo demonstrates this.
 
Marco, thank you!

I feel myself like stupid... :(

Ok, loading to Ora 816 is ok.
But Oracle 10g still throws "ORA-24329 Invalid character set" exception.
So what I have to do in this case?
 
My Delphi6 menu Oracle->Info shows

Direct Oracle Access
Vesrion 4.0.6.2

Object vestion(Evaluation)
OCI: not initialized

WHat does the last string mean?
 
Back
Top