#1 Re: mORMot 2 » Is it possible for me to define a service uri? » 2024-01-25 08:19:49

I followed ab's reply above and added some test code that I explored .


FHttpServer := TRestHttpServer.Create(APort, [FRestServer], '+', HTTP_DEFAULT_MODE, 32, secNone, '/' {aAdditionalUrl});

FHttpServer.Route.Rewrite(urmGet, '/', urmGet, '/myApi/myService/getTime');

#2 Re: mORMot 2 » Is it possible for me to define a service uri? » 2024-01-15 03:01:02

TOrmModel.Create([TPerson], 'API');     //    API/SampleService

#3 Re: mORMot 2 » ODBC Function sequence error » 2023-09-14 01:38:52

SQL statement in case of failure to run in the IDE

declare @p1 int
set @p1=1
exec sp_prepexec @p1 output,NULL,N'select COLUMN_NAME, DATA_TYPE, CHARACTER_MAXIMUM_LENGTH, NUMERIC_PRECISION, NUMERIC_SCALE, 0 INDEX_COUNT from INFORMATION_SCHEMA.COLUMNS where UPPER(TABLE_SCHEMA) = ''DBO'' and UPPER(TABLE_NAME) = ''PERSON'''
select @p1
go
exec sp_unprepare 1
go
exec [sys].sp_columns_100 N'PERSON',N'DBO',NULL,NULL,@ODBCVer=3,@fUsePattern=1
go
exec [sys].sp_columns_100 N'PERSON',N'%',NULL,NULL,@ODBCVer=3,@fUsePattern=1
go

#4 Re: mORMot 2 » ODBC Function sequence error » 2023-09-14 01:31:51

I'm sorry that I can't provide pictures, so I have to paste SQL log statements.
declare @p1 int
declare @p1 int
set @p1=1
exec sp_prepexec @p1 output,NULL,N'select COLUMN_NAME, DATA_TYPE, CHARACTER_MAXIMUM_LENGTH, NUMERIC_PRECISION, NUMERIC_SCALE, 0 INDEX_COUNT from INFORMATION_SCHEMA.COLUMNS where UPPER(TABLE_SCHEMA) = ''DBO'' and UPPER(TABLE_NAME) = ''PERSON'''
select @p1
go
exec sp_unprepare 1
go
exec [sys].sp_columns_100 N'PERSON',N'DBO',NULL,NULL,@ODBCVer=3,@fUsePattern=1
go
exec [sys].sp_columns_100 N'PERSON',N'%',NULL,NULL,@ODBCVer=3,@fUsePattern=1
go
declare @p1 int
set @p1=2
exec sp_prepexec @p1 output,NULL,N'CREATE TABLE dbo.Person (ID bigint NOT NULL PRIMARY KEY,Name nvarchar(max),Age bigint)'
select @p1
go
declare @p1 int
set @p1=3
exec sp_prepexec @p1 output,NULL,N'select COLUMN_NAME, DATA_TYPE, CHARACTER_MAXIMUM_LENGTH, NUMERIC_PRECISION, NUMERIC_SCALE, 0 INDEX_COUNT from INFORMATION_SCHEMA.COLUMNS where UPPER(TABLE_SCHEMA) = ''DBO'' and UPPER(TABLE_NAME) = ''PERSON'''
select @p1
go
exec sp_unprepare 3
go
exec sp_unprepare 2
go
declare @p1 int
set @p1=4
exec sp_prepexec @p1 output,NULL,N'select top(1) ID from dbo.Person'
select @p1
go
declare @p1 int
set @p1=5
exec sp_prepexec @p1 output,N'@P1 varchar(max)',N'select ID from dbo.Person where ID=@P1','1'
select @p1
go
exec sp_unprepare 4
go
exec sp_unprepare 5
go

#5 Re: mORMot 2 » ODBC Function sequence error » 2023-09-12 02:20:39

Hi ab, thanks for your reply. The situation is as follows.

//-------------------------------------------------
Microsoft SQL Server 2022 (RTM) - 16.0.1000.6 (X64)   Express Edition (64-bit) on Windows 10  <X64>

ODBC Driver 18.3 for SQL Server
//-------------------------------------------------

procedure TForm1.FormCreate(Sender: TObject);
begin
  var dbcon := TSqlDBOdbcConnectionProperties.Create('123', '', '', '');

  var model := TOrmModel.Create([TPerson]);
  OrmMapExternal(model, model.Tables, dbcon);

  var server := TRestServerDB.Create(model, ':memory:');
  server.CreateMissingTables();

  dbcon.Free;
  model.Free;
  server.Free;
end;

#6 Re: mORMot 2 » ODBC Function sequence error » 2023-09-11 13:06:09

I get the same error message, but only in debug mode. Execution out of the IDE is no problem.

Board footer

Powered by FluxBB