0

I have a specific query. In Netezza, I need to assign the value of one record to another record. I am trying as below,

record1 := record2;

But it is not working this way. While if I try to assign individual values, it is working. Like...

record1.col1 := record2.col1;

Can we all the values at the same time as done in Oracle. If possible, how?

user272735
  • 10,473
  • 9
  • 65
  • 96
  • Is Netezza using Oracle [tag:plsql] ? Are `record1` and `record2` [PL/SQL record variables](http://docs.oracle.com/cd/E11882_01/appdev.112/e25519/composites.htm#LNPLS00509) ? – user272735 Jul 21 '15 at 11:39
  • Netezza is using nzplsql. Yes, record1 and record2 are record variables. Is there any way to assign all the values of one record to another in Netezza? – Sonal Nath Jul 27 '15 at 10:34
  • I don't know Netezza but obviously Netezza `nzplsql` is different than Oracle `plsql` because, as you've experienced, `record1 := record2` doesn't work the same way in both systems. In Oracle record assignment is a deep copy. Workaround is to write a subroutine e.g. `function init(p_from in rectype_t) return rectype_t` or `procedure copy(p_to out rec_t, p_from in rec_t)`. I have removed [tag:plsql]-tag as obviously this is not plsql-question. – user272735 Jul 28 '15 at 04:29
  • Oh and [reading the fine manual](https://www-304.ibm.com/support/knowledgecenter/SSULQD_7.2.0/com.ibm.nz.sproc.doc/c_sproc_nzplsql.html) states clearly: _"You implement stored procedures on the IBM® Netezza® host by creating applications by using the NZPLSQL language. NZPLSQL is an interpreted language which is based on Postgres PL/pgSQL language and designed for the Netezza host environment."_ [tag:nzplsql]-tag created. – user272735 Jul 28 '15 at 04:45

0 Answers0