Page 1 of 1

Field type mismatch exception at runtime - only when using Direct Connection + NonBlocking mode

Posted: Mon 20 Jun 2016 09:03
by pcz
Hello

I have a strange problem with TOraQuery
My compiled application behaves different depending on connection mode / usage of NonBlocking mode
  • OCI - everything is fine
    Direct connection - Exception "Type mismatch for field '<FIELD_NAME>', expecting: DateTime actual: String"
Field class is TDateTimeField
I have tried and compiled app both as 32-bit & 64-bit - exception is raised in both of them

Problem happens:
  • Only when using session with "Direct" connection mode
    Only in runtime
    Only when using NonBlocking mode

When I change one of things listed above application works fine
When I open "Data Editor" at designtime there is no problem too

SQL sample from Debug window (maybe it could be helpful...)

Code: Select all

select m.symbol mag_symbol, m.nazwa mag_nazwa, kon.nazwa_wlasna, count(distinct pm.pi_numer) ile_inw,
       sum(decode(om.stoo_symbol, 'KI+', om.wart_spz_net, 0)) csn_plus,
       sum(decode(om.stoo_symbol, 'KI-', om.wart_spz_net, 0)) csn_minus,
       sum(decode(om.stoo_symbol, 'KI+', om.wart_spz_net, 'KI-', -om.wart_spz_net, 0)) csn_saldo,
       round
       (
         sum
         (
           decode
           (
             m.typ_magazynu, 
             'PSD-FRANCZYZA', 0, 
             decode
             (
               om.stoo_symbol,
               'KI+', 0,
               'KI-', 0,
               om.wart_spz_net
             )
           ) 
         )  
         *k.tresc/100, 2
       ) dop_straty,
       sum
       (
         decode
         (
           m.typ_magazynu, 
           'PSD-FRANCZYZA', 0, 
           decode
           (
             om.stoo_symbol,
             'KI+', 0,
             'KI-', 0,
             om.wart_spz_net
           )
         )
       ) csn_obrot,
       sum(decode(om.stoo_symbol, 'KI+', om.ilosc_jme, 0)) ile_jme_plus,
       sum(decode(om.stoo_symbol, 'KI-', om.ilosc_jme, 0)) ile_jme_minus,
       mp.ak_podmiot_odp,
       decode(m.typ_magazynu, 'PSD-FRANCZYZA', 'T', 'N') czy_franczyza,
       sum(decode(om.stoo_symbol, 'KI+', 1, 0)) ile_plus,
       sum(decode(om.stoo_symbol, 'KI-', 1, 0)) ile_minus,
       :BEGINNING data_od, :ENDING data_do, 'W TOKU' status, 'N' czy_zamkniete,
       mp.kon_podmiot_odp
from slw_magazyny m
     join
     slw_mag_param mp
     on (mp.symbol = m.symbol)
     join
     inw_plan_mag pm
     on (pm.m_symbol = m.symbol)
     join
     mk_operacje_mag om
     on (om.m_symbol = m.symbol)
     join
     mz_konfig k
     on (k.param = 'INW_DOP_STRATY_PROC')
     join
     kon_kontrahent kon
     on (kon.numer_kontrahenta = mp.kon_podmiot_odp)
where m.czy_miejscowy = 'N'
and pm.czy_rozl_wart = 'N'
and om.data_oper_mag between :BEGINNING and :ENDING
and (pm.pi_numer, pm.m_symbol) in
(
  select distinct om_k.dokument_obcy, om_k.m_symbol
  from mk_operacje_mag om_k
  where om_k.data_oper_mag between :BEGINNING and :ENDING
  and om_k.stoo_symbol in ('KI-', 'KI+')
  and om_k.dokument_obcy is not null
)
group by m.symbol, m.nazwa, mp.kon_podmiot_odp, kon.nazwa_wlasna, k.tresc, mp.ak_podmiot_odp, m.typ_magazynu

:BEGINNING(DATE,IN)=2010-01-01 
:ENDING(DATE,IN)=2016-03-31 
Exception message:
"Type mismatch for field 'DATA_DO', expecting: DateTime actual: String"

Looks like internal bug...
I'd be really gratefull for any fix...


Regards
P.C.


P.S. I have tested this query in ancient application called "EasySQL" at and this SQL is working fine

Re: Field type mismatch exception at runtime when using Direct Connection + NonBlocking mode - only in Win7

Posted: Mon 20 Jun 2016 10:06
by AlexP
Hello,

Please provide table scripts used in the query, parameter types, and the version of ODAC.

Re: Field type mismatch exception at runtime when using Direct Connection + NonBlocking mode - only in Win7

Posted: Mon 20 Jun 2016 11:08
by pcz
AlexP wrote:Hello,
Please provide table scripts used in the query, parameter types, and the version of ODAC.
RAD Studio XE 7 21.0.17707.5020
ODAC 9.7.2.4 Pro
Sorry - problem happens in Win XP too so it's OS independent (I was accidentally using OCI connection)

Params:
BEGINNING, ENDING - DATE / IN

Code: Select all

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, DBAccess, OdacVcl, OraCall, Data.DB, Ora, MemDS;

type
  TForm1 = class(TForm)
    OraSession1: TOraSession;
    ConnectDialog1: TConnectDialog;
    OraQuery2: TOraQuery;
    OraQuery2MAG_SYMBOL: TStringField;
    OraQuery2MAG_NAZWA: TStringField;
    OraQuery2NAZWA_WLASNA: TStringField;
    OraQuery2ILE_INW: TFloatField;
    OraQuery2CSN_PLUS: TFloatField;
    OraQuery2CSN_MINUS: TFloatField;
    OraQuery2CSN_SALDO: TFloatField;
    OraQuery2DOP_STRATY: TFloatField;
    OraQuery2CSN_OBROT: TFloatField;
    OraQuery2ILE_JME_PLUS: TFloatField;
    OraQuery2ILE_JME_MINUS: TFloatField;
    OraQuery2AK_PODMIOT_ODP: TFloatField;
    OraQuery2CZY_FRANCZYZA: TStringField;
    OraQuery2ILE_PLUS: TFloatField;
    OraQuery2ILE_MINUS: TFloatField;
    OraQuery2STATUS: TStringField;
    OraQuery2CZY_ZAMKNIETE: TStringField;
    OraQuery2KON_PODMIOT_ODP: TIntegerField;
    OraQuery2DATA_OD: TDateTimeField;
    OraQuery2DATA_DO: TDateTimeField;
    OraQuery1: TOraQuery;
    OraQuery1TEST: TDateTimeField;
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
var
  T1, T2: TDateTime;
begin
  OraSession1.Connect;

  T1 := EncodeDate(2010, 1, 1);
  T2 := Date;

  with OraQuery1 do
  begin
    Params[0].Value := T2;
    Open;   // this one works similar but is working
  end;

  with OraQuery2 do
  begin
    Params[0].Value := T1;
    Params[1].Value := T2;
    Open;   // this one causes exception when NonBlocking + Direct connection
  end;
end;

end.

Code: Select all

object Form1: TForm1
  Left = 0
  Top = 0
  Caption = 'Form1'
  ClientHeight = 134
  ClientWidth = 171
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'Tahoma'
  Font.Style = []
  OldCreateOrder = False
  OnCreate = FormCreate
  PixelsPerInch = 96
  TextHeight = 13
  object OraSession1: TOraSession
    Options.Direct = True
    Options.KeepDesignConnected = False
    Username = 'test'
    Server = '192.168.0.177:1522:TEST'
    Connected = True
    ConnectDialog = ConnectDialog1
    Left = 24
    Top = 16
    EncryptedPassword = '8CFF92FF8BFF'
  end
  object ConnectDialog1: TConnectDialog
    Caption = 'Connect'
    ConnectButton = 'Connect'
    CancelButton = 'Cancel'
    Server.Caption = 'Server'
    Server.Visible = True
    Server.Order = 1
    UserName.Caption = 'User Name'
    UserName.Visible = True
    UserName.Order = 2
    Password.Caption = 'Password'
    Password.Visible = True
    Password.Order = 3
    Home.Caption = 'Home Name'
    Home.Visible = False
    Home.Order = 0
    Direct.Caption = 'Direct'
    Direct.Visible = False
    Direct.Order = 6
    Schema.Caption = 'Schema'
    Schema.Visible = False
    Schema.Order = 4
    Role.Caption = 'Connect Mode'
    Role.Visible = False
    Role.Order = 5
    Left = 24
    Top = 64
  end
  object OraQuery2: TOraQuery
    Session = OraSession1
    SQL.Strings = (
      
        'select m.symbol mag_symbol, m.nazwa mag_nazwa, kon.nazwa_wlasna,' +
        ' count(distinct pm.pi_numer) ile_inw, '
      
        ' sum(decode(om.stoo_symbol, '#39'KI+'#39', om.wart_spz_net, 0)) csn_plus' +
        ', '
      
        ' sum(decode(om.stoo_symbol, '#39'KI-'#39', om.wart_spz_net, 0)) csn_minu' +
        's, '
      
        ' sum(decode(om.stoo_symbol, '#39'KI+'#39', om.wart_spz_net, '#39'KI-'#39', -om.w' +
        'art_spz_net, 0)) csn_saldo, '
      ' round '
      ' ( '
      ' sum '
      ' ( '
      ' decode '
      ' ( '
      ' m.typ_magazynu, '
      ' '#39'PSD-FRANCZYZA'#39', 0, '
      ' decode '
      ' ( '
      ' om.stoo_symbol, '
      ' '#39'KI+'#39', 0, '
      ' '#39'KI-'#39', 0, '
      ' om.wart_spz_net '
      ' ) '
      ' ) '
      ' ) '
      ' *k.tresc/100, 2 '
      ' ) dop_straty, '
      ' sum '
      ' ( '
      ' decode '
      ' ( '
      ' m.typ_magazynu, '
      ' '#39'PSD-FRANCZYZA'#39', 0, '
      ' decode '
      ' ( '
      ' om.stoo_symbol, '
      ' '#39'KI+'#39', 0, '
      ' '#39'KI-'#39', 0, '
      ' om.wart_spz_net '
      ' ) '
      ' ) '
      ' ) csn_obrot, '
      
        ' sum(decode(om.stoo_symbol, '#39'KI+'#39', om.ilosc_jme, 0)) ile_jme_plu' +
        's, '
      
        ' sum(decode(om.stoo_symbol, '#39'KI-'#39', om.ilosc_jme, 0)) ile_jme_min' +
        'us, '
      ' mp.ak_podmiot_odp, '
      
        ' decode(m.typ_magazynu, '#39'PSD-FRANCZYZA'#39', '#39'T'#39', '#39'N'#39') czy_franczyza' +
        ', '
      ' sum(decode(om.stoo_symbol, '#39'KI+'#39', 1, 0)) ile_plus, '
      ' sum(decode(om.stoo_symbol, '#39'KI-'#39', 1, 0)) ile_minus, '
      
        ' :BEGINNING data_od, :ENDING data_do, '#39'W TOKU'#39' status, '#39'N'#39' czy_z' +
        'amkniete, '
      ' mp.kon_podmiot_odp '
      ' from slw_magazyny m '
      ' join '
      ' slw_mag_param mp '
      ' on (mp.symbol = m.symbol) '
      ' join '
      ' inw_plan_mag pm '
      ' on (pm.m_symbol = m.symbol) '
      ' join '
      ' mk_operacje_mag om '
      ' on (om.m_symbol = m.symbol) '
      ' join '
      ' mz_konfig k '
      ' on (k.param = '#39'INW_DOP_STRATY_PROC'#39') '
      ' join '
      ' kon_kontrahent kon '
      ' on (kon.numer_kontrahenta = mp.kon_podmiot_odp) '
      ' where m.czy_miejscowy = '#39'N'#39' '
      ' and pm.czy_rozl_wart = '#39'N'#39' '
      ' and om.data_oper_mag between :BEGINNING and :ENDING '
      ' and (pm.pi_numer, pm.m_symbol) in '
      ' ( '
      ' select distinct om_k.dokument_obcy, om_k.m_symbol '
      ' from mk_operacje_mag om_k '
      ' where om_k.data_oper_mag between :BEGINNING and :ENDING '
      ' and om_k.stoo_symbol in ('#39'KI-'#39', '#39'KI+'#39') '
      ' and om_k.dokument_obcy is not null '
      ' ) '
      
        ' group by m.symbol, m.nazwa, mp.kon_podmiot_odp, kon.nazwa_wlasn' +
        'a, k.tresc, mp.ak_podmiot_odp, m.typ_magazynu')
    NonBlocking = True
    Left = 112
    Top = 64
    ParamData = <
      item
        DataType = ftDateTime
        Name = 'BEGINNING'
        ParamType = ptInput
        Value = nil
      end
      item
        DataType = ftDateTime
        Name = 'ENDING'
        ParamType = ptInput
        Value = nil
      end>
    object OraQuery2MAG_SYMBOL: TStringField
      FieldName = 'MAG_SYMBOL'
      Required = True
      Size = 3
    end
    object OraQuery2MAG_NAZWA: TStringField
      FieldName = 'MAG_NAZWA'
      Size = 40
    end
    object OraQuery2NAZWA_WLASNA: TStringField
      FieldName = 'NAZWA_WLASNA'
    end
    object OraQuery2ILE_INW: TFloatField
      FieldName = 'ILE_INW'
    end
    object OraQuery2CSN_PLUS: TFloatField
      FieldName = 'CSN_PLUS'
    end
    object OraQuery2CSN_MINUS: TFloatField
      FieldName = 'CSN_MINUS'
    end
    object OraQuery2CSN_SALDO: TFloatField
      FieldName = 'CSN_SALDO'
    end
    object OraQuery2DOP_STRATY: TFloatField
      FieldName = 'DOP_STRATY'
    end
    object OraQuery2CSN_OBROT: TFloatField
      FieldName = 'CSN_OBROT'
    end
    object OraQuery2ILE_JME_PLUS: TFloatField
      FieldName = 'ILE_JME_PLUS'
    end
    object OraQuery2ILE_JME_MINUS: TFloatField
      FieldName = 'ILE_JME_MINUS'
    end
    object OraQuery2AK_PODMIOT_ODP: TFloatField
      FieldName = 'AK_PODMIOT_ODP'
    end
    object OraQuery2CZY_FRANCZYZA: TStringField
      FieldName = 'CZY_FRANCZYZA'
      Size = 1
    end
    object OraQuery2ILE_PLUS: TFloatField
      FieldName = 'ILE_PLUS'
    end
    object OraQuery2ILE_MINUS: TFloatField
      FieldName = 'ILE_MINUS'
    end
    object OraQuery2STATUS: TStringField
      FieldName = 'STATUS'
      FixedChar = True
      Size = 6
    end
    object OraQuery2CZY_ZAMKNIETE: TStringField
      FieldName = 'CZY_ZAMKNIETE'
      FixedChar = True
      Size = 1
    end
    object OraQuery2KON_PODMIOT_ODP: TIntegerField
      FieldName = 'KON_PODMIOT_ODP'
    end
    object OraQuery2DATA_OD: TDateTimeField
      FieldName = 'DATA_OD'
    end
    object OraQuery2DATA_DO: TDateTimeField
      FieldName = 'DATA_DO'
    end
  end
  object OraQuery1: TOraQuery
    Session = OraSession1
    SQL.Strings = (
      'select :PARAM TEST'
      ' from dual')
    Left = 112
    Top = 16
    ParamData = <
      item
        DataType = ftDateTime
        Name = 'PARAM'
        ParamType = ptInput
        Value = nil
      end>
    object OraQuery1TEST: TDateTimeField
      FieldName = 'TEST'
    end
  end
end
Table scripts:

Code: Select all

create  table SLW_MAGAZYNY
(
  SYMBOL                             VARCHAR2(3)     NOT NULL ,
  NAZWA                              VARCHAR2(40)   ,
  BLOKADA                            VARCHAR2(1)     DEFAULT 'N',
  CZY_KRAJOWY                        VARCHAR2(1)     DEFAULT 'N' NOT NULL ,
  POWIERZCHNIA_M2                    NUMBER(8, 2)    DEFAULT 0 NOT NULL ,
  DZIENNY_KOSZT_M2                   NUMBER(10, 2)   DEFAULT 0 NOT NULL ,
  WARIANT_ROZLICZEN                  VARCHAR2(10)    DEFAULT 'FIFO' NOT NULL ,
  TYP_MAGAZYNU                       VARCHAR2(13)   ,
  CZY_MIEJSCOWY                      VARCHAR2(1)     DEFAULT 'T' NOT NULL ,
  SKO_NAZWA                          VARCHAR2(5)     NOT NULL ,
  PRA_NR_IDENTYFIKACYJNY             NUMBER(5, 0)    DEFAULT 0 NOT NULL ,
  AK_ID                              NUMBER(10, 0)   DEFAULT 0 NOT NULL ,
  SYSTEM                             VARCHAR2(1)     DEFAULT 'N' NOT NULL ,
  UTWORZONY_PRZEZ                    VARCHAR2(30)    NOT NULL ,
  DATA_UTWORZENIA                    DATE            NOT NULL ,
  MODYFIKOWANY_PRZEZ                 VARCHAR2(30)   ,
  DATA_MODYFIKACJI                   DATE           ,
  SKP_NAZWA                          VARCHAR2(10)   ,
  SRP_NAZWA                          VARCHAR2(10)   ,
  CYKL_DOSTAWY                       NUMBER          DEFAULT 0 NOT NULL ,
  PRIORYTET_OBSLUGI                  NUMBER         ,
  PODD_NUMER                         VARCHAR2(12)    DEFAULT '0' NOT NULL ,
  REP_EMAIL                          VARCHAR2(40)   ,
  ROCZNIK                            NUMBER(4, 0)    DEFAULT 0 NOT NULL ,
  DNI_PN                             CHAR(1)         DEFAULT 'T' NOT NULL ,
  DNI_WT                             CHAR(1)         DEFAULT 'T' NOT NULL ,
  DNI_SR                             CHAR(1)         DEFAULT 'T' NOT NULL ,
  DNI_CZ                             CHAR(1)         DEFAULT 'T' NOT NULL ,
  DNI_PT                             CHAR(1)         DEFAULT 'T' NOT NULL ,
  DNI_SO                             CHAR(1)         DEFAULT 'T' NOT NULL ,
  DNI_NI                             CHAR(1)         DEFAULT 'T' NOT NULL ,
  MIEJSCOWY_DLA_BAZY                 NUMBER(3, 0)   ,
  AK_ID_KOMIS                        NUMBER(10, 0)  ,
  SS_SYMBOL                          VARCHAR2(10)   ,
  TYP_CEN_SPRZ                       VARCHAR2(5)     DEFAULT 'DETAL' NOT NULL ,
  CZY_EKSPORTOWY                     VARCHAR2(1)     DEFAULT 'N' NOT NULL ,
  INFO_O_STANIE_TOWAROW              VARCHAR2(15)    DEFAULT 'NIE' NOT NULL ,
  DATA_OST_ZAM_AUTO                  DATE           ,
  CZY_FRANCZYZ                       VARCHAR2(1)    ,
  UMOWA_FRANCZYZ                     VARCHAR2(16)   ,
  UMOWA_FRANCZYZ_OD                  DATE           ,
  SLW_GR_CENOWE                      VARCHAR2(3)     DEFAULT 'STD',
  S_WALUTA                           VARCHAR2(3)    ,
  CZY_EWID_KARTONY                   VARCHAR2(1)     DEFAULT 'N' NOT NULL ,
  CZY_TRNSF                          VARCHAR2(1)     DEFAULT 'N' NOT NULL ,
  ZAM_AUTO_RODZAJ                    NUMBER(3, 0)    DEFAULT 0,
  CZY_UE                             VARCHAR2(1)     DEFAULT 'T' NOT NULL ,
  CZY_WYMIANA_BAZA_REP               VARCHAR2(1)     DEFAULT 'N')
/
 
 
create  table SLW_MAG_PARAM
(
  SYMBOL                             VARCHAR2(3)     NOT NULL ,
  KAS_POZ_TYPU_B                     VARCHAR2(1)     DEFAULT 'N' NOT NULL ,
  POZ_TYP_B_BEZ_STANU                VARCHAR2(1)     DEFAULT 'N' NOT NULL ,
  UTWORZONY_PRZEZ                    VARCHAR2(60)    NOT NULL ,
  MODYFIKOWANY_PRZEZ                 VARCHAR2(60)   ,
  DATA_UTWORZENIA                    DATE            NOT NULL ,
  DATA_MODYFIKACJI                   DATE           ,
  CZY_WYJATKI                        VARCHAR2(1)     DEFAULT 'N' NOT NULL ,
  WAL_SYMBOL                         VARCHAR2(3)     DEFAULT 'PLN' NOT NULL ,
  KRAJ_SYMBOL                        VARCHAR2(40)    DEFAULT 'POLSKA' NOT NULL ,
  WYROZNIK                           VARCHAR2(20)    DEFAULT 'BEZ ZNACZENIA' NOT NULL ,
  CZY_TRANSFER                       VARCHAR2(1)     DEFAULT 'N' NOT NULL ,
  ILE_PALET_MAG_1_DZIEN              NUMBER(3, 0)   ,
  ILE_PALET_CENT_1_DZIEN             NUMBER(3, 0)   ,
  CZY_INWENT                         VARCHAR2(1)     DEFAULT 'N' NOT NULL ,
  CZY_INWENT_SPEC                    VARCHAR2(1)     DEFAULT 'N' NOT NULL ,
  KON_PODMIOT_ODP                    NUMBER(8, 0)   ,
  AK_PODMIOT_ODP                     NUMBER(10, 0)  ,
  INW_EMAIL                          VARCHAR2(100)  ,
  KON_FRANCZYZA                      NUMBER(8, 0)   ,
  KIER_REGION                        NUMBER(5, 0)   ,
  EMAIL_KIER_REGION                  VARCHAR2(100)  ,
  EMAIL_PODM_ODP                     VARCHAR2(100)  )
/
 
create  table INW_PLAN_MAG
(
  ID                                 NUMBER(12, 0)   NOT NULL ,
  PI_NUMER                           VARCHAR2(15)    NOT NULL ,
  M_SYMBOL                           VARCHAR2(3)     NOT NULL ,
  STATUS                             VARCHAR2(20)    DEFAULT 'CZEKA' NOT NULL ,
  KONTROLER_HASLO                    VARCHAR2(30)   ,
  DATA_ODEBRANIA                     DATE           ,
  DATA_ROZPOCZECIA_FAKT              DATE           ,
  DATA_ZAKONCZENIA_FAKT              DATE           ,
  IRM_ID                             NUMBER(12, 0)  ,
  ZNK_NUMER                          VARCHAR2(17)   ,
  CZY_ROZL_WART                      VARCHAR2(1)     DEFAULT 'N' NOT NULL ,
  CZY_SALON                          VARCHAR2(1)     NOT NULL ,
  UTWORZONY_PRZEZ                    VARCHAR2(30)    NOT NULL ,
  DATA_UTWORZENIA                    DATE            NOT NULL ,
  MODYFIKOWANY_PRZEZ                 VARCHAR2(30)   ,
  DATA_MODYFIKACJI                   DATE           ,
  NR_WLASNY_INW                      VARCHAR2(10)   ,
  NIEDOBOR_ILOSC                     NUMBER(12, 2)   DEFAULT 0 NOT NULL ,
  NIEDOBOR_WARTOSC_CSN               NUMBER(12, 2)   DEFAULT 0 NOT NULL ,
  NIEDOBOR_WARTOSC_CZN               NUMBER(12, 2)   DEFAULT 0 NOT NULL ,
  NADWYZKA_ILOSC                     NUMBER(12, 2)   DEFAULT 0 NOT NULL ,
  NADWYZKA_WARTOSC_CSN               NUMBER(12, 2)   DEFAULT 0 NOT NULL ,
  NADWYZKA_WARTOSC_CZN               NUMBER(12, 2)   DEFAULT 0 NOT NULL ,
  SALDO_ILOSC                        NUMBER(12, 2)   DEFAULT 0 NOT NULL ,
  SALDO_CSN                          NUMBER(12, 2)   DEFAULT 0 NOT NULL ,
  SALDO_CZN                          NUMBER(12, 2)   DEFAULT 0 NOT NULL )
/
 
create  table MK_OPERACJE_MAG
(
  NUMER                              VARCHAR2(18)    NOT NULL ,
  ZNAK                               VARCHAR2(1)     NOT NULL ,
  DATA_OPER_MAG                      DATE            NOT NULL ,
  CZY_ANULOWANY                      VARCHAR2(1)     DEFAULT 'N',
  UWAGI                              VARCHAR2(60)   ,
  DOKUMENT_OBCY                      VARCHAR2(20)   ,
  WYROZNIK                           VARCHAR2(5)    ,
  AK_ID                              NUMBER(10, 0)   DEFAULT 0 NOT NULL ,
  STOO_SYMBOL                        VARCHAR2(3)     NOT NULL ,
  M_SYMBOL                           VARCHAR2(3)     NOT NULL ,
  ZOO_NUMER                          VARCHAR2(13)   ,
  DTK_NUMER                          VARCHAR2(13)   ,
  OOS_NUMER                          VARCHAR2(18)   ,
  OM_NUMER                           VARCHAR2(18)   ,
  UTWORZONY_PRZEZ                    VARCHAR2(30)    NOT NULL ,
  DATA_UTWORZENIA                    DATE            NOT NULL ,
  MODYFIKOWANY_PRZEZ                 VARCHAR2(30)   ,
  DATA_MODYFIKACJI                   DATE           ,
  ILOSC_JME                          NUMBER(12, 2)   DEFAULT 0 NOT NULL ,
  ILOSC_OPAK                         NUMBER(8, 2)    DEFAULT 0 NOT NULL ,
  WART_ZAK_NET                       NUMBER(14, 4)   DEFAULT 0 NOT NULL ,
  WART_ZAK_BRT                       NUMBER(12, 2)   DEFAULT 0 NOT NULL ,
  WART_RAB_BRT                       NUMBER(12, 2)   DEFAULT 0 NOT NULL ,
  WART_RAB_NET                       NUMBER(12, 2)   DEFAULT 0 NOT NULL ,
  WART_SPZ_NET                       NUMBER(12, 2)   DEFAULT 0 NOT NULL ,
  KOSZT_SKLADU                       NUMBER(10, 2)   DEFAULT 0 NOT NULL ,
  KOSZT_PRZEROBU                     NUMBER(10, 2)   DEFAULT 0 NOT NULL ,
  KON_NR_KONTRAHENTA                 NUMBER(8, 0)    DEFAULT 0 NOT NULL ,
  WART_SPZ_BRT                       NUMBER(12, 2)   DEFAULT 0 NOT NULL ,
  SPZ_NUMER                          VARCHAR2(17)   ,
  ILE_POM_BEDZIE                     NUMBER(4, 0)    DEFAULT 1 NOT NULL ,
  ILE_POM_JEST                       NUMBER(4, 0)    DEFAULT 0 NOT NULL ,
  DATA_CZAS_UTWORZENIA               DATE            NOT NULL ,
  PCE_NUMER                          VARCHAR2(12)    DEFAULT '0' NOT NULL ,
  PFK_NUMER                          VARCHAR2(12)    DEFAULT '0' NOT NULL ,
  PODD_NUMER                         VARCHAR2(12)    DEFAULT '0' NOT NULL ,
  WAGA_NETTO_KG                      NUMBER(10, 2)   DEFAULT 0 NOT NULL ,
  WAGA_BRUTTO_KG                     NUMBER(10, 2)   DEFAULT 0 NOT NULL ,
  OBJETOSC_M3                        NUMBER(10, 3)   DEFAULT 0 NOT NULL ,
  TRANSFER_NUM                       NUMBER(12, 0)   DEFAULT 0 NOT NULL ,
  PIF_NUMER                          VARCHAR2(12)    DEFAULT '0',
  MPK_SYMBOL                         VARCHAR2(10)   ,
  DOK_STAREGO_SYSTEMU                VARCHAR2(30)   ,
  CZY_FAKT_OPOZN                     VARCHAR2(1)     DEFAULT 'N' NOT NULL )
/
 
create  table MZ_KONFIG
(
  PARAM                              VARCHAR2(20)    NOT NULL ,
  TRESC                              VARCHAR2(240)  ,
  DATE_CREATED                       DATE           ,
  MODIFIED_BY                        VARCHAR2(30)   ,
  CREATED_BY                         VARCHAR2(30)   ,
  DATE_MODIFIED                      DATE           ,
  SYSTEM                             VARCHAR2(1)     DEFAULT 'N',
  KOMENTARZ                          VARCHAR2(240)  )
/
 
create  table KON_KONTRAHENT
(
  NUMER_KONTRAHENTA                  NUMBER(8, 0)    NOT NULL ,
  NAZWA_WLASNA                       VARCHAR2(20)   ,
  NAZWA_PELNA                        VARCHAR2(120)  ,
  NIP                                VARCHAR2(13)   ,
  REGON                              VARCHAR2(9)    ,
  PODATNIK_VAT                       VARCHAR2(1)     DEFAULT 'N',
  NAZWA_DOKUM_REJESTROWEGO           VARCHAR2(40)   ,
  NUMER_DOKUM_REJESTROWEGO           VARCHAR2(20)   ,
  CZY_JEST_KOPIA_DOKUM               VARCHAR2(1)     DEFAULT 'N',
  OPINIA_WYWIADOWNI                  VARCHAR2(256)  ,
  UWAGI                              VARCHAR2(256)  ,
  BLOKADA                            VARCHAR2(1)     DEFAULT 'N' NOT NULL ,
  KONTO_ROZRACHUNKOWE                VARCHAR2(14)   ,
  EMAIL                              VARCHAR2(120)  ,
  WWW                                VARCHAR2(100)  ,
  SSP_NAZWA                          VARCHAR2(10)    NOT NULL ,
  UTWORZONY_PRZEZ                    VARCHAR2(30)    NOT NULL ,
  DATA_UTWORZENIA                    DATE            NOT NULL ,
  MODYFIKOWANY_PRZEZ                 VARCHAR2(30)   ,
  DATA_MODYFIKACJI                   DATE           ,
  SYSTEM                             VARCHAR2(1)     DEFAULT 'N',
  KRS                                VARCHAR2(10)   ,
  NR_BAZY                            NUMBER(3, 0)    NOT NULL ,
  CZY_OSOBA_FIZYCZNA                 VARCHAR2(1)     DEFAULT 'N' NOT NULL ,
  CZY_KON_POWIAZANY                  VARCHAR2(1)     DEFAULT 'N' NOT NULL ,
  PCE_NUMER                          VARCHAR2(12)    DEFAULT '0' NOT NULL ,
  PODD_NUMER                         VARCHAR2(12)    DEFAULT '0' NOT NULL ,
  PESEL                              VARCHAR2(11)   ,
  CZY_UNIJNY                         VARCHAR2(1)     DEFAULT 'N' NOT NULL ,
  NIP_KOD_UE                         VARCHAR2(2)    ,
  NIP_SI                             VARCHAR2(13)   )
/

Re: Field type mismatch exception at runtime - only when using Direct Connection + NonBlocking mode

Posted: Mon 20 Jun 2016 14:15
by AlexP
Hello,

Thank you for the sample. We have reproduce the issue and will investigate the reasons for such behavior.

Re: Field type mismatch exception at runtime - only when using Direct Connection + NonBlocking mode

Posted: Tue 21 Jun 2016 06:05
by pcz
OK :)

PS. Type casting is a quick fix for this problem

Code: Select all

[...]
:BEGINNING data_od, :ENDING data_do
[...]
=>

Code: Select all

[...]
CAST(:BEGINNING AS DATE) data_od, CAST(:ENDING AS DATE) data_do
[...]

Re: Field type mismatch exception at runtime - only when using Direct Connection + NonBlocking mode

Posted: Tue 21 Jun 2016 09:38
by AlexP
Yes, as a workaround, you can use type cast or DataTypeMapping https://www.devart.com/odac/docs/?data_type_mapping.htm . We will try to fix this behavior as soon as possible.

Re: Field type mismatch exception at runtime - only when using Direct Connection + NonBlocking mode

Posted: Tue 28 Jun 2016 05:41
by pcz
Looks like it happens in 9.7.25 too...

What is funny EDatabaseError "Type mismatch for field..." sometimes happens in pair with:

ORA-01013: user requested cancel of current operation tips
Image

ORA-03113: end-of-file on communication
Image

These 2 extra errors usually happens a bit randomly - more often when I close project file and reopen + recompile it
Most usual is ORA-01013, ORA-03113 is rare
After more runs with several ORA-01013 they disappear at all


I'm testing it with Oracle 10g Release 10.2.0.1.0 - 64bit Production

Re: Field type mismatch exception at runtime - only when using Direct Connection + NonBlocking mode

Posted: Thu 30 Jun 2016 08:47
by AlexP
Unfortunately, we haven't found an opportunity to change this behavior.

Re: Field type mismatch exception at runtime - only when using Direct Connection + NonBlocking mode

Posted: Thu 30 Jun 2016 09:14
by pcz
AlexP wrote:Unfortunately, we haven't found an opportunity to change this behavior.
Life ;)
Luckily it's not such a horrible fatal error
Thanks for investigation

Re: Field type mismatch exception at runtime - only when using Direct Connection + NonBlocking mode

Posted: Thu 30 Jun 2016 14:28
by AlexP
We will continue investigation of this case. As soon as we get any results, we will let you know.