I do not know .NET at all, but for any language you should have very similar restrictons. One is that you can only use PL/SQL in PL/SQL blocks. What you seem to be after is more to run SQL*PLUS as that is where you have commands like spool. Why not just read the data you need as usual and write the file using .NET? Mathias http://mathiasmagnusson.com