[teiid-issues] [JBoss JIRA] (TEIID-3994) AliasSymbol wrapping AliasSymbol error

Steve Tran (JIRA) issues at jboss.org
Mon Feb 29 22:55:00 EST 2016


    [ https://issues.jboss.org/browse/TEIID-3994?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13169852#comment-13169852 ] 

Steve Tran commented on TEIID-3994:
-----------------------------------

Query which throws the AliasSymbol wrapping AliasSymbol wrapping AliasSymbol exception.  Might be hard to follow, but all it's doing is an insert into SQL Server View SELECT from Oracle View.
{code}
insert into Control.SQLServer_VBL.HSI_TEST_VIRTUALFIELD (TEST_ID, TEST_NBR, TEST_DT, TEST_STR, TEST_INT_NBR)
SELECT TEST_ID, TEST_NBR, TEST_DT, TEST_STR, TEST_INT_NBR FROM Control.Oracle2_VBL.HSI_TEST where test_id = 1050783767;
{code}

Select Trigger on Control.SQLServer_VBL.HSI_TEST_VIRTUALFIELD
{code}
SELECT
		TEST_ID, TEST_NBR, TEST_DT, TEST_STR, TEST_INT_NBR, TEST_TS, 1 AS VirtField1, 'Steve' AS VirtField2
	FROM
		SQL_Server_Cdtssql587D_KF.HSI_TEST
{code}

Insertion Trigger Control.SQLServer_VBL.HSI_TEST_VIRTUALFIELD
{code}
FOR EACH ROW
BEGIN ATOMIC
	INSERT INTO SQL_Server_Cdtssql587D_KF.HSI_TEST (SQL_Server_Cdtssql587D_KF.HSI_TEST.TEST_ID, SQL_Server_Cdtssql587D_KF.HSI_TEST.TEST_NBR, SQL_Server_Cdtssql587D_KF.HSI_TEST.TEST_DT, SQL_Server_Cdtssql587D_KF.HSI_TEST.TEST_STR, SQL_Server_Cdtssql587D_KF.HSI_TEST.TEST_INT_NBR, SQL_Server_Cdtssql587D_KF.HSI_TEST.TEST_TS) VALUES ("NEW".TEST_ID, "NEW".TEST_NBR, "NEW".TEST_DT, "NEW".TEST_STR, "NEW".TEST_INT_NBR, "NEW".TEST_TS);
END
{code}

See screenshots for descriptions of "tableA" and "tableB"

> AliasSymbol wrapping AliasSymbol error
> --------------------------------------
>
>                 Key: TEIID-3994
>                 URL: https://issues.jboss.org/browse/TEIID-3994
>             Project: Teiid
>          Issue Type: Bug
>    Affects Versions: 8.7.1.6_2
>         Environment: Red Hat JBoss Data Virtualization 6.2 on EAP6.4.0 patched to version 6.4.3,
> JBoss Developer Studio 8.1.0GA with Teiid Designer plugin 9.0.3.Final.v20150810-1438-B1157
> 64-bit Windows 7 environment
>            Reporter: Steve Tran
>            Assignee: Steven Hawkins
>         Attachments: Oracle.PNG, SQLServer.PNG
>
>
> I've defined a view and overrode the default triggers for Select, Insert, Update, and Delete.  I overrode the triggers because the select is returning "hardcoded" values for a few fields (calling them virtual columns).  The Update and Insert triggers will ignore these hardcoded values just in case the caller tries to update a virtual column.
> I'm trying to run a insert into <tableA> select * from <tableB> query.  When I run this, I get an error  org.teiid.jdbc.TeiidSQLException: Cannot create AliasSymbol wrapping AliasSymbol.  
> Facts:
> --  I can insert a record if I only select one column from tableB.  
> --  If I select two or more columns, it throws the error every time.
> --  If I remove the overridden triggers, the insert into <tableA> select * from <tableB> works fine.
> --  I can insert one or more columns into <tableA> when *not* using a insert into <tableA> select * from <tableB> query
> -- Table A is Oracle
> -- Table B is SQL Server
> My hunch is the generated query (hibernate, or whatever SQL generator) is choking with the overridden trigger.  Perhaps this use-case slipped through testing, or even more probable, I made a mistake in the trigger creation.
> Here's a snip of the insert trigger, with a lot of fields removed for simplicity.
> {code}
> FOR EACH ROW
> BEGIN ATOMIC
> 	INSERT INTO <schema>.<tableA> (SourceSystemID, RecordTypeID, BatchID ...) 
> 	VALUES (
>             convert("NEW".SourceSystemID, short), 
>             convert("NEW".RecordTypeID, short),
>             convert("NEW".BatchID, integer)
>             ...
>         )
> END
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.11#64026)


More information about the teiid-issues mailing list