Does anyone know of any Oracle dictionary views that hold references of 'real' columns to virtual columns?
For example lets say I have a table like this:
create table t (
c1 varchar2(5)
,c2 as (c1 || '*')
)
I'm after a way of determining that c1…
Here's a table
create table tq84_virtual_test_without (
col_1 number,
col_2 number,
col_3 number,
col_4 number,
col_5 number
);
with the rule that col_5's value is the sum of the other four columns.
So the table is filled…
I'm trying to create a table in OracleDB and assign random number to one of the columns as a default. I have this setup working in postgresql
create table table_name (
column integer NOT NULL DEFAULT (random())
)
how can I do something similar…
Starting reading point: https://www.percona.com/blog/2015/04/29/generated-virtual-columns-in-mysql-5-7-labs/
Running some tests with the most recent percona 5.7 they seem to work well. Explain plans and wall time look pretty good but I'm not seeing…
My query is
SELECT
(`house_rent`+`conveyance`+`medical`+`dearness`+`others_allowances`) AS earnings
,(`income_tax`+`pro_tax`+`emp_state_insu`+`absence_fine`+`others_deductions`) AS deductions
,(earnings - deductions) AS net_salary…
I'm just running a command:
optimize table some_table_name_here;
But it results with:
Table | Op | Msg_type | Msg_text
db.some_table_name_here | optimize | note | Table does not support optimize, doing recreate + analyze…
In SQL database that stores Images in a parcelImages table.Since each parcel can take part in multiple Images and each images can involve multiple parcels.
I want to get each parcel having Image value with comma separated values as shown above
I…
I have a SQL Server 2000 database used by our ERP system.
There are many columns that always have the same value. A table row is really huge, potentially exceeding the maximum row size in SQL Server 2000 (8kB).
I'm thinking about replacing these…
ALTER TABLE TAB_NAME ADD TEST_COL VARCHAR2(255);
ALTER TABLE TAB_NAME MODIFY TEST_COL GENERATED ALWAYS as ('some_exp') VIRTUAL;
Second script gives an error:
Error report -
ORA-54026: Real column cannot have an expression
54026. 0000 - "Real…
We use statement based bin log master-slave replication with MySQL 5.7.
We use the slave for analytics and so add additional indexes and things not required on the master.
I recently tried to add a virtual column and indexed it.
Unfortunately, it…
I have a table
id name
1 Alpha
2 Alpha
3 Beta
4 Charlie
5 Charlie
I want to assign a temporary id at the run time in the SQL statement, So the desired result should be like
myid name
1 Alpha
2 Beta
3 Charlie
So basically the…
I'm wondering whether exists any database engine that can share cells or rows amongst many tables. For example:
TABLE Customer (
CID: int
Fullname: nvarchar(50)
Age: int
)
TABLE Group (
GID: int
Name: nvarchar(50)
)
TABLE…
I'm not sure what technology I need because I'm not a DBA, but I'm sure there's a good way to do this.
I have a postgres database with this schema (top two tables exist):
So I'm trying to add the 3rd table to the database. It's a subset of…
What is the intended use case for virtual columns with a function-based index?
The reason I ask (novice):
I've been exploring options for pre-computing columns in a table. For example, in a roads table, populate a field using the…
In our environment, we usually add and drop generated columns every now and then. There is a very large table in the database with more than 3 million rows and adding/removing column was extremely slow. We opted to change the generated column from…