Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-7170

Error [30000] [42Y07]: Schema 'SA' does not exist when joining SYS.SYSTABLES to SYS.SYSSCHEMAS when aliasing the SYSCHEMAS table

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 10.17.1.0
    • None
    • SQL
    • None
    • Normal
    • Repro attached, Workaround attached
    • Seen in production

    Description

      On a fresh database connection using org.apache.derby.jdbc.EmbeddedDriver, using username "sa", and this URL, for example: "jdbc:derby:C:\Users\lukas\.data\derby\test", I'm trying to run this query in Dbeaver:

       SELECT
        a.SCHEMANAME,
        SYS.SYSTABLES.TABLENAME
      FROM
        SYS.SYSTABLES
      JOIN SYS.SYSSCHEMAS AS a ON
        SYS.SYSTABLES.SCHEMAID = a.SCHEMAID
      

      It fails with this error:

      > SQL Error [30000] [42Y07]: Schema 'SA' does not exist

      Avoiding the alias is a valid workaround:

      SELECT
        SYS.SYSSCHEMAS.SCHEMANAME,
        SYS.SYSTABLES.TABLENAME
      FROM
        SYS.SYSTABLES
      JOIN SYS.SYSSCHEMAS ON
        SYS.SYSTABLES.SCHEMAID = SYS.SYSSCHEMAS.SCHEMAID
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            lukas.eder Lukas Eder
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: