for example
Code: Select all
ZQuery1.SQL.Text := 'select table(0)';
ZQuery1.Open;
how can i ?
Code: Select all
ZQuery1.SQL.Text := 'select table(0)';
ZQuery1.Open;
Code: Select all
CREATE TABLE `tb_table` (
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`name` VARCHAR(50) NULL DEFAULT '0',
PRIMARY KEY (`id`)
)
COLLATE='utf8_general_ci'
ENGINE=InnoDB;
Code: Select all
CREATE FUNCTION `tb`()
RETURNS INT
LANGUAGE SQL
DETERMINISTIC
CONTAINS SQL
SQL SECURITY DEFINER
COMMENT ''
BEGIN
insert into tb_table (id,n) values ('','example');
return 1;
END
Code: Select all
procedure TZMySQLResultSet.Open;
var
I: Integer;
FieldHandle: PZMySQLField;
begin
if ResultSetConcurrency = rcUpdatable then
raise EZSQLException.Create(SLiveResultSetsAreNotSupported);
if FUseResult and (not FIgnoreUseResult) then
begin
FQueryHandle := FPlainDriver.UseResult(FHandle);
LastRowNo := 0;
end
else
begin
FQueryHandle := FPlainDriver.StoreResult(FHandle);
if Assigned(FQueryHandle) then
LastRowNo := FPlainDriver.GetRowCount(FQueryHandle)
else
LastRowNo := 0;
end;
if not Assigned(FQueryHandle) then
raise EZSQLException.Create(SCanNotRetrieveResultSetData);
{ Fills the column info. }
ColumnsInfo.Clear;
for I := 0 to FPlainDriver.GetFieldCount(FQueryHandle) - 1 do
begin
FPlainDriver.SeekField(FQueryHandle, I);
FieldHandle := FPlainDriver.FetchField(FQueryHandle);
if FieldHandle = nil then
Break;
ColumnsInfo.Add(GetMySQLColumnInfoFromFieldHandle(FPlainDriver,
FieldHandle, ConSettings, FUseResult));
end;
inherited Open;
end;
Code: Select all
uses ZDbcLogging;
Code: Select all
procedure TZMySQLResultSet.Open;
var
I: Integer;
FieldHandle: PZMySQLField;
LogSQL: String;
begin
if ResultSetConcurrency = rcUpdatable then
raise EZSQLException.Create(SLiveResultSetsAreNotSupported);
if FUseResult and (not FIgnoreUseResult) then
begin
FQueryHandle := FPlainDriver.UseResult(FHandle);
LastRowNo := 0;
end
else
begin
FQueryHandle := FPlainDriver.StoreResult(FHandle);
if Assigned(FQueryHandle) then
LastRowNo := FPlainDriver.GetRowCount(FQueryHandle)
else
LastRowNo := 0;
end;
if not Assigned(FQueryHandle) then
begin
CheckMySQLError(FPlainDriver, FHandle, lcExecute, LogSQL);
raise EZSQLException.Create(SCanNotRetrieveResultSetData);
end;
{ Fills the column info. }
ColumnsInfo.Clear;
for I := 0 to FPlainDriver.GetFieldCount(FQueryHandle) - 1 do
begin
FPlainDriver.SeekField(FQueryHandle, I);
FieldHandle := FPlainDriver.FetchField(FQueryHandle);
if FieldHandle = nil then
Break;
ColumnsInfo.Add(GetMySQLColumnInfoFromFieldHandle(FPlainDriver,
FieldHandle, ConSettings, FUseResult));
end;
inherited Open;
end;