#639 Unable to switch database

All
closed-fixed
Rob Manning
8
2009-01-31
2008-06-17
Heiko Adams
No

When trying to switch the database to following error message occurs:
"Error: Eintrag in sysdatabases für die "KigaPRO"-Datenbank konnte nicht gefunden werden. Kein Eintrag mit diesem Namen wurde gefunden. Stellen Sie sicher, dass der Name richtig eingegeben wurde.
SQLState: S0001
ErrorCode: 911"

For me it seems that squirrel is using the qouted name which can't be found in sysdatabases table of course because sysdatabases doesn't contain quoted entries.

Discussion

1 2 3 > >> (Page 1 of 3)
  • Heiko Adams
    Heiko Adams
    2008-06-17

    • milestone: 816968 --> All
     
  • Logged In: NO

    I have been having this issue since upgrading to 2.6.x as well. Changing the catalog gives me this error:

    Error: Could not locate entry in sysdatabases for database '"QADB"'. No entry found with that name. Make sure that the name is entered correctly.
    SQLState: S0001
    ErrorCode: 911

     
  • Heiko Adams
    Heiko Adams
    2008-06-27

    • priority: 5 --> 8
     
  • Heiko Adams
    Heiko Adams
    2008-06-27

    Logged In: YES
    user_id=503730
    Originator: YES

    The problem is still present in the latest snapshot.

     
  • Logged In: NO

    Same here, cannot switch between catalogs in v2.6.6 with MSSQL Server:

    Error: Could not locate entry in sysdatabases for database '"GEORGE"'. No entry found with that name. Make sure that the name is entered correctly.
    SQLState: 08004
    ErrorCode: 911

    I can connect by maintaining a list of aliases each pointing to the catalog I need (databaseName=GEORGE).

    I can only view the current catalog in the objects view, but can run SQL over other catalogs.

     
  • I downloaded the source and modified the file, because couldn't do my work without MSSQL connections.

    The problem seems to be in net.sourceforge.squirrel_sql.fw.sql in the SQLConnection.java file. Looks like in cases where there's a . in the catalog name, MSSQL crashes, so they blanket added quotes around the catalogue.

    line 359 just says conn.setCatalog(quote(catalogName));

    I added an if statement to verify that there was a period before wrapping in quotes.

    /\*\*
     \* MS SQL Server throws an exception if the catalog name contains a period without it being quoted.
     \* 
     \* @param catalogName
     \*           the catalog name to use
     \* @throws SQLException
     \*            if an error occurs
     \*/
    private void setMSSQLServerCatalog\(String catalogName\) throws SQLException \{
        final Connection conn = getConnection\(\);
        if \(catalogName.contains\("."\)\) \{
            conn.setCatalog\(quote\(catalogName\)\);
        \} else \{
            conn.setCatalog\(catalogName\);
        \}
    \}
    

    Cheers,
    Daul Hill.

     
  • Rob Manning
    Rob Manning
    2008-10-30

    I am definitely missing something here. I have both SQLServer 2005 and 2000 installed. I can change the catalog fine. But I cannot change the catalog fine if I don't use quotes around the catalog when it contains a period or a space:

    use db.with.periods;
    use db with spaces;

    Both of these commands fail for me. They only succeed if I quote them :

    use "db.with.periods";
    use "db with spaces";

    We can certainly only quote when "." or " " are found in the catalog, but unusual db names such as the above must be quoted or else you get something like this:

    Error: Could not locate entry in sysdatabases for database 'db'. No entry found with that name. Make sure that the name is entered correctly.
    SQLState: S0001
    ErrorCode: 911

    Would someone who is having this issue with switching catalogs like to try creating a database with "." or " " in it's name and let me know how you switched the catalog using SQL, without quoting the identifier ?

    Rob

     
  • Hi, I have the same problem, please tell me if you found a solution

     
  • Ok. I guess it seems that there is an issue more with the description of the problem. We're not having problems switching catalogs by typing "use 'db.whatever'" in the sql window. I'll probably even guess that most of us complaining about this issue didn't even know you could do that.

    What we are complaining about is switching catalogs using the gui. If you try to change catalogs using the drop down combobox in the top left hand corner, then you receive the following:

    Error: Could not locate entry in sysdatabases for database '"QADB"'. No
    entry found with that name. Make sure that the name is entered correctly.
    SQLState: S0001
    ErrorCode: 911

    I even tried using the dropdown box with a catalog containing a period, and the version that quotes the catalog doesn't work. I built a version that doesn't quote the catalog, and it works. So the code that I submitted before, won't work on the gui for catalogs with periods in their names. It should just be:

    private void setMSSQLServerCatalog(String catalogName) throws
    SQLException {
    final Connection conn = getConnection();
    conn.setCatalog(catalogName);
    }

    Cheers,
    Daul Hill

     
  • Rob Manning
    Rob Manning
    2008-12-04

    Daul,

    No, I think I understand the problem well enough, I just failed to accurately describe what I see. I am using the catalog drop-down as well. But when I remove the quoting code in SQLConnection and attempt to switch to my "db.with.periods" catalog, I get :

    Error: Could not locate entry in sysdatabases for database 'db'. No entry found with that name. Make sure that the name is entered correctly.
    SQLState: S0001
    ErrorCode: 911

    I have uploaded a screencast of my desktop session where I demonstrate the problem with the proposed solution to comment out the quote method in SQLConnection. As you will see in the video, I can't use the catalog drop-down to change the catalog to "db.with.spaces". Here is the short video (1.9MB) in ogg format :

    http://www.squirrelsql.org/screencast/unquoted_identifier_demo.ogg

    At the moment I suspect that it's a problem with how the database is configured, since you and I seem to get the opposite result.

    Rob

     
1 2 3 > >> (Page 1 of 3)