FAQ Database Discussion Community


How to execute an .sql file in pymssql

python,database,file,pymssql
I'm trying to execute an sql file in python using pymssql, this file contains a BEGIN TRANSACTION, a COMMIT TRANSACTION and an END, and some safety nets before and after. I'm trying to open the file in memory and execute the content: file = open(options.sqlFile, 'r') sqlFileContents = file.read() file.close()...

Trouble installing pymssql

python,anaconda,pymssql
Trying to install pymssql with an anaconda installation and keep encountering package conflicts: conda install -c https://conda.binstar.org/prometeia pymssql returns: Hint: the following combinations of packages create a conflict with the remaining packages: - python 3.4* - pymssql All packages are up to date (conda update --all) Thanks!...

mysql query for a situation?

join,pymssql
I have two tables, OrderTable(orderid,ordersum) and OrderPayments(orderid,paidamount). OrderTable orderid ordersum ORD123456 40,000.00 ORD789987 30,000.00 OrderPayments orderid paidamount ORD123456 10,000.00 ORD123456 20,000.00 ORD123456 10,000.00 ORD789987 28,000.00 For an order , payment can be made in installments. I have to get the output as orderid ordersum paidamount ORD123456 40,000.00 40,000.00 ORD789987 30,000.00...

Error Installing pymssql on Mac OS X Yosemite

python,sql-azure,osx-yosemite,pymssql
I receive the following error when installing pymssql on OS X Yosemite 10.10.3 - has anyone gotten around the following error? I am using FreeTDS (v0.91.112) version 7.1 and Python 2.7.6 - the tsql utility connects to a SQL Database with no issue. sudo pip install pymssql Error: Command "/usr/bin/python...

Installing pymssql in Centos 6.6 64-bit

python,python-2.7,pip,pymssql
I'm trying to pip install pymssql in my Centos 6.6, but kept on experiencing this error: _mssql.c:314:22: error: sqlfront.h: No such file or directory cpp_helpers.h:34:19: error: sybdb.h: No such file or directory I already installed freetds, freetds-devel, and cython. Any ideas? Thanks in advance!...

In sql.executemany(… syntax error near '('

python,mysql,pymssql,executemany
I'm trying to execute the following code in python, but it results in syntax error near '(' error for executemany(..). When I remove te names from sql and just write %s it also results in the error that there are more placeholders thant the variables does anyone know how I...

Python2.7 - pip install pymssql fails on CentOS 6.3

python,centos,pip,freetds,pymssql
I am trying to install pymssql for Python on a CentOS machine however it keeps failing on me. I have already installed the following: freetds-devel python-devel Which seems to be the fix I keep coming across in searches, however I have already installed both of these and I am still...

can not connect to pymssql from python wsgi with mod_wsgi

linux,mod-wsgi,wsgi,python-3.4,pymssql
I am new in wsgi , and now i can not connect to pymssql , after a while this line appear to error.log: [Mon Feb 02 16:12:06.629874 2015] [wsgi:info] [pid 12257] [client 127.0.0.1:48500] mod_wsgi (pid=12257, process='', application='Alireza.FY|/ii'): Loading WSGI script '/var/www/wsgi/scr.wsgi'., referer: http://localhost/ii and nothing happened after this line of...