0
I have a table with 58 different columns and would like to create a View treat the fields DATE as SWEEP, without me having to discriminate all the columns in the creation of View.
CREATE VIEW VW_TESTE AS SELECT * FROM TABELA
As follows in the example:
ID, BIGINT
NAME, VARCHAR
LOGIN, DATE
REGISTRATION, DATE
EMAIL, VARCHAR
And return this:
ID, BIGINT
NAME, VARCHAR
LOGIN, VARCHAR
INSCRIPTION, VARCHAR
EMAIL, VARCHAR
OR
ID, BIGINT
NAME, VARCHAR
EMAIL, VARCHAR
I tried to command "Select * from Table Where data_type = 'DATE' "
But it didn’t work.
https://forum.imasters.com.br/topic/261439-resolver%C2%A0procedure-trigger-trigger-of-audit/ I once did this process that generates a Trigger for auditing the basic idea could be used to generate the view that would "to-char" when the field was date
– Motta
But I confess I see no reason for this work
– Motta
@Motta in this case I do not have DBA permission in DB Oracle with my user. Using the
to_char
I would have to make a view having to put all the columns. But that’s not necessarily a problem now. However, as I am working on a bigdata project, this could soon be a problem with even wider tables. In addition, I will analyze what you sent and exchange an idea with DBA. The problem is that what I am doing is only for testing.– Rodrigo Correa
But why the dates have to be char in the view ?
– Motta
@Motta sorry the delay. So, I’m making an import to a cluster Hadoop and is giving a strange error with a selected dataset. That’s why I would like to turn it into a string, to avoid the date format that causes incompatibility.
– Rodrigo Correa