MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

GET DIAGNOSTICS insert

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
madan777in
Beginner


Joined: 07 Dec 2005
Posts: 12
Topics: 6

PostPosted: Mon Aug 20, 2007 6:42 am    Post subject: GET DIAGNOSTICS insert Reply with quote

Hi ,

Could you please provide some example code or functionality to insert multiple rows into Table using Insert Arrays , Atomic function .
I want to load the table be correcttly calculated prior to the insert.when researched i came across get diagonistic function . But iam unclear with example provided .

Thanks
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Mon Aug 20, 2007 7:02 am    Post subject: Reply with quote

madan777in,

Check this link

http://publib.boulder.ibm.com/infocenter/dzichelp/v2r2/index.jsp?topic=/com.ibm.db29.doc.sqlref/rinsr.htm

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
madan777in
Beginner


Joined: 07 Dec 2005
Posts: 12
Topics: 6

PostPosted: Mon Aug 20, 2007 8:21 am    Post subject: Reply with quote

Thanks Kolusu
Back to top
View user's profile Send private message
madan777in
Beginner


Joined: 07 Dec 2005
Posts: 12
Topics: 6

PostPosted: Mon Aug 27, 2007 6:57 am    Post subject: Reply with quote

Koulsu, Thanks for your reply .. But I have problem in issuing this multiple insert querry n Spufi or Qmf . Iam end up with -803 (duplicate data )

For eg i used the query like

INSERT IN TABLE (C1,C2) VALUES ('123','TEST') FOR 2 ROWS;

SQLCODE = -803, ERROR: AN INSERTED OR UPDATED VALUE IS INVALID
BECAUSE INDEX IN INDEX SPACE IRPARF01 CONSTRAINS COLUMNS OF THE TABLE
SO NO TWO ROWS CAN CONTAIN DUPLICATE VALUES IN THOSE COLUMNS.

Please let me know how to check the Multiple insert querry in Spufi or Qmf .. Below is the querry given in IBM link

EXEC SQL INSERT INTO T1 FOR :hv ROWS VALUES (:hva:hvind) ATOMIC;
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Mon Aug 27, 2007 7:07 am    Post subject: Reply with quote

Quote:

SQLCODE = -803, ERROR: AN INSERTED OR UPDATED VALUE IS INVALID


madan777in,

The error is self explantory. You have an index defined which does NOT allow duplicates. And that is the reason as to why you got a sql code of -803. If you want dups to be inserted then drop the index.

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
madan777in
Beginner


Joined: 07 Dec 2005
Posts: 12
Topics: 6

PostPosted: Mon Aug 27, 2007 7:17 am    Post subject: Reply with quote

Yes - 803 is the reason for duplicate data inserted twice . but in real time thru program we wont get data has duplicate . Dupicate data was handled .

Please let me know(any eg) how this querry can be checked in qmf for 3 rows without any duplicate data .

EXEC SQL INSERT INTO T1 FOR :hv ROWS VALUES (:hva:hvind) ATOMIC;

Thanks ,
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Mon Aug 27, 2007 7:56 am    Post subject: Reply with quote

Quote:

Please let me know(any eg) how this querry can be checked in qmf for 3 rows without any duplicate data .

EXEC SQL INSERT INTO T1 FOR :hv ROWS VALUES (:hva:hvind) ATOMIC;

madan777in,

QMF/SPUFI does NOT support host-variable array processing. If you really want to insert multiple rows then create a temp table and insert all the values in it and use that to insert rows in to the main table

Code:

INSERT INTO table
     SELECT *
     FROM temp table FETCH FIRST 3 rows only;



Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
madan777in
Beginner


Joined: 07 Dec 2005
Posts: 12
Topics: 6

PostPosted: Mon Aug 27, 2007 8:18 am    Post subject: Reply with quote

Thanks Kolusu .. Now iam Clear with your reply ..
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group