× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



My connections look like this. db2conn = db2.connect("DATABASE=*LOCAL"). Try adding the DATABASE= portion to yours.

-----Original Message-----
From: OpenSource [mailto:opensource-bounces@xxxxxxxxxxxxxxxxxx] On Behalf Of Mike Loyd
Sent: Thursday, June 27, 2019 11:46 AM
To: IBMi Open Source Roundtable
Subject: Re: [IBMiOSS] CSV file in the IFS, writing it to a DB2 file using Python

Hi there
I am trying to connect to DB2 in python using the following -

import ibm_db_dbi as db2
sys_nam = "*LOCAL"
user = "USER"
password = "PASSWORD"
conn = db2.connect(sys_nam,user,password)

I am receiving this error when running the script -
ValueError: not enough values to unpack (expected 2, got 1)

I have tried looking online and nothing is working.
Any thoughts?


-----Original Message-----
From: OpenSource [mailto:opensource-bounces@xxxxxxxxxxxxxxxxxx] On Behalf Of Jim Steil
Sent: Tuesday, June 18, 2019 8:08 AM
To: IBMi Open Source Roundtable <opensource@xxxxxxxxxxxxxxxxxx>
Subject: Re: [IBMiOSS] CSV file in the IFS, writing it to a DB2 file using Python

Then I would use the csv reading logic in the article and use your previous
DB2 update logic when writing. Good luck, post back if you have more questions.

-Jim

On Tue, Jun 18, 2019 at 10:05 AM Mike Loyd <mloyd@xxxxxxx> wrote:

This will be running on the IBM I.

-----Original Message-----
From: OpenSource [mailto:opensource-bounces@xxxxxxxxxxxxxxxxxx] On
Behalf Of Jim Steil
Sent: Monday, June 17, 2019 2:11 PM
To: IBMi Open Source Roundtable <opensource@xxxxxxxxxxxxxxxxxx>
Subject: Re: [IBMiOSS] CSV file in the IFS, writing it to a DB2 file
using Python

Reading a csv file is simple with Python.

This article outlines it pretty well.
https://urldefense.proofpoint.com/v2/url?u=https-3A__realpython.com_py
thon-2Dcsv_&d=DwICAg&c=CqkB-gCiM4xW6iOknju0uA&r=l8_Kw5BfK6Ei8qLuvBDSAA
&m=Pe8kGlnGYiJCYdXU3i7ZikqAZ1piJiUVbRSVTQeZb8E&s=HgOrO8nekQ1HAZYI-ZSlv
IUMnbOggJ6A7OfKh6Hbxe0&e=

A reason you wouldn't want cpyfrmimpf is because you may want to do
additional manipulation on the data before putting it in the db. Also
may want to eliminate fields.

Will you run this on IBM i or on a Windows/Linux machine?

-Jim

On Mon, Jun 17, 2019 at 4:03 PM Mike Loyd <mloyd@xxxxxxx> wrote:

Hi all
This is my first post so here goes.
I need to take a CSV file in the IFS on the iSeries and write the
data to a data base file.
I am looking at Python to do this. I already have a script to get a
XLS spread sheet to a data base file.
I have a simple script to read and print a CSV file. So, I need that
piece to parse the CSV file and write the data.

Thanks in advance.

Mike Loyd
Sr. Software Engineer
Recreational Equipment, Inc. (REI)
' o: 425-278-8265
| * mloyd@xxxxxxx<mailto:mloyd@xxxxxxx> |
| www.rei.com<http://www.rei.com/>
[cid:image002.png@01D10BD3.03D87F20]

--
This is the IBMi Open Source Roundtable (OpenSource) mailing list To
post a message email: OpenSource@xxxxxxxxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit:
https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.midrange.
co
m_mailman_listinfo_opensource&d=DwICAg&c=CqkB-gCiM4xW6iOknju0uA&r=l8
_K
w5BfK6Ei8qLuvBDSAA&m=Pe8kGlnGYiJCYdXU3i7ZikqAZ1piJiUVbRSVTQeZb8E&s=4
-u sYuZEe5ZJfrMm__vQ5M82duWz9g4VWA7uLFovP6A&e=
or email: OpenSource-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at

https://urldefense.proofpoint.com/v2/url?u=https-3A__archive.midrange.
com_opensource&d=DwICAg&c=CqkB-gCiM4xW6iOknju0uA&r=l8_Kw5BfK6Ei8qLuvBD
SAA&m=Pe8kGlnGYiJCYdXU3i7ZikqAZ1piJiUVbRSVTQeZb8E&s=Hr0KOJL9JAk6hrmrQ6
nC5MBKqvv_mnvMs0-oyeYNdk4&e=
.

Help support midrange.com by shopping at amazon.com with our
affiliate
link:
https://urldefense.proofpoint.com/v2/url?u=https-3A__amazon.midrange
.c
om&d=DwICAg&c=CqkB-gCiM4xW6iOknju0uA&r=l8_Kw5BfK6Ei8qLuvBDSAA&m=Pe8k
Gl
nGYiJCYdXU3i7ZikqAZ1piJiUVbRSVTQeZb8E&s=VaBvyFCx_spOUyw03B-WYgDIxVy0
9r
ivNnhw8VqX45Q&e=

--
This is the IBMi Open Source Roundtable (OpenSource) mailing list To
post a message email: OpenSource@xxxxxxxxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit:
https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.midrange.co
m_mailman_listinfo_opensource&d=DwICAg&c=CqkB-gCiM4xW6iOknju0uA&r=l8_K
w5BfK6Ei8qLuvBDSAA&m=Pe8kGlnGYiJCYdXU3i7ZikqAZ1piJiUVbRSVTQeZb8E&s=4-u
sYuZEe5ZJfrMm__vQ5M82duWz9g4VWA7uLFovP6A&e=
or email: OpenSource-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://urldefense.proofpoint.com/v2/url?u=https-3A__archive.midrange.
com_opensource&d=DwICAg&c=CqkB-gCiM4xW6iOknju0uA&r=l8_Kw5BfK6Ei8qLuvBD
SAA&m=Pe8kGlnGYiJCYdXU3i7ZikqAZ1piJiUVbRSVTQeZb8E&s=Hr0KOJL9JAk6hrmrQ6
nC5MBKqvv_mnvMs0-oyeYNdk4&e=
.

Help support midrange.com by shopping at amazon.com with our affiliate
link:
https://urldefense.proofpoint.com/v2/url?u=https-3A__amazon.midrange.c
om&d=DwICAg&c=CqkB-gCiM4xW6iOknju0uA&r=l8_Kw5BfK6Ei8qLuvBDSAA&m=Pe8kGl
nGYiJCYdXU3i7ZikqAZ1piJiUVbRSVTQeZb8E&s=VaBvyFCx_spOUyw03B-WYgDIxVy09r
ivNnhw8VqX45Q&e=
--
This is the IBMi Open Source Roundtable (OpenSource) mailing list To
post a message email: OpenSource@xxxxxxxxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit:
https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.midrange.co
m_mailman_listinfo_opensource&d=DwICAg&c=CqkB-gCiM4xW6iOknju0uA&r=l8_K
w5BfK6Ei8qLuvBDSAA&m=gC4EGX0GGrA-whsnN910xGf9hVkTnzKygkrc5BmQW98&s=uts
WlK0EQrdwigIiTHrou-HH_l8sW_amFOf5ulUc5r0&e=
or email: OpenSource-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://urldefense.proofpoint.com/v2/url?u=https-3A__archive.midrange.com_opensource&d=DwICAg&c=CqkB-gCiM4xW6iOknju0uA&r=l8_Kw5BfK6Ei8qLuvBDSAA&m=gC4EGX0GGrA-whsnN910xGf9hVkTnzKygkrc5BmQW98&s=uPAIZrjBww2sDy_U2u2hb16mQV7fzfVVT6yjzwsJa6w&e= .

Help support midrange.com by shopping at amazon.com with our affiliate
link:
https://urldefense.proofpoint.com/v2/url?u=https-3A__amazon.midrange.c
om&d=DwICAg&c=CqkB-gCiM4xW6iOknju0uA&r=l8_Kw5BfK6Ei8qLuvBDSAA&m=gC4EGX
0GGrA-whsnN910xGf9hVkTnzKygkrc5BmQW98&s=UjxyP55rN3VMWFVmS0fOldpzKwYzhl
Q6-vLF1ac1dgA&e=

--
This is the IBMi Open Source Roundtable (OpenSource) mailing list To post a message email: OpenSource@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.midrange.com_mailman_listinfo_opensource&d=DwICAg&c=CqkB-gCiM4xW6iOknju0uA&r=l8_Kw5BfK6Ei8qLuvBDSAA&m=gC4EGX0GGrA-whsnN910xGf9hVkTnzKygkrc5BmQW98&s=utsWlK0EQrdwigIiTHrou-HH_l8sW_amFOf5ulUc5r0&e=
or email: OpenSource-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at https://urldefense.proofpoint.com/v2/url?u=https-3A__archive.midrange.com_opensource&d=DwICAg&c=CqkB-gCiM4xW6iOknju0uA&r=l8_Kw5BfK6Ei8qLuvBDSAA&m=gC4EGX0GGrA-whsnN910xGf9hVkTnzKygkrc5BmQW98&s=uPAIZrjBww2sDy_U2u2hb16mQV7fzfVVT6yjzwsJa6w&e= .

Help support midrange.com by shopping at amazon.com with our affiliate
link: https://urldefense.proofpoint.com/v2/url?u=https-3A__amazon.midrange.com&d=DwICAg&c=CqkB-gCiM4xW6iOknju0uA&r=l8_Kw5BfK6Ei8qLuvBDSAA&m=gC4EGX0GGrA-whsnN910xGf9hVkTnzKygkrc5BmQW98&s=UjxyP55rN3VMWFVmS0fOldpzKwYzhlQ6-vLF1ac1dgA&e=
--
This is the IBMi Open Source Roundtable (OpenSource) mailing list To post a message email: OpenSource@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/opensource
or email: OpenSource-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at https://archive.midrange.com/opensource.

Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com


[https://www.medtronsoftware.com/img/MedtronMinilogo.bmp] Kevin Bucknum
Senior Programmer Analyst
MEDDATA / MEDTRON
120 Innwood Drive
Covington LA 70433
Local: 985-893-2550
Toll Free: 877-893-2550
https://www.medtronsoftware.com



CONFIDENTIALITY NOTICE

This document and any accompanying this email transmission contain confidential information, belonging to the sender that is legally privileged. This information is intended only for the use of the individual or entity named above. The authorized recipient of this information is prohibited from disclosing this information to any other party and is required to destroy the information after its stated need has been fulfilled. If you are not the intended recipient, or the employee of agent responsible to deliver it to the intended recipient, you are hereby notified that any disclosure, copying, distribution or action taken in reliance on the contents of these documents is STRICTLY PROHIBITED. If you have received this email in error, please notify the sender immediately to arrange for return or destruction of these documents.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.