Solved

Consultora

Posted on 2016-11-25
3
17 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 28

Expert Comment

by:Pawan Kumar
ID: 41901520
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
ID: 41901682
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
ID: 41907015
Work
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Need Distinct Value from Joined Tables in MSSQL 5 66
Slow SQL query 12 61
SQL Query assistance 16 36
Creating a record in a database with static data from MVC to SQL (Entity) 2 28
Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
CCModeler offers a way to enter basic information like entities, attributes and relationships and export them as yEd or erviz diagram. It also can import existing Access or SQL Server tables with relationships.
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…

827 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