Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: API with parameters exported to sql database
Post: API with parameters exported to sql database

i have a URL and and also the api key to get data from an external website howvever i need to provide 2 parameters to extract the data (Date, EMPLOYEE). Once i enter the parameter i should get all the...
PYTHONDUDE General Coding Help 0 1,237 Jul-20-2020, 01:18 PM
    Thread: Python code to check SQL table for current date
Post: RE: Python code to check SQL table for current dat...

import pyodbc import sys from datetime import date timeimport pygal today = [str(date.today()) ] db = [ ("driver info " "Server = myserver;" "database = mydb;" ] cur = [db.cursor() ] sq...
PYTHONDUDE General Coding Help 3 2,955 May-16-2018, 02:23 PM
    Thread: Python code to check SQL table for current date
Post: Python code to check SQL table for current date

I would like python to check my sql table (column name date_loaded) if it is populated with current date in format yyyymmdd. if it is then continue my process else send the user and email to to che...
PYTHONDUDE General Coding Help 3 2,955 May-16-2018, 01:26 PM
    Thread: EXPORT FROM SQL SERVER TO CSV
Post: RE: EXPORT FROM SQL SERVER TO CSV

thank you that worked
PYTHONDUDE General Coding Help 2 14,183 Apr-17-2018, 06:37 PM
    Thread: EXPORT FROM SQL SERVER TO CSV
Post: EXPORT FROM SQL SERVER TO CSV

The below code works however, whenever it gets exported, the headers for each column is missing. I need it to include all headers please advise import pyodbc import csv conn =("Driver={SQLSERVER N...
PYTHONDUDE General Coding Help 2 14,183 Apr-17-2018, 04:23 PM
    Thread: execute a SQL stored proc within PYTHON
Post: execute a SQL stored proc within PYTHON

Please advise as to why this syntax will not work , in order for me to execute a sql stored proc within python. also i would like to incorporate a error check, if the stored proc fails stop the entire...
PYTHONDUDE General Coding Help 3 9,515 Mar-21-2018, 03:57 PM
    Thread: execute a SQL stored proc within PYTHON
Post: [temp] [PYTHON EXPORT SQL TO .txt file]

I am trying to execute a stored proc using the following i keep getting a error? am I using the correct syntax to call the sql stored proc import PYODBC db = pyodbc.connect("Driver={SQL...
PYTHONDUDE General Coding Help 3 9,515 Mar-21-2018, 03:26 PM
    Thread: PYTHON - send email with attachment Error
Post: RE: PYTHON - send email with attachment Error

never mind i found the solution basically this did the trick filename = 'file.txt' attachment = open("file path" + filename, "rb") #Search and you will Find # I am getting there
PYTHONDUDE General Coding Help 1 3,994 Feb-27-2018, 07:52 PM
    Thread: PYTHON - send email with attachment Error
Post: PYTHON - send email with attachment Error

I came up with the following python to send an email with attachment. the text file is located c:/python/20180227.txt (the dated file is changed daily based on current date, so tomorroow it would be...
PYTHONDUDE General Coding Help 1 3,994 Feb-27-2018, 06:52 PM
    Thread: [PYTHON EXPORT SQL TO .txt file]
Post: RE: [PYTHON EXPORT SQL TO .txt file]

for my knowledge why is it that i cant write all rows to my .txt file the csv code returns an error wrtr.write(row) Attributerror: '_csv.writer' object has no attribute to write. I updated the cod...
PYTHONDUDE General Coding Help 9 24,318 Feb-21-2018, 06:45 PM
    Thread: [PYTHON EXPORT SQL TO .txt file]
Post: RE: [PYTHON EXPORT SQL TO .txt file]

THANK YOU SO MUCH final question the print(row[0], file=f) only prints out 1 column (ID) , however my sql statement has over 10 cloumns, (ID, NAME, DATE , COUNTRY, STATE, .....) how can i modify t...
PYTHONDUDE General Coding Help 9 24,318 Feb-21-2018, 04:49 PM
    Thread: [PYTHON EXPORT SQL TO .txt file]
Post: RE: [PYTHON EXPORT SQL TO .txt file]

can you please elaborate with pseudo code
PYTHONDUDE General Coding Help 9 24,318 Feb-21-2018, 03:14 PM
    Thread: [PYTHON EXPORT SQL TO .txt file]
Post: [PYTHON EXPORT SQL TO .txt file]

I would like to export my sql server query into a txt file. import PYODBC db = pyodbc.connect("Driver={SQL Server Native Client 11.0};" "Server=server_name;" ...
PYTHONDUDE General Coding Help 9 24,318 Feb-21-2018, 02:56 PM

User Panel Messages

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