#1 2016-09-21 05:47:28

mariomoretti
Member
From: italy
Registered: 2012-01-29
Posts: 88

tablemaxid and external database

Hi to all,

tSQLRestServerDB.TableMaxID only works with Sqlite db?
In postgret it returns an error : rowid column doesn't exists.

I suppose that also "limit" could be a problem with some db engines.

tx

Offline

#2 2016-09-21 06:52:09

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,183
Website

Re: tablemaxid and external database

Please check http://synopse.info/fossil/info/ad5e849baa

Thanks for the report.

Offline

#3 2016-09-26 22:33:34

mariomoretti
Member
From: italy
Registered: 2012-01-29
Posts: 88

Re: tablemaxid and external database

Hi AB,

sorry for delay and tx very much.

Now it works, but i had to upgrade to last revision. Nothing of bad , except that now i'm encountering another problem in tSQLRestServerDB.Executelist .

This is the line that doesn't work no more on postgres DB via ODBC :

        rows := DataBase.ExecuteList([tSQLCD_Params],'select data from ' + tSQLCD_Params.SQLTableName); 

the error reported is : TODBCStatement.GetCol: "data" column had Indicator=1376

data is a blob and , debugging, i've found that the error is fired because of a modification in function GetDiagField of unit SynDbODBC, line 1848.

Before it was  :

 
     if ODBC.GetDiagRecW(SQL_HANDLE_STMT,StatementHandle,1,
       Sqlstate,NativeError,MessageText,1024,StringLength) = 0 then
     begin
          i := 0;
          while sqlstate[i]> #0 do
          begin
               result := result + sqlstate[i];
               inc(i);
          end;
     end;

GetDiagRecW returned 0.
Now it is :

  if ODBC.GetDiagFieldA(SQL_HANDLE_STMT,StatementHandle,1,SQL_DIAG_SQLSTATE,
     @Status,sizeof(Status),StringLength)=0 then
    SetString(result,PAnsiChar(@Status),StringLength) else
    result := '';
  

The GetDiagFieldA doesn't return 0.

Offline

Board footer

Powered by FluxBB