Orm, Firedac, Firebird create index sqlrewriter double Quoted on null result

Home Forums kbmMW Orm, Firedac, Firebird create index sqlrewriter double Quoted on null result

Viewing 3 reply threads
  • Author
    Posts
    • #55501
      Ismet Sonmez
      Participant

      Hi,

      On firebird cant create pk with orm.

      kbmCustomSqlMetaData lin 1.069

      AResult:=(q.FieldCount>0) and (q.Fields[0].AsInteger>0);

      Sql result is empty, and code is cant access q.Fields[0].AsIneteger

      sample orm def;

      [kbmMW_Table(‘name:SYSUSER, index:{name:PK_SYSUSER, unique:true, field:OID}’)]
      TSYSUSER = class
      private
      FOID:integer;
      FUSERCODE:kbmMWNullable<string>;
      FUSERNAME:kbmMWNullable<string>;
      public
      [kbmMW_Field(‘name:OID, primary:true’, ftInteger, 4)]
      [kbmMW_NotNull]
      property OID:integer read FOID write FOID;

      [kbmMW_Field(‘name:USERCODE’, ftString, 50)]
      property USERCODE:kbmMWNullable<string> read FUSERCODE write FUSERCODE;

      [kbmMW_Field(‘name:USERNAME’, ftString, 50)]
      property USERNAME:kbmMWNullable<string> read FUSERNAME write FUSERNAME;

       

      Index creating sql result empty because double quoted str on PK_SYSUSER sql line 2;

      SELECT
      ”PK_SYSUSER” AS index_name,
      NULL AS table_catalog,
      NULL AS table_schema,
      NULL AS system, RDB$INDICES.RDB$RELATION_NAME AS table_name,
      RDB$INDEX_SEGMENTS.RDB$FIELD_NAME AS column_name,
      (RDB$INDEX_SEGMENTS.RDB$FIELD_POSITION + 1) AS column_position,
      CASE RDB$INDICES.RDB$INDEX_TYPE WHEN 1 THEN 1 ELSE 0 END AS column_descending,
      RDB$UNIQUE_FLAG as Index_Unique
      FROM RDB$INDEX_SEGMENTS
      LEFT JOIN RDB$INDICES ON RDB$INDICES.RDB$INDEX_NAME = RDB$INDEX_SEGMENTS.RDB$INDEX_NAME
      LEFT JOIN RDB$RELATION_CONSTRAINTS ON RDB$RELATION_CONSTRAINTS.RDB$INDEX_NAME = RDB$INDEX_SEGMENTS.RDB$INDEX_NAME
      WHERE UPPER(RDB$INDICES.RDB$RELATION_NAME)=”SYSUSER”
      AND UPPER(RDB$INDICES.RDB$INDEX_NAME)=”PK_SYSUSER”
      ORDER BY RDB$INDEX_SEGMENTS.RDB$FIELD_POSITION

    • #55542
      kimbomadsen
      Keymaster

      Hi,

      I think you may be missing to provide an Interbase Metadata component and hook it to your connection pool?

      Then it will fall back to a default generic metadata instance, which in turn have double quote as default string quote character.

      best regards

      Kim/C4D

    • #55553
      Ismet Sonmez
      Participant

      I’ve tried different combinations, different problems have arisen,

      I keep debugging

      object kbmMWFireDACConnectionPool1: TkbmMWFireDACConnectionPool
      MetaData = mwMeta
      Rewriter = kbmMWInterbaseSQLRewriter1
      Database = fdCon
      Left = 336
      Top = 64
      end
      object kbmMWInterbaseSQLRewriter1: TkbmMWInterbaseSQLRewriter
      MetaData = mwMeta
      Left = 424
      Top = 120
      end
      object mwMeta: TkbmMWInterbaseMetaData
      FieldNameQuote = ‘”‘
      FieldNameCase = mwncUnaltered
      TableNameQuote = ‘”‘
      TableNameCase = mwncUnaltered
      QuoteAllFieldNames = False
      QuoteTableName = False
      StringQuote = #39
      QuoteStringQuote = #39
      DateLayout = ‘d/MM/yyyy’
      TimeLayout = ‘hh:mm:ss’
      DateTimeLayout = ‘d/MM/yyyy hh:mm:ss’
      TrueValue = ‘True’
      FalseValue = ‘False’
      Left = 304
      Top = 128
      end

    • #55554
      Ismet Sonmez
      Participant

      TkbmMWCustomSQLMetaData.FormatString(const AString:string):string;

      line 638 “if FStringQuote=#0 then”  FStringQuote =”

      not seeing  #39 in interbase metadata

      as it creates  custommetadata itself
      I gave up

Viewing 3 reply threads
  • You must be logged in to reply to this topic.