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

Support more than just varchar with vertical bars on query

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 10.1.2.1
    • None
    • SQL
    • Relevant for this? Windows XP
    • Low

    Description

      I'm not sure if this is ij or derby proper, but the concat operator || should work for just about any data type. Derby is zero maintenance, but data rarely is, and a good sql interface is important. Often it's very convenient to write a query that generates other sql statements and that's difficult w/o concatination.

      e.g. create a table with a timestamp column, assume that the column name is originated.

      Try the following query:

      ij> select month(originated) || '-' || year(originated) from review;

      get the following error:

      ERROR 42846: Cannot convert types 'INTEGER' to 'VARCHAR'.

      The conversion to a string should pretty much work all the time unless the operand is some sort of blob type.

      Attachments

        Activity

          People

            Unassigned Unassigned
            billrobertson42 Bill Robertson
            Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: