#1 Re: mORMot 1 » Output Parameter » 2016-07-13 06:56:13

Is something happening in topic? Shall i make ticket?

#2 Re: mORMot 1 » Output Parameter » 2016-06-30 08:50:24

Any idea what i can try else?

#3 Re: mORMot 1 » Output Parameter » 2016-06-27 13:02:25

I tried to change TOleDBMSSQLConnectionProperties to TOleDBMSSQL2008ConnectionProperties (and all others MSSQLCon.. for test). Unfortunately, the same problem

#4 Re: mORMot 1 » Output Parameter » 2016-06-27 09:36:00

Hi, db is Microsoft SQL Server 2008 R2 (SP2)

sample function

create procedure test(@param1 nvarchar(100) output) as
begin
	set @param1 = '1234567890'	
end;

delphi

function TForm3.paramTest: string;
var stmt: ISQLDBStatement;
    val: Variant;
    vConnProp: TOleDbConnectionProperties;
    con: TSQLDBConnection;
    res: string;
begin
    vConnProp := TOleDBMSSQLConnectionProperties.Create('db', 'dbname, 'usr', 'pass');
    val:= '';  //result will be 0 char
    val:= ' ';  //result will be 1 char.. and so on

    con := vConnProp.ThreadSafeConnection;
    con.Connect;
    stmt := con.NewStatementPrepared('exec test ? output ', false);

    stmt.BindTextS(1, val, paramOut);
    stmt.ExecutePrepared;
    stmt.ParamToVariant(1, val);
    result:= val
end;

#5 mORMot 1 » Output Parameter » 2016-06-24 06:22:40

and4sh
Replies: 12

Hi,after upgrate framework (2013-> actual) my problem is that no matter how long text back from sql, value will have length of value while binding. I try with NewThreadSafeStatementPrepared and same situation.

var
value: Variant;
stmt: TSQLDBStatement;

stmt := queryBuilder.NewStatement;
stmt.BindTextS(1, value, paramOut);
stmt.ExecutePrepared;
stmt.ParamToVariant(1, value);

eg

value := 'qq';
stmt.BindTextS(1, value, paramOut);
stmt.ParamToVariant(1, value);
//max value length = 2
////////////////////////////////////////////

value := DupeString(' ', 100);
stmt.BindTextS(1, value, paramOut);
stmt.ParamToVariant(1, value);
//max value length = 100

Any advice what i doing wrong?

Board footer

Powered by FluxBB