Loading Metadata XML

Answered

Comments

10 comments

  • Avatar
    Minieggs

    Also what is being used in the MSSQL database to determine the value for the case_sens attribute

    Thanks

    0
    Comment actions Permalink
  • Avatar
    Sergey Smagin (Product manager)

    Hello,

    Size is the size of field in symbols. Meaningful for string data types only. You can fill it from the CHARACTER_MAXIMUM_LENGTH column.

    "case_sens" must be false for MS SQL Server as this server treats all identifiers as case insensitive.

    0
    Comment actions Permalink
  • Avatar
    Minieggs

    Thanks very much

    If I create this XML doc by hand is the type element important in the sense I am not using .NET only ActiveX

    <type platform="net">Decimal</type>

    0
    Comment actions Permalink
  • Avatar
    Sergey Smagin (Product manager)

    You should keep the platform="net" attribute. Otherwise you'll have to enter numeric codes for your data types. The following values are acceptable for the Type property: Object, AnsiString, Int16, Int32, UInt16, Boolean, Double, Currency, Decimal, Date, Time, DateTime, Binary, AnsiStringFixedLength, String, Int64, GUID.

    0
    Comment actions Permalink
  • Avatar
    Minieggs

    I've just used this little tool to get all the unique element names from MetaData XML

    http://taporware.ualberta.ca/~taporware/xmlTools/listxml.shtml

    There are two more i'm not quite sure where to get the info from as it does not seem to be in INFORMATION_SCHEMA.COLUMNS

    That is for readonly and primary_key

    Also this sample MetaData was created using your editor and it seems to have a mix of case_sens=0 and 1 against a mssql database ?

    Thanks again as always

    0
    Comment actions Permalink
  • Avatar
    ActiveDBSoft support team

    Hi,

    MSSQLSyntaxProvider uses sys.indexes and sys.index_columns system views to calc primary key flag.

    AQB currently does not use "readonly" attribute, so you can omit it in generated XML.

    For case-insensitive SQL dialects like TransactSQL case_sens=0 is the better choice.

    Please note - there are XSD schema exists for metadata XML format, which describes all possible attributes for all type of nodes in metadata XML file. The reference to this schema present in the header of every metadata file saved by QueryBuilder. Advanced XML editors can use this schema for code completion while you editing the document, and verify correctness of result XML.

    0
    Comment actions Permalink
  • Avatar
    Minieggs

    Thanks

    and finally (hopefully!)

    Do you have any general problems with people using your control and not having permissions to INFORMATION_SCHEMA i.e. by default 'normal' users do not tend to have read permissions for this INFORMATION_SCHEMA database ?

    0
    Comment actions Permalink
  • Avatar
    Sergey Smagin (Product manager)

    We use various ways of loading metadata: querying the INFORMATION_SCHEMA, getting lists of columns by preparing a "SELECT * FROM table" query, querying specific methods of OLE DB provider.

    We haven't had any problems with this.

    0
    Comment actions Permalink
  • Avatar
    Minieggs

    OK I have successfully added a view to the metadata and it shows up how I would expect

    However when I choose columns they appear in the expression grid as

    database.dbo.table.field

    rather than if online mode was used to load the data when it would be

    table.field

    I tried setting the MetDataContainer.DefaultDatabase but that did not seem to make any difference ?

    Thanks

    0
    Comment actions Permalink
  • Avatar
    Sergey Smagin (Product manager)

    Default database and schemas should be defined either in the XML file or after the file is loaded to the MetadataContainer.

    0
    Comment actions Permalink

Please sign in to leave a comment.