Global Data Management Forum

 View Only
  • 1.  EntityFrameworkCore Code First on As400 DB2

    Posted Tue January 05, 2021 08:58 AM
    Edited by System Fri January 20, 2023 04:19 PM
    Hi,
    I am working with EntityFramework Core Code First on DB2. I want to create table that what i generated entity class on Visual Studio.
    On Mackage Manager Console I did "add-migration [title]" and genertaed migration classes. For creating tables i run "Update-Database" code from Package Manager Console  then the following error thrown.

    Failed executing DbCommand (191ms) [Parameters=[], CommandType='Text', CommandTimeout='0']
    SELECT CAST (Count(*) AS INT) AS DEFCOUNT from SYSIBM.SYSTABLES as t where TRIM(t.NAME)= 'EFMIGRATIONSHISTORY';
    and 
    ERROR [42704] [IBM][AS] SQL0204N "SYSIBM.SYSTABLES" is an undefined name.

    I can't see SYSIBM.SYSTABLES table in database.
    Code First Update Database Error on PM Console
    AS400 Version: V7R1

    Can you help me?
    Best regards


    ------------------------------
    murat in
    ------------------------------
    #DataManagementGlobal
    #DataServerDrivers


  • 2.  RE: EntityFrameworkCore Code First on As400 DB2

    Posted Fri January 21, 2022 09:25 AM
    Hi:
    I have the same error. Have you managed to solve it?


    ------------------------------
    Noemi Bajo Breton
    ------------------------------



  • 3.  RE: EntityFrameworkCore Code First on As400 DB2

    Posted Mon January 24, 2022 05:17 AM
    Edited by System Fri January 20, 2023 04:28 PM
    Hi,
    i'm not really familiar with iseries but maybe your schema is wrong.
    I had  some experiences with iseries and know that there are some differences.
    The documentation says
    The IBM® i catalog includes the views and tables in the QSYS2 schema displayed in this section.
    so
    SYSIBM.SYSTABLES
    should be
    QSYS2.SYSTABLES

    It can also be under QSYS according to this entry in documentation.
    These tables and views exist in schemas QSYS and QSYS2.

    So you can check both.

    kind regards
    Joachim Stumpf

    ------------------------------
    joachim stumpf
    ------------------------------



  • 4.  RE: EntityFrameworkCore Code First on As400 DB2

    Posted Mon January 24, 2022 05:28 AM
    Hi,
    Thanks for replying, but I don't think that's the problem. My schema is another parallel to SYSIBM. Greetings, Naomi.


    ------------------------------
    Noemi Bajo Breton
    ------------------------------