Skip to main content

Hello,

I am trying to execute below plsql statement using SQLExecuter.

But the declared variable (mId) is not populating select statement "mId" value.

 

DECLARE mId number;

BEGIN

  select MAX (id) INTO maxId from @Value(table);

  insert into @Value(table) (ID,@Value(columnsStr)) VALUES (mId, @Value(ValueStr));

END;

 

/

FME_SQL_DELIMITER /

 

Expected output during execution: insert into table1 (ID,name) VALUES (10, 'test');

 

FME Output during execution: insert into table1 (ID,name) VALUES (mId, 'test'); 

 

Thanks,

G

 

Is the mixup of "maxId" and "mId" above a typo?

You could also simplify it to a single statement:

insert into @Value(table) (ID,@Value(columnsStr)) 
VALUES ((select MAX (id) from @Value(table)), @Value(ValueStr))

That way you don't need to use PLSQL.


@david_r​ Thanks. sorry for the typo. It works


Reply