cx_freeze - the exe returns undescriptive error on sqldf - pandasql

Trying to create exe for my script, i am using pandasql and sqldf to create sql queries against 2 csv files for matching.after the build, when i run the .exe file, s screen with list of errors is returned as per image provided.
Your assistance will be greatly appreciated!
cx_Freeze: Python error in the main script

Related

How to execute SQL queries from text files

I am using Aqua Data Studio 7.0.39 for my Database Stuff.
I have a 20 SQL files(all contains sql statements, obviously).
I want to execute all rather than copy-paste contains for each.
Is there any way in Aqua to do such things.
Note: I am using Sybase
Thank you !!
I'm also not sure of how to do this in Aqua, but it's very simple to create a batch/powershell script to execute .sql files
You can use the SAP/Sybase isql utility to execute files, and just create a loop to cover all the files you wish to execute.
Check my answer here for more information:
Running bulk of SQL Scripts in Sybase through batch
In the latest versions of ADS there is an integrated shell named FluidShell where you can achieve what you are looking for. See an overview here: https://www.aquaclusters.com/app/home/project/public/aquadatastudio/wikibook/Documentation15/page/246/FluidShell
The command you are looking for is source
source
NAME
source - execute commands or SQL statements from a file
SYNOPSIS
source [OPTION...] FILE [ARGUMENT...]
source [OPTION...]
DESCRIPTION
Read and execute commands or SQL statements from FILE in the current shell environment.
I have not used Aquafold before so I can't tell you exactly. However I have tackled a similar problem once before.
I once created a Powershell script. It opened a ODBC connection to my database and then executed stored procedures in a loop until end of file.
I suggest having a text document with each line being the name of an Stored Proc to run. Then in your powershell script read in a line from the file concatenate it into the call to execute a stored procedure. After each execution is completed you can delete the line from the text file and then read the next line until the EOF (end of file) is reached.
Hope this helps. If I have some time this morning I will try and do a working example for you and post it.

Is it possible to use the report generator in pgadmin from command line?

PgAdmin has the ability to generate reports (dependency report, data dictionary report) on a per table basis in the GUI. I need to be able to generate them for each of my tables - is it possible to do it via commmand line or otherwise batch create them for each of my tables?
No, there is no native way to do it using PgAdmin's command line.
Here is all what you can do using command line:
PgAdmin 1.20
You can try pgquickreport project, made by myself :)
https://github.com/carlosromel/pgquickreport
You can get same results by using a command line, like this:
java -jar pgquickreport.java queryfile.sql
The pgQuickReport will generate a file queryfile.html, pretty same result obtained by PgAdmin Quick Report.

how to run multiple queries via DOS batch file, which will create plsql packages

how to run multiple queries via DOS batch file, which will create plsql packages?
I'm that far:
This is my 'driver'
#Echo Off
sqlplus [login details] #C:\runPackages.sql
EXIT
and in file runPackages.sql I have:
#C:\SqlPackage1.sql
#C:\SqlPackage2.sql
#C:\SqlPackage3.sql
Its seems, that this is working for simple Sql Queries, but its not creating packages...
Thanks for any advice.
"Well it gives me number... Just that. Like 69, or 6800. Don't know,
what does that mean."
What that means is you haven't terminated your CREATE PACKAGE scripts properly. That is SQL*Plus's way off telling you it expects you to enter another line of code. And that's why they don't run from the driver script either.
After the end; you need a new line and a slash to execute the statement. Like this
create or replace package package1 as
....
end package1;
/
Finish off each CREATE statement with the slash and your scripts will run without further input.
The teaching from this is, we need to test our individual program units first before we integrate them at a higher level.

Mysql: How to call sql script file from other sql script file?

Suppose I have wrote script Table_ABC.sql which creates table ABC. I have created many such scripts for each of required tables. Now i want to write a script that call all of these script files in a sequence so basically I want another script file createTables.sql. Mysql provides option to execute a script file from "mysql" shell application but could find some command like exec c:/myscripts/mytable.sql. Please tell me if there is any command that can be written in sql script itself to call other one in latest mysql versions or alternative for same.
Thanks
You can use source command. So your script will be something like:
use your_db;
source script/s1.sql;
source script/s2.sql;
-- so on, so forth

Can You Import an Excel File to a MySQL Database using phpMyAdmin?

Can You Import an Excel File to a MySQL Database using phpMyAdmin? I am looking to buy this database that has the data of all Colleges and Universities in the US. The file is in Excel format. Can this be imported into phpMyAdmin?
Here is the site where I am going to buy the database from if this is possible: http://www.data-lists.com/universities-colleges-database.html?gclid=CPGXkN6H6aECFeQc5wodBFPRIg
You can download a sample of the database that has 10 entries. I have tried importing this into phpMyAdmin but this is the error I am getting:
There is a chance that you may have
found a bug in the SQL parser. Please
examine your query closely, and check
that the quotes are correct and not
mis-matched. Other possible failure
causes may be that you are uploading a
file with binary outside of a quoted
text area. You can also try your query
on the MySQL command line interface.
The MySQL server error output below,
if there is any, may also help you in
diagnosing the problem. If you still
have problems or if the parser fails
where the command line interface
succeeds, please reduce your SQL query
input to the single query that causes
problems, and submit a bug report with
the data chunk in the CUT section
below:
----BEGIN CUT---- eNrtXAtsHMd5nt177R0FipQoiXqvICkiJd7xnnwJBnWiqFdIiubRjyQO5NVxSV51vGPuIYltVNNt
CgS1azhSIre20sBNXLRp2jSOm9iIW8stYLcA3RZtmodjN3Zgp3FdtLWbokVg+/rPzO7evnkXyYna
zhyHd/PvzP/N/PPP7Mw+vtGpqVNTQ+JITByJi2OjE0NiTIyLqYFkNBnKTMOR9lAoczuI95yYGRLL
H8svSqWyXIrkc2cii/OLYiyWiiXEeDQ6EIa/+IAY6xuK9Q+lEh8W8/LCoLgnNL6UuXVsSExFopH+
And then at the bottom of the error it says:
1064 - You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server
version for the right syntax to use
near 'ÐÏࡱá' at line 1
Any help is greatly appreciated.
It looks like you are trying to import a binary file.
Try to export a sheet or a range of the excel file as a CSV file. This must be a reactangle with the same structure on every row.
I've downloaded the sample data and it looks pretty organized. Just save the excel file into csv (File -> save as). Then import it using PHPMyAdmin. I think it will work perfectly fine.
Good luck! :-)