I have XML files that I want to upload into an Oracle DB through a Batch file process using sqlplus. I am looping through my XML file like this:
for %%f in (%FILE%) do (
call :load_file %%f
)
%FILE% may be an issue as well, not 100% sure. This variable is being set like:
set FILE=%CURRENT_DIRECTORY%\File1_*.xml
..And should be pulling any files that match the pattern.
In :load_file I need the actual file contents (as a string) to pass to sqlplus. I have the following where %1 is the file name itself. I actually need the XML file contents to be passed to my sqlplus command so the contents can actually be inserted into the Oracle DB.
:load_file
set FILECONTENTS=?
sqlplus -S %DB_USER%/%DB_PASSWORD%@%DB_SID% @insert_xml_into_db.sql %1 %FILECONTENTS%
I may be looking/thinking about this wrong as well. Any suggestions would be appreciated. Is there an easier way?