Page 32 of 44

Posted: 07.09.2012, 09:42
by miab3
@EgonHugeist

I checked it does not work:
EZDatabaseError class Exception with message 'Unknown Param.DataType'

After the recent changes to procedures slowed significantly in remote connection.

Why in the name is added to the '@' and all kinds of strings types are presented as WIDEMEMO (attached) ?.

There is still confusion with r1727

Michal

Posted: 07.09.2012, 10:17
by EgonHugeist
miab3,

Oh they are slower now? Uff i was exactly the way going MySQL describes. And i changed the whole Statement to 1Byte AnsiStrings to avoid up and down castings/decodings of the Statement Parameters to speed up the Statements.

MySQL says: Set the Parameters first like 'SET P1= 100'.. There is no way around for INOUT types. On the other hand i can't fetch them afterwards. The INOUT type need a name and the In value must be assigned before. And with that name i can execute a select of the OUT/INOUT params.

The @ operator i can remove, if it works well.

Is the WideMemo issue a new one or does it happen since my latest fix? MySQL makes me curious according the FieldTypes too. We did declare the Strings as varchar but on fetching the results does MySQL return text-lob types. Why i don't know. Only the MetaInformations are right interpreter. Ok i can create an extra resutset for that statement and assign the Param given types. Michal i have no idea why MySQL does such stupid things...

The exception you have posted does not occour with the ABTEST funtion so i think you did test the BLOB, right.

Can you create me a complete simple procedure which includes Text/Binary BLOB, Bytes and INOUT types? Then i'll add them to the test and can start playing with...

Posted: 07.09.2012, 10:56
by miab3
@EgonHugeist

For MySQL:

Code: Select all

CREATE DEFINER = 'root'@'%' PROCEDURE `AB_All`(
        INOUT `P1` TINYINT(4),
        INOUT `P2` TINYINT(1),
        INOUT `P3` SMALLINT(6),
        INOUT `P4` MEDIUMINT(9),
        INOUT `P5` INTEGER(11),
        INOUT `P6` BIGINT(20),
        INOUT `P7` DOUBLE,
        INOUT `P8` FLOAT,
        INOUT `P9` DECIMAL(19,4),
        INOUT `P10` DECIMAL(10,0),
        INOUT `P11` VARCHAR(100),
        INOUT `P12` DATE,
        INOUT `P13` TIME,
        INOUT `P14` YEAR(4),
        INOUT `P15` TIMESTAMP,
        INOUT `P16` DATETIME,
        INOUT `P17` TINYBLOB,
        INOUT `P18` BLOB,
        INOUT `P19` MEDIUMBLOB,
        INOUT `P20` LONGBLOB,
        INOUT `P21` TINYTEXT,
        INOUT `P22` TEXT,
        INOUT `P23` MEDIUMTEXT,
        INOUT `P24` LONGTEXT,
        INOUT `P25` VARBINARY(100),
        INOUT `P26` SET('a','b','c','d'),
		INOUT `P27` INT,
        INOUT `P28` INTEGER
    )
    DETERMINISTIC
    NO SQL
    SQL SECURITY DEFINER
    COMMENT ''
BEGIN
END;
WideMemo for non-numeric fields is from the beginning.

ABTEST works well but it is a very simple procedure. She had to be at the beginning or whatever works. Why did not you use to test simple visual application with dbgrid?. Then you can easily see most of the errors.

Michal

Posted: 08.09.2012, 09:18
by miab3
@EgonHugeist

It is almost good, the speed has returned, only the (WideMemo) remaining,

R1742 D2006, DXE2

Michal

Posted: 08.09.2012, 10:25
by EgonHugeist
miab3,

thank you, Michal. I've attached you a debug window of the MySQL FieldRecords which i got from the sever back on fetching the Data. Do you see the MEDIUM_BLOB? Actually i'm reading documentations to find out what exactly must be done to get the Out/Inout values running like we do expect them.

Posted: 08.09.2012, 12:23
by miab3
@EgonHugeist

I rather have a problem with TIMESTAMP and VARBINARY (100)

Code: Select all

var i:integer;
begin
ZStoredProc1.Close;
for i:=0 to 27 do
 begin
 if (i<>14) and (i<>24) and (i<>25) then
 ZStoredProc1.Params[i].Value:=i;
 end;
 //ZStoredProc1.Params[14].Value:=14.1;  //P15 - TIMESTAMP   ???
 //ZStoredProc1.Params[24].Value:=24;  //P25 - VARBINARY(100)  ???
ZStoredProc1.Params[25].Value:='b,c';
ZStoredProc1.Open;
end;
The rest is accepted.

Michal

Posted: 09.09.2012, 19:15
by EgonHugeist
miab3,

i think to most issues should be gone now. R1757 I was forced to cast the types. On the otherhand MySQL does not return the right fieldtypes again. Also must i rename the Fields with the original column-name because MySQL does not exept selects of paramets without the '@' operator. You can see all Statements with the TZSQLMonitor.

Now are "return types" of funtions (how to devide both of them, i don't know yet) and mutliple resultsets remaining. So please check again the MySQL TZStoredProcedure.

Posted: 09.09.2012, 19:29
by miab3
@EgonHugeist

Well now it is almost perfect. With little exception:
If you set the property StoredProcName on DesignTime ABTEST, The code:

Code: Select all

ZStoredProc1.StoredProcName:='ABTEST';
ZStoredProc1.ExecProc;
throwing error.
The procedure name must be changed in RunTime, that the error did not occur.

In addition, if setting in DesignTime ZstoredProc Active to true mistake is called on startup

Michal

Posted: 10.09.2012, 10:33
by miab3
@EgonHugeis, @olehs

It is still mixed Catalog and Database for MySQL.

Michal

Posted: 11.09.2012, 08:42
by miab3
@EgonHugeis, @olehs

Then there are mistakes as before.
In addition, there was AV when trying to open StroredProc connected to the DBGrid.
(Simple GUI application ZConnection, ZQuery, ZTable, ZStoredProc + 3 DBGrid show their most of.)

MySQL, D2005, r1769

Michal

Posted: 11.09.2012, 11:52
by EgonHugeist
miab3,
The procedure name must be changed in RunTime, that the error did not occur.
Yes i know about that issue, Michal.
Then there are mistakes as before.
What do you mean exactly? New issues or the same @designtime?

Michal i've added the MySQL function support with ReturnValues and multiple resultsets for stored procedures where fetched now too.
An example:

Code: Select all

CREATE PROCEDURE `MultipleVaryingResultSets`(
  IN p_in INT,
  OUT p_out INT,
  INOUT p_inout INT)
BEGIN
  SELECT p_in, p_out, p_inout;
  SET p_in = 100, p_out = 200, p_inout = 300;
  SELECT p_in, p_out, p_inout;
  SELECT p_in, p_inout;
  SELECT 10;
END;
This procedure returns 4 ResultSets + a ParamOut resultset if we fetch them. Any idaes how to handle such possibilities on the component-layer?

Posted: 11.09.2012, 12:45
by miab3
@EgonHugeis

Faulty initialization sequence in design/runtime.

Use GUI application to see errors.

Multiple record/datasets (NextRecordset):
http://www.scip.be/index.php?Page=Artic ... 12&Lang=EN
http://theroadtodelphi.wordpress.com/20 ... nd-delphi/

I think it should be returned the first, other by the next or index

Michal

Posted: 11.09.2012, 15:50
by miab3
@EgonHugeis

R1774 MySQL
Radical improvement.
He remained a problem design / runtime
and how to extract more recordsets.

Michal

Posted: 11.09.2012, 16:27
by EgonHugeist
miab3,

Ok Michal, got now everything running @designtime R1776.
Radical improvement.
Yes that's right but i think the improvement on the PropertyEditor is correct. We've got the possibility to check if additional name paths like Catalog and Schemas are supported for procedures and tables. So for me personally this is the rigth syntax and was only missing before.

Remaining are now the multiple resultsets. Actually i've no idea how to improve that correctly. Yes it would be nice to have, but as far as i know does only MySQL support that. What i've done is to cache all available resultset and give allways the Paramet-fetched back. That's the way all othe drivers go yet. Do you know if MyDAC does support this?

Posted: 11.09.2012, 17:04
by miab3
@EgonHugeis

R1776
It seems that now it's fine.

Multiple resultsets and cursors also occurs in other servers
MSSQL, PostgreSQL
http://www.sqlines.com/postgresql/how-t ... _procedure
http://www.sqlines.com/postgresql/npgsql_cs_result_sets
But like nested tables I would left it for later.

It would be nice to Oracle and MSSQL procedures work at all.

Michal