TOracleScript

nisbus

Member
Hi,

I'm trying to use the TOracleScript component to create a table at runtime:

ORA_Script := TOracleScript.Create(Self);
ORA_Script.Session := O_Session;
ORA_Script.Lines.Clear;
ORA_Script.Lines.Add(CreateTableString);
ORA_Script.Execute;

I've tried copying the CreateTableString into SQL navigator and executing it and it creates a table.
When I run this code though I get an invalid pointer operation error and the program ends.

Am I missing something?

Thanks
 
Sorry, I'm an idiot.

I needed to change the code to this:

OracleScript1.Session := O_Session;
OracleScript1.Lines.Clear;
OracleScript1.Lines := s;
OracleScript1.Execute;

where s is a TStringList.

now it works perfectly
 
Back
Top