Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Export query result to Excel file

lemalhuApr 14 2020 — edited Apr 14 2020

Hello together,

i have to work with a database now i got the problem that i have only readersonly function so i got no possibility to add an additionaly column. Now i got an idea where i want to export my query result to an excel file or into a R-file. So if there a way to export this would be great.

This is my little Code:

select reporting_dt, contract_id, sum(RATING_CONTRACT_CLASS_CD_1) - lag(sum(RAting_contract_class_cd_1), 1, 0) over (partition by contract_id order by reporting_dt ) as delta

from database

where reporting_dt>='31.12.2019' and RATING_CONTRACT_CLASS_CD_1!='U'

group by reporting_dt, contract_id

order by delta asc

);

Would be great if you could help me.

Thank you

Comments

Paulzip

You only have to worry about objects that reference the invalid objects (directly or through other dependencies), not objects that the invalid objects reference (caveated that they are not referenced by another invalid object).

E.g. Dropping PLAP/TEMP_DIS_CONSTR/PROCEDURE, won't affect SYS/ALL_CONS_COLUMNS/VIEW

BEDE

That depends...

Some of those invalid packages/procedures/functions/views may need to have their code changed so that they may be used later on. So, I don't think it is the case to rush into such spring cleaning. First use dbms_utility.compile_schema(x_schema,false) to see what can recompile, then send all the developers you know to be working on that database a list of the invalid objects, eventually including also the errors, with the warning that, if in within two weeks they won't fix them, then they will be dropped.

Yet, if your concern is space, tables are those that take most of the space.

4089142

Thanks so much! That's exactly what I did. First I tried to see what invalid objects I could recompile (except I used @utlrp.sql). Then, I sent all the developers a list of the invalid objects with each error included so that they can look through and fix the code if need be.

4089142

Thanks for the clear and concise answer Paulzip! This is exactly what I needed to know!

1 - 4

Post Details

Added on Apr 14 2020
6 comments
2,613 views