Is there a way to check if a column is virtual in java?

I want to know if there is a way to check if a table column is virtual in java? I tried to get ResultSetMetaData out of luck:

rsmd.isWritable(column);
rsmd.isReadOnly(column);
rsmd.isDefinitelyWritable(column);

I need to check if this is a virtual column to find out if I need to insert / modify it or not, any ideas?

+4
source share
1 answer

As Maheshvaran Raviskanar has already said, the only way to get this information is to run a query on the database. Perhaps there is a Java function that performs this particular operation, but I doubt it. The following query should do this for you:

select VIRTUAL_COLUMN from ALL_TAB_COLS where OWNER = :1 and TABLE_NAME = :2 and COLUMN_NAME = :3;

YES or NO (YES = column - ).

: Oracle .

0

All Articles