List column name for user views in oracle

SELECT table_name, column_name, data_type FROM all_tab_columns WHERE table_name=”VIEWNAME” AND owner=”OWNER” ORDER BY column_id You can also use USER_TAB_COLUMNS and/or DBA_TAB_COLUMNS depending on your privileges and whether you have permission to query the view.

Remove Column Header into the Output Text file

SQLPLUS COMMAND Skipped: set heading off That message is most likely because you are not executing it through SQL*Plus, but some GUI based tool. You are using SQLPlus command in SQL Developer. Not all SQL*Plus commands are guaranteed to work with SQL Developer. I would suggest you execute the script in SQLPlus and you would … Read more

How to convert “1985-02-07T00:00:00.000Z” (ISO8601) to a date value in Oracle?

to_date converts the input to a DATE type which does not support fractional seconds. To use fractional seconds you need to use a TIMESTAMP type which is created when using to_timestamp pst’s comment about the ff3 modifier is also correct. “Constant” values in the format mask need to be enclosed in double quote So the … Read more

Why do I have ORA-00904 even when the column is present?

ORA-00904-invalid identifier errors are frequently caused by case-sensitivity issues. Normally, Oracle tables and columns are not case sensitive and cannot contain punctuation marks and spaces. But if you use double quotes to create a quoted identifier, that identifier must always be referenced with double quotes and with the correct case. For example: create table bad_design(“goodLuckSelectingThisColumn … Read more