I want to do a CALL to a function I created in a MySQL Database
In my heidi workbench for SQL I write
CALL DatabaseName.FunctionName(Param1,Param2)
How to do this from Delphi
You should just use your regular database-connection component, maybe you are using FireDAC, thus you should use TFDQuery to do so.
If you are using Aurelius, you can execute arbitrary SQL statements, it's explained in the following topics:
I copied some code and made this
PROCEDURE TInkaUserMainForm.FixaVinster(inDate, inBana: STRING);
VAR
Statement: IDBStatement;
BEGIN
Statement := Manager.Connection.CreateStatement;
Statement.SetSQLCommand('CALL inkadb.uppdatera_18_hål(indate,inbana');
Statement.ExecuteQuery;
END;
But i dont know wher Manager comes from
Whitch USES do I need for TXDataOperationContext.Current
And the dubble dots .. what are they for
And also a USES for IDBStatement
You should use units XData.Server.Module
and Aurelius.Drivers.Interfaces
.
I get Undeclared identifier TXDataOperationContext
When I write XData. I do not see Servermodule in the list showing
Sorry I found Server.Module
And now I TXDataOperationContext is ok
Sorry
I'm to quick in making questions.
I try to test more before I make a question
Now is it so that when Writing in Delphi
XData. It show a list and on that list I find Server.Module
But when compiling it says cant find unit XData.Server.Module
Same problem with
Aurelius. It show a list where I can find Drivers.Interfaces
But when compiling it says Cant find unit Aurelius.Drivers.Interfaces
I'm sorry, it was my typo. I have fixed my message, indeed it's XData.Server.Module
.
Do you have a screenshot? Those are regular XData/Aurelius units, if compiler is not finding them, it means that they are not properly installed in Delphi.
Delphi see the XData/Aurelius units because there are no underlining on
Aurelius.Drivers.Interfaces, XData.Server.Module,
Compiler givs

I have also made a REST Server with the same installed XData/Aurelius units and no problem there
Something else
It says That I have TMS WEB Core version 2.7.2.2 but I know for shure that I have Downloaded registered version (1,634.56 MB) and installed it
TMS Aurelius is not supported in Web Core, and XData.Server.Module
is also not available because it belongs to server-side XData, which makes no sense to be used in Web Core as well.
So how should I solve the problem to call a database function
from my web application created with Web Core
You should create a service operation in XData that performs such database call, and then call such service operation from Web Core client.
a small working code exampel for both
XData Server and for my webcore client would be nice
Besides documentation for service operations and Web Core XData client, you can check the FireDAC SQL demo located in folder <xdata>\demos\firedac-sql
.
In such demo, unit CustomerServiceImpl
shows how to implement several endpoints executing SQL statements using FireDAC. You can simply do the same to execute your own call to database function.