cancel
Showing results for 
Search instead for 
Did you mean: 

Inserting a table in Dataservices

Former Member
0 Kudos

Hi ,

I have a question how to insert this code:

insert into A (ccn, mas_Loc, wo_Num, wo_Line, parent_wo_line, Parent_wo_Num)

     SELECT UNIQUE ccn, mas_Loc, WO_NUM,wo_Line, parent_wo_line, CONNECT_BY_ROOT B.PARENT_WO_NUM as PARENT_WO_NUM,   LEVEL-1 as Pathlen, SYS_CONNECT_BY_PATH(trim(parent_wo_num), '/') as Path

   FROM B  WHERE LEVEL > 1  CONNECT BY PRIOR B.wo_num = B.parent_wo_num)

into Dataservices.

Thanks,

Prathyu

Accepted Solutions (1)

Accepted Solutions (1)

former_member187605
Active Contributor
0 Kudos

Build a data flow with your select in a SQL transform and A as the target table.

Former Member
0 Kudos

Sure , Thank you .I will try this .

Thanks,

Prathyu

Former Member
0 Kudos

Please let me what wrong I am doing while inserting into SQL transformation

insert into A (ccn, mas_Loc, wo_Num, wo_Line, parent_wo_line, Parent_wo_Num)

     SELECT UNIQUE ccn, mas_Loc, WO_NUM,wo_Line, parent_wo_line, CONNECT_BY_ROOT B.PARENT_WO_NUM as PARENT_WO_NUM,   LEVEL-1 as Pathlen, SYS_CONNECT_BY_PATH(trim(parent_wo_num), '/') as Path

   FROM B  WHERE LEVEL > 1  CONNECT BY PRIOR B.wo_num = B.parent_wo_num)

Here is the error message:

former_member187605
Active Contributor
0 Kudos

Put the select statement only in the SQL transform:

SELECT UNIQUE ccn, mas_Loc, WO_NUM,wo_Line, parent_wo_line, CONNECT_BY_ROOT B.PARENT_WO_NUM as PARENT_WO_NUM,   LEVEL-1 as Pathlen, SYS_CONNECT_BY_PATH(trim(parent_wo_num), '/') as Path

   FROM B  WHERE LEVEL > 1  CONNECT BY PRIOR B.wo_num = B.parent_wo_num)

Omit the insert! The results will be automatically inserted in the target when you execute the data flow.

Answers (0)