Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
code issue
#1
Hi All
I am new to python coding.
please can one look into code. its not giving any results or throwing error. Any issue in code.

location = r"C:\Users\URIDI\Desktop\CSV PARSING FILES"
def getdb_data(_input):
    fetch_query = """SELECT top 100000 TRAN_STMT_DESC,sum(trans.tran_amt) as tran_amt,count(*)   as tran_cnt from facttable""" 
    result = curs.execute(fetch_query)
    with open(os.path.join(location, f'filename_{index}.csv'), 'w') as writer:
        writer.writerows(result)
thanks
Reply
#2
With how many posts you have by now, you should know to use code tags and that your question doesn't help us to help you. What is the expected result that you're not seeing? What's your real code? (The code you've posted doesn't run.) Ideally you would come up with a runnable snippet of code which is 5-10 lines of runnable code, the more code you post, the less likely you'll get a reply (but posting too little means we can't help either).
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Updating Code And Having Issue With Keys Xileron 8 3,488 May-25-2023, 11:14 PM
Last Post: DigiGod
  NameError issue with daughter's newb code MrGonk 2 2,251 Sep-16-2021, 01:29 PM
Last Post: BashBedlam
  Calculator code issue using list kirt6405 4 3,351 Jun-11-2021, 10:13 PM
Last Post: topfox
  Issue with code for auto checkout nqk28703 2 3,068 Nov-01-2019, 09:33 AM
Last Post: nqk28703
  Visual Studio Code - PEP8 Lambda Issue Qui_Ten 1 3,703 Jan-28-2019, 08:17 AM
Last Post: buran
  Wine / liquor dispenser project code issue onlinegill 0 2,697 Nov-20-2018, 10:41 PM
Last Post: onlinegill
  Issue using cv2.cv in code Huzefa95s 7 9,664 Oct-28-2018, 06:11 AM
Last Post: Huzefa95s
  Issue in my multiprocessing Python code? PrateekG 7 5,805 Jul-19-2018, 06:47 PM
Last Post: gontajones
  Setting up python with visual studio code. Having one issue. xringo 2 4,662 May-21-2018, 12:09 AM
Last Post: snippsat
  Code issue with time remaining loop. Python3 deboerdn2000 11 11,113 May-04-2017, 04:53 PM
Last Post: deboerdn2000

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020