cancel
Showing results for 
Search instead for 
Did you mean: 

Creating a Sybase IQ View that queries using wildcard names

Former Member

Hi all,

I'm working on a Sybase IQ 16 database that partitions data in distinct tables for each day, e.g:

my_table_20180320

my_table_20180319

my_table_20180318

....


Every day a new table is created and the oldest table is dropped.

I was wondering if it is possible to create a view that always selects everything from all tables with the name like "my_table_***"

I know this can be archieved with stored procedures, but I specifically need to create a View.

Any help is appreciated.

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member188958
Active Contributor

Could you instead partition by day of the month and instead of dropping and creating tables, truncate and repopulate?
The view could then union tables my_table_01 ... my_table_31. The selects for days 29, 30, and 31 would include
a where clause so it would only produce results in the appropriate months (don't forget leap years!).

0 Kudos

Wildcard tables are not currently supported in SAP IQ.

Your view definition must include all of the tables that you wish to include in the view.