I am using insert query for posting data from embarcadero(firebird as DB) to SQL server using Unidac.
I am using the following query as a parameter for storing TSQLTimeStampOffset data type.
UQuery->ParamByName("DayLightTimeOfET")->AsSQLTimeStampOffset = PModels.DayLightTimeOfET;
where "UQuery " is a pointer to TUniQuery and "PModels" is a class and DayLightTimeOfET is variable of data type SQLTimeStampOffset of PModels class.
while executing the query I am getting the following exception.
"Invalid internal field type $19 (25) (D:\Projects\Delphi\Dac\SqlServer\Source\OLEDBAccess.pas, line 1214)"
Can Anyone help? my other queries are working fine.
TUniQuery 's execute function giving exception while using AsSQLTimeStampOffset as data typpe for query parameter
Re: TUniQuery 's execute function giving exception while using AsSQLTimeStampOffset as data typpe for query parameter
Please specify the data type you are using in the Firebird table and in the SQL Server table.
Re: TUniQuery 's execute function giving exception while using AsSQLTimeStampOffset as data typpe for query parameter
In SQlServer data type is DateTimeOffset and i am creating a new datatype in firebird ie; TSQLTimeStampOffset.
Note: I am not using it in firebird DB Table.
Note: I am not using it in firebird DB Table.
Re: TUniQuery 's execute function giving exception while using AsSQLTimeStampOffset as data typpe for query parameter
You can work with the data type datetimeoffset as with a string value, presented in the format For this, you need set the 'Provider' option to 'prSQL'.
For example:
Code: Select all
YYYY-MM-DD hh:mm:ss[.nnnnnnn] [+|-]hh:mm
For example:
Code: Select all
UniConnection1->SpecificOptions->Values["SQL Server.Provider"] = "prSQL";
...
UQuery->ParamByName("DayLightTimeOfET")->DataType = ftWideString;
UQuery->ParamByName("DayLightTimeOfET")->AsString = SQLTimeStampOffsetToStr("YYYY-MM-DD hh:mm:ss", PModels.DayLightTimeOfET);
Re: TUniQuery 's execute function giving exception while using AsSQLTimeStampOffset as data typpe for query parameter
Yesterday i got following from your page.
"yyyy-mm-dd hh:nn:ss"
It works.
"yyyy-mm-dd hh:nn:ss"
It works.