Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Sybase] Computed Index Columns #23450

Open
cceelen opened this issue Apr 17, 2024 · 1 comment
Open

[Sybase] Computed Index Columns #23450

cceelen opened this issue Apr 17, 2024 · 1 comment

Comments

@cceelen
Copy link

cceelen commented Apr 17, 2024

Description

Computed index columns are displayed as columns part of the table and the Sybase internal name for the computed column is used in the DDL generated for the index.

DBeaver Version

Community Edition 24.0.1.202403241413

Operating System

Windows 11

Database and driver

Sybase ASE 15.x and 16
jConnect (TM) for JDBC(TM)/16.0 SP03 PL02 (Build 27403)/P/EBF27518/JDK 1.6.0/jdbcmain/OPT/Mon Aug 28 18:41:14 PDT 2017
https://mvnrepository.com/artifact/com.sap.jconnect/jconn4

Steps to reproduce

  1. Use any table e.g.
    `CREATE TABLE TEST..TEST(iden numeric(18), val varchar(16) )
    GO'
    After creation the table has 2 columns in the columns display in DBeaver
  2. Create an index on the same table with a computed column:
    CREATE INDEX I_TEST on TEST..TEST (iden, upper(val)) GO
    Now the table has 3 columns:
    image
    And the DDL generated for this table by DBeaver is:
    CREATE TABLE WORKPLANNING.dbo.TEST ( iden numeric(18,0) NOT NULL, val varchar(16) NOT NULL, sybfi2_1 varchar(16) NULL ); CREATE INDEX I_TEST ON WORKPLANNING.dbo.TEST (iden,sybfi2_1);

Additional context

You can setup a local Sybase DB quickly using this docker image:
https://hub.docker.com/r/superbeeeeeee/docker-sybase
https://github.com/cboudereau/docker-sybase

@cceelen
Copy link
Author

cceelen commented Apr 17, 2024

NB. For materialized functions, computed columns and similar Sybase will associate the function as an entry in the system table 'syscolumns' linked to the source table and also associate rows in 'syscomments' to that column that contain the code of the function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants