FAQ Database Discussion Community


Python Execute() takes exactly 2 arguments (3 given)

python,sql,sqlite,python-2.x,execute
I am trying to insert into the SQLite DataBase values with this code: con.Execute('''UPDATE tblPlayers SET p_Level = ? WHERE p_Username= ? ''', (PlayerLevel,PlayerUsername)) this is the Execute function: def Execute(self,SQL): self.__connection.execute(SQL) self.__connection.comit() and i am getting this error: con.Execute('''UPDATE tblPlayers SET p_Level = ? WHERE p_Username= ? ''', (PlayerLevel,PlayerUsername))...

Postgresql: execute update on a temporary table in plpgsql is not working

postgresql,sql-update,plpgsql,execute,temp-tables
I'm trying to update a field in a temporary table I've created. The code for the temporary table looks like this: CREATE OR REPLACE FUNCTION insertTable () RETURNS VOID AS $$ BEGIN execute 'create temporary table myTable (id INTEGER, value TEXT) on commit preserve rows'; execute 'insert into myTable values(1,...

Java execute multiple console commands on loaded program

java,console,command,runtime,execute
I want to load a program from the console and then execute commands on it later on. The loading works fine, but how can I execute commands on the loaded program without starting it every time I want to use it? For example: ./randomapp command1 command2 But on Java, I...

execute stored procedure using SELECT

sql-server,select,insert,execute
I'm trying to extract data from a table in one database to insert into a table another database. There is a pre-written stored procedure for the insert, which takes multiple parameters, and I must use this since it also updates audit tables. What I currently have is a select statement...

How to get all the output in terminal

linux,ubuntu,terminal,output,execute
I execute a program in terminal the problem is that there are a lot of numeric results and the terminal juste gave me the last results. First results were hid automatically. I search a solution to display all the results. This is the top of the terminal and i cannot...

PL/SQL Execute immediate create table and insert data into it

plsql,execute
Let's have a look on my source code: CREATE OR REPLACE PROCEDURE MAKE_COPY_OF_CLASSROOMS AUTHID CURRENT_USER AS TYPE classrooms_table_type IS TABLE OF classrooms%ROWTYPE INDEX BY PLS_INTEGER; classrooms_backup classrooms_table_type; CURSOR classrooms_cursor IS SELECT * FROM classrooms WHERE year = 1 ORDER BY name; v_rowcnt PLS_INTEGER := 0; BEGIN OPEN classrooms_cursor; FETCH classrooms_cursor...

No viable alternative at input 'mytable1' cassanda cql python session.execute error

python,session,cassandra,cql,execute
I'm trying to execute a simple cql query in python and I keep getting an error. table1 = "mytable1" table2 = "mytable2" query1 = "SELECT * FROM %s" table1Rows = session.execute(query1, (table1,)) table2Rows = session.execute(query1, (table2,)) The table variables are actually passed in as arguments but I just made my...

How do I execute a shell file?

android,linux,ubuntu,execute,whatsapp
I'm trying to download Whatsapp on my laptop. I am using Ubuntu desktop software. I've installed Android Emulator from http://dl.google.com/android/android-sdk_r16-linux.tgz I unzipped the file, opened the folder, Android-sdk-linux, opened Tools and now I'm supposed to execute the file Android, and I'm not sure how to do that. Can anyone give...

Within Java, how can I execute an external app without its full path

java,path,runtime,execute
If I use the Windows run utility (Windows Key + R), and I type in "chrome.exe" it launches Chrome. Same thing for other applications that have their path in the PATH variable, of course. However, in java if I try this: Runtime.getRuntime().exec("chrome.exe"); It doesn't work. It only works if I...

Netbeans build.xml to execute when using Ant

ant,build,execute,build.xml
I'm relatively new to using build files and Ant to compile and execute from a command line so i wanted to know how it would be possible to modify the build-impl.xml file auto generated from netbeans so that after it compiles it also executes the program. Currently when i type...

Catch stdout using java

java,stdout,execute
What is the best way, how to catch stdout using java? Demonstration: PROGRAM A start PROGRAM B, PROGRAM B print some output to console (using System.println("...")), how can i catch from PROGRAM A output in console from PROGRAM B? My way is: start Program B and redirect the output to...

FFmpeg android execute

android,ffmpeg,execute
On windows I could cut a video with below code with ffmpeg.exe Can't use ffmpeg in android. I used gradle to grab ffmpeg in my app. dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile 'com.github.hiteshsondhi88.libffmpeg:FFmpegAndroid:0.2.5' } I have these lines in my method VideoIn = getInternalDirectoryPath() + "/Download/Ab.mp4"; VideoOut =...