Additional
dbCAP
AnyDAC
ThinDAC
NCOCI8
Topic: Command Text Must Not Be Empty..
Command Text Must Not Be Empty..
Posted: 2008/01/15 11:56
 
Hi,

I am currently evaluating ANY-DAC for my company, and I seem to be having an issue when testing a storedproc in an Oracle package.

I get the following error :
Command Text Must Not Be Empty

I am not sure what this mean, the docs seemed kind of vague. Doing a search on the forums for TADStoredProc and the above error don't seem to return anything useful.

Is there an example somewhere of creating a TADStoredProc at runtime and filling in it's parameters?

Any help would be appreciated.

Thanks,

Jeff
Re:Command Text Must Not Be Empty..
Posted: 2008/01/15 23:29
 
Hello

Is it what you are looking for ?

 var   oSPTADStoredProc; begin   oSP := TADStoredProc.Create(nil);   try     oSP.Connection := ADConnection1;     oSP.StoredProcName := 'MY_PROC';     oSP.Prepare;     oSP.Params[0].Value := 100;     oSP.ExecProc;   finally     oSP.Free;   end; end;

Re:Command Text Must Not Be Empty..
Posted: 2008/01/16 06:09
 
Actually I figured out what the issue was. I was looking at the property .StoredProcName like other components (I have had several to review and code layers for to use in testing), and I thought you would include the package name if you were using a package..

eg : .StoredProcName := 'MyPKG.ProcName';

Well, it doesn't work like that it works more like DBX where you have to do the following :


      ADStoredProc1.PackageName := 'MyPKG';   ADStoredProc1.StoredProcName := 'ProcName';   ADStoredProc1.Prepared := True;   ADStoredProc1.ParamByName('pIn_val').Value := 1234;   ADStoredProc1.Open;



I didn't notice the .PackageName property, and when the error came up it didn't make sense to me, and I didn't see any message on using packages. Once I did the above though the error went away.

Thanks for the help.

Regards,

Jeff