Solved

Consultora

Posted on 2016-11-25
3
11 Views
Last Modified: 2016-11-30
Hello,
I need Insert multiple records into AS400 database. In SQL I put ; in the end of statment but in AS400 I don't know what to put

INSERT INTO M3FDBTST.FCHACC (EACONO, EADIVI, EAAITP, EAAITM, EAAICL, EATX40, EATX15, EAAT01) VALUES ('901', '002', '3', '115', '', 'PAGAMENTOS P/ TRANSFER. BANCÁRIA', 'PAGAMENTOS P/ T', '0');
INSERT INTO M3FDBTST.FCHACC (EACONO, EADIVI, EAAITP, EAAITM, EAAICL, EATX40, EATX15, EAAT01) VALUES ('901', '002', '3', '1151', '', 'PAGAMENTOS P/ TRANSFERÊNCIA - BE', 'PAGAMENTOS P/ T', '0');

Can you help me please.

Thank you

Mónica
0
Comment
Question by:Mónica Fernandes
  • 2
3 Comments
 
LVL 16

Expert Comment

by:Pawan Kumar Khowal
Comment Utility
Try..

exec sql 
INSERT INTO M3FDBTST.FCHACC (EACONO, EADIVI, EAAITP, EAAITM, EAAICL, EATX40, EATX15, EAAT01) 
VALUES ('901', '002', '3', '115', '', 'PAGAMENTOS P/ TRANSFER. BANCÁRIA', 'PAGAMENTOS P/ T', '0');

exec sql 
INSERT INTO M3FDBTST.FCHACC (EACONO, EADIVI, EAAITP, EAAITM, EAAICL, EATX40, EATX15, EAAT01) 
VALUES ('901', '002', '3', '1151', '', 'PAGAMENTOS P/ TRANSFERÊNCIA - BE', 'PAGAMENTOS P/ T', '0');

Open in new window

0
 

Accepted Solution

by:
Mónica Fernandes earned 0 total points
Comment Utility
Thank you,  but don't work:

Error: SQL0104 - Token EXEC was not valid. Valid tokens: ( CL END GET SET CALL DROP FREE HOLD LOCK OPEN WITH ALTER. (State:37000, Native Code: FFFFFF98)

I found another  way:

INSERT INTO M3FDBTST.FCHACC (EACONO, EADIVI, EAAITP, EAAITM, EAAICL, EATX40, EATX15, EAAT01)
 VALUES ('901', '002', '3', '1411', '', 'POTENCIALMENTE FAVORÁVEIS', 'POTENCIALMENTE ', '0') UNION ALL
 VALUES ('901', '002', '3', '14111', '', 'SWAP S DE COBERTURA', 'SWAPS DE COBER', '0') UNION ALL
 VALUES ('901', '002', '3', '1411101', '', 'SWAP  9401 - 01-12-2006', 'SWAP  9401 - 01', '0')

thank you
0
 

Author Closing Comment

by:Mónica Fernandes
Comment Utility
Work
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Introduction: I have seen many questions on EE and elsewhere, asking about how to find either gaps in lists of numbers (id field, usually) ranges of values or dates overlapping date ranges combined date ranges I thought it would be a good …
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now