How do you incorporate a .SQL file in another script?
594752Aug 27 2007 — edited Aug 27 2007I have a SELECT statement in a file that cannot be altered and must be run as it is sent to me. I am creating another table using this SELECT statement. I just want to run my own script which gets part of its content from the one sent me. That way, if the - you might call it 'sub script' changes, I won't have to change anything. It goes something like the following, though this is greatly changed and simplified.
But I want to read everything in the block from a separate file rather than have it copied and pasted every time as it is now. Thank you.
select e.emp_ID
,e.data1
,e.data2,
from empdata e
,(
/****************************************************************************
BEGINNING OF THE MAIN REPORT (this is pasted
from other suq-query at the present moment)
*****************************************************************************/
select distinct w.emp_ID, w.empwages
from wages w
/****************************************************************************
END OF THE MAIN QUERY
*****************************************************************************/
) main
WHERE
main.wages > 40