Thanks
Got it to work.
Next things to figure out.

If I want to run a rpg pgm daily. I can put on job scheduler or on a menu. Etc.
How do I have a regular user run a python program. Can I schedule it?

Can I connect to my sql server?



-----Original Message-----
From: OpenSource <opensource-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Kevin Adler
Sent: Thursday, January 9, 2020 11:22 AM
To: opensource@xxxxxxxxxxxxxxxxxx
Subject: [EXTERNAL] Re: [IBMiOSS] beginning python

Sure. I didn't look at the SQL, just fixed the function call.


----- Original message -----
From: John Yeung <gallium.arsenide@xxxxxxxxx>
Sent by: "OpenSource" <opensource-bounces@xxxxxxxxxxxxxxxxxx>
To: IBMi Open Source Roundtable <opensource@xxxxxxxxxxxxxxxxxx>
Cc:
Subject: [EXTERNAL] Re: [IBMiOSS] beginning python
Date: Thu, Jan 9, 2020 10:17 AM

On Thu, Jan 9, 2020 at 11:10 AM Kevin Adler <kadler@xxxxxxxxxx> wrote:
>
> You're calling the function wrong. You may want to read the docs
> ([1][1]https://www.python.org/dev/peps/pep-0249/#id15 ). Here's
what you want:
>
> query = "select bhuact, bhubld, bhuutl, rvdes, bhuuse, bhuamt,
bhutax " \
> "from ublhu inner join urvc on bhurvc = rvrvc" \
> "and bhuact = ? and bhubld between ? and ? " \
> "and bhurvc <> ' ' " \
> "order by bhubld, bhuact, bhurvc "
> cursor.execute(query, (acct, begdate, enddate))

Except that he'll need to be more careful with the leading and/or
trailing spaces, or lack thereof.

I am not completely sure what he put in his e-mail is actually what
he's got in his source code, but if it is, there will be a problem
with the SQL.

John Y.
--
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: [2]https://linkprotect.cudasvc.com/url?a=https%3a%2f%2flists.midrange.com%2fmailman%2flistinfo%2fopensource%c2%a0&c=E,1,YmCZWXtMRrkog2jCCfcIDQuKu0ooCfxC6OFn7z0UI8VXlYOiiXGpci_Cig5LwaVIQYtwazLwlc3Kvkm-XB3MF9vmuJVjmSMn5-8Y66H7f9loSYBQzr8,&typo=1
or email: OpenSource-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at [3]https://linkprotect.cudasvc.com/url?a=https%3a%2f%2farchive.midrange.com%2fopensource%c2%a0.&c=E,1,GL9m4VT5scBmuPsg4kvasn2ZEtZ9rXy843-w-eu0g3mI8H8RTMhtBBTRuprn4jBbTP-m-viBqy9PRFUVLMBN9CKECf2xilTcHIUV8P_wJ7gBKuE9gQ,,&typo=1

Help support https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fmidrange.com&c=E,1,X8EDtMC16QfCTqLfEh3gG_LxmCcfV6niM24ocgxK81vgJABWlBqRyg3IslFijEeVjRKK0qEzxybZuIz0FqBPi5_MjM7fEBLkjIDZ-UhxeIErDGr9FGw9u8np&typo=1 by shopping at amazon.com with our affiliate
link: [4]https://amazon.midrange.com




References

Visible links
1. https://www.python.org/dev/peps/pep-0249/#id15
2. https://linkprotect.cudasvc.com/url?a=https%3a%2f%2flists.midrange.com%2fmailman%2flistinfo%2fopensource&c=E,1,7tWOJG8TycRBEqrZYLvLCwLdR2wuKUaypAF9Dkg9YqL3WrsISphBIiz8Dw_EURwwZdpPIhWn8xoRiD1lviYKZTQaNDp6iZtB4K01OrwcXgz6ZMAi&typo=1
3. https://linkprotect.cudasvc.com/url?a=https%3a%2f%2farchive.midrange.com%2fopensource&c=E,1,Jd71bfWZm6uUDKGZMaMmV-uWNvQ8ikNIq5WjKLH7EOEaY3XoDXmvaUNqUdNJiC362HUR7Gih3aELVFRbV34BCDPts3aEJncm8hmjlAyI&typo=1
4. https://linkprotect.cudasvc.com/url?a=https%3a%2f%2famazon.midrange.com%2f&c=E,1,vKLpLfnu537s4xqTxbP7nIecqlO0fWbt8O3npuRmeTp3-HY87LPf3bzyL1XybH9hueO-cUP-EFR1WVe1vreYi8Mdjk6_CO9NtYCfzGAj6w,,&typo=1
--
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://linkprotect.cudasvc.com/url?a=https%3a%2f%2flists.midrange.com%2fmailman%2flistinfo%2fopensource&c=E,1,TBNLupSp3DnHgKDoTBsmm5HwDcz3L22EBh9za4Q8dmGBBPpRLGElzkGueDj7jL48xakv5fUKnqFGLKOEhqggj--nk_chCPYwsKEelmjipwrSa1zoJQ,,&typo=1
or email: OpenSource-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at https://linkprotect.cudasvc.com/url?a=https%3a%2f%2farchive.midrange.com%2fopensource.&c=E,1,sAHZxI2ov4gYT3zLUc1Iqb-7owd5w9yGdmrRWOEAJ6KGFEKqJc7rVh-4JS_1joTt6_TsDFZ1mkBLULFK5hxofifpUPhKHmU0YuA9_cOJe8EYxZYU&typo=1

Help support https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fmidrange.com&c=E,1,-XV9ox9W2_R9l-DzhzaurrojZmC-NaMMALWZj9tCS4Fv2az_ShHJF7iB98xK5jYioLHvHKLKV_9M9y5bXB06wQeLixLsgfqtoyI3iApraOTX0crNjT2p&typo=1 by shopping at amazon.com with our affiliate
link: https://linkprotect.cudasvc.com/url?a=https%3a%2f%2famazon.midrange.com&c=E,1,enhroCZ6bzhVaOE6IxxD0lCS10dEqWbadQrPgPBZ6EtV5VeQ9UjzYvA58Xbp3J1KQnNdDErOsxj6CdA9uQke-P6fB1LlNfgdUPKgQgacqveYCaYIiN4pSqYBuBA,&typo=1
NOTICE: This message, including any attachment, is intended as a confidential and privileged communication. If you have received this message in error, or are not the named recipient(s), please immediately notify the sender and delete this message.

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-2020 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].