question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Exception while querying table schema

See original GitHub issue

Hi,

I want to get a table schema from Snowflake using the query below but I got the error that says:

No enum constant net.snowflake.client.jdbc.SnowflakeType.FİXED

Here is my code:

val connection = getConnection()
val statement: PreparedStatement = connection.prepareStatement("SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = ?")
statement.setString(1, tableName);
return  statement.executeQuery()

Can you tell me what’s wrong with this code?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
smtakedacommented, Nov 15, 2019

hmm, this test case doesn’t reproduce it.

  @Test
  public void testInformationSchemaColumns() throws Throwable
  {
    try (Connection con = getConnection())
    {
      con.createStatement().execute("create or replace table t(c1 int)");
      try
      {
        PreparedStatement pstmt = con.prepareStatement(
            "SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME=?");
        pstmt.setString(1, "T");
        ResultSet rset = pstmt.executeQuery();
        assertTrue(rset.next());
        assertEquals(rset.getInt(5), 1);
      }
      finally
      {
        con.createStatement().execute("drop table if exists t");
      }
    }
  }

0reactions
smtakedacommented, Nov 15, 2019

ok, glad to hear you found the solution.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Exception tables - IBM
Querying exception tables. The message column structure in an exception table is a concatenated list of constraint names, lengths, and delimiters, as described ......
Read more >
SQL error messages and exceptions - Oracle Help Center
In an ALTER TABLE statement, the column ' <columnName> ' has been specified as NOT NULL and either the DEFAULT clause was not...
Read more >
Object not found when executing query with table in a schema
I see the schema creation in the generated ddl statements as well as in the query in the stacktrace.
Read more >
Resolve "GENERIC_INTERNAL_ERROR" when querying ...
You have a schema mismatch between the data type of a column in table definition and the actual data type of the dataset....
Read more >
Database Engine events and errors - SQL Server
Maximum number of tables in a query (%d) exceeded. ... 928, 20, Yes, During upgrade, database raised exception %d, severity %d, state %d, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found