Is it possible to use COUNT in some way that will give me the number of tuples that are in a .sql file? I tried using it in a query with the file name like this:
SELECT COUNT(*) FROM @q65b;
It tells me that the table is invalid, which I understand because it isn’t a table, q65b is a file with a query saved in it. I’m trying to compare the number of rows in q65b to a view that I have created. Is this possible or do I just have to run the query and check the number of rows at the bottom?
Thanks
You can do this in SQL*Plus. For example:
Create the text file, containing the query (note: no semicolon!):
Save it in a file, e.g.
myqueryfile.txt, to the folder accessible from your SQL*Plus session.You can now call this from within another SQL query – but make sure the @ as at the start of a line, e.g.:
I don’t personally use this feature much, however.