FOR _record IN SELECT A1, A2 FROM A LOOP
--[Dinesh Pandey] -- Sorry I didn't get this part. _sql := "INSERT INTO B VALUES ( '*" || _record.A1 || "'** , '" || _record.A2 || "' ***)"; EXECUTE (_sql); END LOOP; Dinesh Pandey wrote: > How can we set A1, A2 values in dynamic 'INSERT' query? > > DECLARE > > _record RECORD; > > _sql VARCHAR(2000); > > FOR _record IN SELECT A1, A2 FROM A > > LOOP > > _sql := 'INSERT INTO B VALUES (*:A1, :A2*)'; > > EXECUTE (_sql); > > END LOOP; > > ================================================================= > > I can do this as (but I need another way instead of using || operator). > > _sql := 'INSERT INTO B VALUES (' || _record.A1 || ',' || _record.A2 || > ')'; > > ================================================================= > > Regards > Dinesh Pandey > > > *--------------------------------------------------------------------------- -------* > *Dinesh Pandey* > Sr. Software Engineer > ---------------------------(end of broadcast)--------------------------- TIP 9: the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match