В общем не смог я победить эту проблему, сделал через XML в ОС.
Дебильное решение, а что поделаешь.
FUNCTION MONITOR.MORED_XML(NUM IN NUMBER)
RETURN NUMBER
IS
file_id UTL_FILE.FILE_TYPE;
BEGIN
file_id := utl_file.FOPEN ('MOREDDIR','Mored.xml','w');
utl_file.PUT_LINE( file_id, '<?xml version="1.0" encoding="utf-8" ?>' );
utl_file.PUT_LINE( file_id, '<Start>' );
FOR emp IN (SELECT m.ID_MORED,
e.IP_ADDRESS,
m.MODEL_MORED
FROM EMPLOYEE e
INNER JOIN MORED m ON m.ID_EMPLOYEE_FK = e.ID_EMPLOYEE
WHERE m.STATUS = 1
AND m.MODEL_MORED IS NOT NULL
ORDER BY e.ID_EMPLOYEE )
LOOP
utl_file.PUT_LINE( file_id, '<Row>' );
utl_file.PUT_LINE( file_id, '<ID_MORED>' || emp.ID_MORED || '</ID_MORED>' );
utl_file.PUT_LINE( file_id, '<IP_ADDRESS>' ||emp.IP_ADDRESS || '</IP_ADDRESS>' );
utl_file.PUT_LINE( file_id, '<MODEL_MORED>' ||emp.MODEL_MORED || '</MODEL_MORED>' );
utl_file.PUT_LINE( file_id, '</Row>' );
END LOOP;
utl_file.PUT_LINE( file_id, '</Start>' );
utl_file.fCLOSE(file_id);
RETURN 1;
END MORED_XML;
//извлекаем пути к Моред файлам
string mor = "select MONITOR.MORED_XML(1) from dual";
const char* sql1 = mor.c_str();
Statement* stmt1 = conn->createStatement(mor);
ResultSet *rs;
ResultSet *rsb;
rs = stmt->executeQuery();
rsb = stmt1->executeQuery();
XmlTextReader ^ reader = gcnew XmlTextReader ("C:\\Mored\\Mored.xml");
char* nameXMLRow = "";
while (reader->Read())
{
MORED_PATH mored_path;
switch (reader->NodeType)
{
case XmlNodeType::Element: // The node is an element.
if (reader->Name == "ID_MORED") {
nameXMLRow = "ID_MORED";
} else if (reader->Name == "IP_ADDRESS") {
nameXMLRow = "IP_ADDRESS";
} else if (reader->Name == "MODEL_MORED") {
nameXMLRow = "MODEL_MORED";
}
break;
case XmlNodeType::Text: //Display the text in each element.
if (strcmp(nameXMLRow, "ID_MORED") == 0) {
mored_path.id_mored = (char*)(void*)Marshal::StringToHGlobalAnsi(reader->Value);
} else if (strcmp(nameXMLRow, "IP_ADDRESS") == 0) {
mored_path.ip_mored = (char*)(void*)Marshal::StringToHGlobalAnsi(reader->Value);
} else if (strcmp(nameXMLRow, "MODEL_MORED") == 0) {
mored_path.model_mored = (char*)(void*)Marshal::StringToHGlobalAnsi(reader->Value);
mored_path_list.push(mored_path);
}
break;
case XmlNodeType::EndElement: //Display the end of the element.
break;
}
}