[
https://issues.jboss.org/browse/TEIIDDES-2301?page=com.atlassian.jira.plu...
]
Barry LaFond commented on TEIIDDES-2301:
----------------------------------------
Appears that the changes for TEIIDDES-2190 are resulting in the simple XML File use-case
generating the wrong SQL text via the changes in
*TeiidXmlImportXmlConfigurationPage.updateSqlText()* method. The
TeiidXmlFileInfo.getSqlString() method was overloaded. Thinking we need a more concrete
way to determine what kind of SQL statement needs to get generated via the File info
object, rather than looking at existance of file names....
{code}
void updateSqlText() {
if( this.fileInfo != null ) {
if( this.info.getSourceModelName() != null ) {
String sourceModelName =
this.fileInfo.getModelNameWithoutExtension(this.info.getSourceModelName());
if (this.info.getViewModelName() != null) {
String viewModelName =
this.fileInfo.getModelNameWithoutExtension(this.info.getViewModelName());
sqlTextViewer.getDocument().set(fileInfo.getSqlString(sourceModelName,
viewModelName, this.fileInfo.getViewProcedureName()));
} else {
sqlTextViewer.getDocument().set(fileInfo.getSqlString(sourceModelName));
}
} else {
sqlTextViewer.getDocument().set(fileInfo.getSqlStringTemplate());
}
}
}
{code}
Generated code>
{code}
CREATE VIRTUAL PROCEDURE
BEGIN
DECLARE STRING VARIABLES.qp = '';
SELECT
A.id AS id, A.office AS office, A.first AS first, A.last AS last
FROM
(EXEC SourceModel.invokeHttp('employee_info.xml')) AS f,
XMLTABLE(/employee-info' PASSING XMLPARSE(DOCUMENT f.result) COLUMNS id string PATH
'dept/employee/@id', office string PATH 'dept/employee/office/text()',
first string PATH 'dept/employee/name/first/text()', last string PATH
'dept/employee/name/last/text()') AS A;
END
{code}
Should probably be:
{code}
SELECT
A.id AS id, A.office AS office, A.first AS first, A.last AS last
FROM
(EXEC SourceModel.invokeHttp('employee_info.xml')) AS f,
XMLTABLE(/employee-info' PASSING XMLPARSE(DOCUMENT f.result) COLUMNS id string PATH
'dept/employee/@id', office string PATH 'dept/employee/office/text()',
first string PATH 'dept/employee/name/first/text()', last string PATH
'dept/employee/name/last/text()') AS A
{code}
XML File importer - issues with SQL generation
----------------------------------------------
Key: TEIIDDES-2301
URL:
https://issues.jboss.org/browse/TEIIDDES-2301
Project: Teiid Designer
Issue Type: Bug
Components: Import/Export
Affects Versions: 8.5
Reporter: Mark Drilling
Assignee: Barry LaFond
Fix For: 8.6
Attachments: xmlImportSQLGeneration.png
In the course of working TEIIDDES-2276, I noticed that the SQL generation in the XML file
import wizard is not working correctly.
Use the xml file that is attached to 2276 - notice the generated SQL displayed in the
wizard is invalid. Attaching a screencap.
--
This message was sent by Atlassian JIRA
(v6.3.1#6329)