简体   繁体   English

Informatica SQL 转换中的联接查询失败

[英]Join query failing in Informatica SQL transformation

I have a SQL query to which am passing parameters from expression transformation:我有一个 SQL 查询,将表达式转换中的参数传递给它:

Eg:例如:

  SELECT A.id 
  FROM table1 A, table2 B
  WHERE A.id = B.id

This works fine and am able to get the output.这工作正常并且能够获得输出。

Now when I modify this sql to :现在,当我将此 sql 修改为:

select DR.id from(select A.id from table1 A, table2 B where A.id = B.id)DR 
left outer join table3 C on Dr.id = c.col1

Then it throws ODL Error -然后它抛出 ODL 错误 -

ERROR TRANSF_1_1_1_1 pmsql_50065 [ERROR] ODL error: FnName: Bind Parameter -- [Informatica][ODBC PWX Driver] PWX-00264 DBAPI Error Initial "Describe" CONVERSE failed to location ,;DSNT408I SQLCODE = -199, ERROR: ILLEGAL USE OF KEYWORD LEFT.错误 TRANSF_1_1_1_1 pmsql_50065 [错误] ODL 错误:FnName:绑定参数 -- [Informatica][ODBC PWX 驱动程序] PWX-00264 DBAPI 错误初始“描述”CONVERSE 无法定位,;DSNT408I SQLCODE = -1999,密钥使用错误:左。 TOKEN , FROM;令牌,发件人; INTO WAS EXPECTED;DSNT418I SQLSTATE = 42601 ;DSNT415I SQLERRP = DSNHPARS ;DSNT416I SQLERRD = 2 0 0 -1 129 506 ; INTO 预期;DSNT418I SQLSTATE = 42601 ;DSNT415I SQLERRP = DSNHPARS ;DSNT416I SQLERRD = 2 0 0 -1 129 506 ; Database driver error... parameter binding failed.数据库驱动程序错误...参数绑定失败。

The sql query when executed from sql assistant works fine.从 sql 助手执行时的 sql 查询工作正常。 So could you suggest as how to write query in Informatica SQL transformation.那么您能否建议如何在 Informatica SQL 转换中编写查询。

Thanks!谢谢!

there is no column in your sub-query DR name 'col1' so make it 1st then use it您的子查询 DR 名称“col1”中没有列,因此将其设为第 1,然后使用它

select DR.col1 
from
(select A.id as col1 from table1 A join table2 B on 
A.id = B.id
) DR 
left outer join table3 C on Dr.col1 = c.col1

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM