So right now I am trying to ask for user input such as "what password do you need from the SQLITE3 database and then trying to pull the data from the database. I know how to get specific data from an SQLITE3 database by doing
user_input = input("What website would you like the password to>")
c.execute("SELECT FROM passwords WHERE website="whatever website"}")
How do I put the user_input value into the c.execute?
I am trying to create a postgresql database named my_database which will have table_yesterday, table_today, and table_tomorrow. I have never created a database before because I have only worked with .csv files.
The goal is to write a program that updates a few database tables that will be used by other programs, and if that database doesn't exist then create it and then download a ton of data into it.
How would I create a database with the username and password in my config.py file using python?
All the code I can find gives examples in sqlite.
i have a stored procedure that sends an email with an attachment, one of the developers decided to drop the lookup table with the file paths in, I've recreated the table but cant remember how the string needs to be for the file path and name to be picked up.
I've tried N'C:\Filename.xls' AND N'\\PCName\temp\filename.xls' and a few other variations but keep getting "Attachment file N'C:\Filename.xls' is invalid".
I've assigned the relevant file permissions so that there are no access restrictions on the folder or file that the file is stored in.
Thanks
I've figured it out! The SQL instance is set up to use the built in SA account for authentication by default which has no access to local drives!! what a pain!!
I'm having big trouble in copying an Oracle DB to the same server but with another name, to use as a development DB.
I'm used to SQL Server, I'm new to Oracle (11g).
I wanted to use the 'Database copy' from SQL Developer, but I'm getting errors all the way. First it was about missing tablespaces.
Then when I manually created them in my new empty DB the errors were about missing users.
I wanted to create the users manually, but then I first needed to create missing roles.
When all that was done, it failed on missing indexes...
How do I copy everything I need with 'Database copy'?
Any advice is greatly appreciated!
SQL Developer copy will only copy objects between schemas. Do you want to just make a copy of a schema? Or a whole new database, including all schemas?
Judging by your question, I'm assuming the latter. If so, RMAN "database duplication" may help you.
See http://www.oracle-base.com/articles/11g/duplicate-database-using-rman-11gr2.php at Tim Hall's excellent site.
The best way for you is to create a new user :
Launch MSDOS Shell Connect to your database using system manager
account
sqlplus / as sysdba
Then write these sequences:
CREATE USER user2 IDENTIFIED BY user2password;
GRANT ALL PRIVILEGE TO user2 WITH ADMIN OPTION;
GRANT CONNECT TO user2;
GRANT DBA TO user2;
exit oracle prompt
In MSDOS Shell again, export your current user1 like this :
exp user1/password
or
exp user1/password#connectString
if you have a connection string specified in tnsnames.ora
Answer all the questions by default, give a name to your export file, and specify that you want to export only the user user1
Then proceed to the importation of the dump in your new user2 like this :
imp user2/password2 fromuser=user1 touser=user2
Answer all the questions by default, give the name to your export file (if you don't change the default folder of CmdShell you will not have to specify the complete folder)
An interesting link on this from Oracle documentation:
http://docs.oracle.com/cd/E11882_01/backup.112/e10642/rcmdupdb.htm#BRADV010
I have an application that uses database. Data about how to connect to the database is stored in a properties file. There you can find server name, database name, username, password, ... I read this file and make a connecton to a database in my program.
How can I "hide" the password, so that someone else would have it hard time to retrieve that password?