Display View Column Data Types: Quick Tip

Like table columns, view columns also have a data type. You can display the data types of view columns by querying the VIEW_COLUMNS system table….

OpenText  profile picture
OpenText

October 25, 20181 min read

Like table columns, view columns also have a data type. You can display the data types of view columns by querying the VIEW_COLUMNS system table.

Example:

dbadmin=> CREATE VIEW MyAccount_View AS SELECT * FROM public.MyAccount;
CREATE VIEW

dbadmin=> SELECT column_name, data_type FROM view_columns
WHERE table_schema = ‘public’ AND table_name = ‘MyAccount_View’
AND column_name IN (‘LateFeesDue’, ‘DaysInYear’);

column_name | data_type
————-+—————
LateFeesDue | numeric(18,4)
DaysInYear | int
(2 rows)

Have fun!

Share this post

Share this post to x. Share to linkedin. Mail to
OpenText avatar image

OpenText

OpenText, The Information Company, enables organizations to gain insight through market-leading information management solutions, powered by OpenText Cloud Editions.

See all posts

More from the author

Can CIOs meet today’s challenges and plan for tomorrow?

Can CIOs meet today’s challenges and plan for tomorrow?

Read the new white paper

April 21, 2025

4 min read

From the Great North to global innovation: How OpenText powers the future of tech

From the Great North to global innovation: How OpenText powers the future of tech

The beginning of the year is the perfect time to reflect on one’s successful journey and set our sights on the future. At OpenText, our…

February 28, 2025

3 min read

Why SAST + SCA is the key to protecting your organization in 2025

Why SAST + SCA is the key to protecting your organization in 2025

Software supply chain risk continues to rise—just last year we witnessed a staggering 156% year-over-year increase in malicious software supply chain attacks.

January 17, 2025

4 min read

Stay in the loop!

Get our most popular content delivered monthly to your inbox.