mORMot and Open Source friends
Check-in [bdf361b8e8]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:fixed unexpected exception raised if SQL_NO_DATA is returned
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: bdf361b8e8a3b624596aa5fad639a75c3f7de2b8
User & Date: abouchez 2012-12-11 11:20:38
Context
2012-12-11
12:20
fixed potential comparison error in TSynTableFieldProperties.SortCompare() when sorting UTF8 Field with tfoCaseInsensitive in Options check-in: 12b3ab6c7f user: abouchez tags: trunk
11:20
fixed unexpected exception raised if SQL_NO_DATA is returned check-in: bdf361b8e8 user: abouchez tags: trunk
11:04
updated TInterfaceStub and TInterfaceMock classes implementation to allow named parameters in TOnInterfaceStubExecuteParamsVariant kind of Executes() callback - this is the new recommended implementation pattern of Executes() fluent interface; updated the documentation check-in: f2408976e7 user: abouchez tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to SynDBODBC.pas.

50
51
52
53
54
55
56

57
58
59
60
61
62
63
....
1390
1391
1392
1393
1394
1395
1396
1397


1398
1399
1400
1401
1402
1403
1404
  - initial working code, tested with ODBC Oracle provider

  Version 1.18
  - circumvent restriction of some non-Unicode ODBC drivers to use SQL_C_CHAR
    parameter binding instead of SQL_C_WCHAR (e.g. Microsoft Oracle ODBC)
  - circumvent restring of some drivers which expect SQLExpect() columns to be
    retrieved in left-to-right order

  - fixed ticket [4c68975022] about broken SQL statement when logging active

  TODO:
  - implement array binding of parameters
    http://msdn.microsoft.com/en-us/library/windows/desktop/ms709287
  - implement row-wise binding when all columns are inlined 
    http://msdn.microsoft.com/en-us/library/windows/desktop/ms711730
................................................................................
          DriverDoesNotHandleUnicode := true;
          VData := RawUnicodeToUtf8(pointer(VData),StrLenW(pointer(VData)));
          goto retry; // circumvent restriction of non-Unicode ODBC drivers
        end;
        ODBC.Check(status,SQL_HANDLE_STMT,fStatement);
      end;
    // 2. execute prepared statement
    ODBC.Check(ODBC.Execute(fStatement),SQL_HANDLE_STMT,fStatement);


  finally
    // 3. release and/or retrieve OUT bound parameters
    for p := 0 to fParamCount-1 do
    with fParams[p] do
    case VType of
      ftCurrency:
        if VInOut<>paramIn then






>







 







|
>
>







50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
....
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
  - initial working code, tested with ODBC Oracle provider

  Version 1.18
  - circumvent restriction of some non-Unicode ODBC drivers to use SQL_C_CHAR
    parameter binding instead of SQL_C_WCHAR (e.g. Microsoft Oracle ODBC)
  - circumvent restring of some drivers which expect SQLExpect() columns to be
    retrieved in left-to-right order
  - fixed unexpected exception raised if SQL_NO_DATA is returned 
  - fixed ticket [4c68975022] about broken SQL statement when logging active

  TODO:
  - implement array binding of parameters
    http://msdn.microsoft.com/en-us/library/windows/desktop/ms709287
  - implement row-wise binding when all columns are inlined 
    http://msdn.microsoft.com/en-us/library/windows/desktop/ms711730
................................................................................
          DriverDoesNotHandleUnicode := true;
          VData := RawUnicodeToUtf8(pointer(VData),StrLenW(pointer(VData)));
          goto retry; // circumvent restriction of non-Unicode ODBC drivers
        end;
        ODBC.Check(status,SQL_HANDLE_STMT,fStatement);
      end;
    // 2. execute prepared statement
    status := ODBC.Execute(fStatement);
    if not (status in [SQL_SUCCESS,SQL_NO_DATA]) then
      ODBC.HandleError(status,SQL_HANDLE_STMT,fStatement,false,sllNone);
  finally
    // 3. release and/or retrieve OUT bound parameters
    for p := 0 to fParamCount-1 do
    with fParams[p] do
    case VType of
      ftCurrency:
        if VInOut<>paramIn then