I noticed that the connection was 'null' by looking at the variables when running it step by step - it's weird because I did exactly what was on the course and it just wasn't working. I checked your 'createNew' example against what I did and it was exactly the same as well. I removed the 'Connect to SQLite' I created and started it again and now it works for some reason. I really appreciate your help, thanks a lot!
Original Message:
Sent: Wed November 16, 2022 09:27 AM
From: Vinicius Marques
Subject: SQLite error - Parameter 'connection' missing
Hi Alan,
I believe the ${connectionSQLite} variable is null. You should initialize it first by connecting to an existing database (SQLite file) or by creating a new one.
Example of how to create a database:
sqliteConnect --createNew --sql "CREATE TABLE \"tbPeople\" (\r\n\"id\" INTEGER PRIMARY KEY AUTOINCREMENT,\r\n\"name\" TEXT,\r\n\"age\" TEXT,\r\n\"eyeColor\" TEXT,\r\n\"gender\" TEXT,\r\n\"company\" TEXT,\r\n\"email\" TEXT,\r\n\"phone\" TEXT,\r\n\"address\" TEXT\r\n);" --path "${desktopPath}\\Test1.db" connectionDatabase=connection pathDatabase=path created=success
Example of how to connect to an existing database:
sqliteConnect --connectionString "Data Source=${desktopPath}\\Test1.db;" connectionDatabase=connection pathDatabase=path created=success
------------------------------
Vinicius Marques
Original Message:
Sent: Tue November 15, 2022 11:36 AM
From: Alan Brian Mogliani
Subject: SQLite error - Parameter 'connection' missing
Hi everyone! I'm working on an IBM RPA Database training that involves creating a new table with SQLite to later insert information into it. I followed the course instructions to a T and after mapping a JSON file (that does have information) I get an error related to the INSERT command on the SQLite DB I created:
Error executing command at line 21: sqlExecute --connection ${connectionSQLite} --statement "INSERT INTO tbPeople (name, age, eyeColor, gender, company, email, phone, address)\r\nVALUES (\"${name}\", \"${age}\", \"${eyeColor}\", \"${gender}\", \"${company}\", \"${email}\", \"${phone}\", \"${address}\");"
Parameter 'connection' missing on command at line 21
But if I check my line 21 in the 'Script' tab the 'connection' parameter is there:
sqlExecute --connection ${connectionSQLite} --statement "INSERT INTO tbPeople (name, age, eyeColor, gender, company, email, phone, address)\r\nVALUES (\"${name}\", \"${age}\", \"${eyeColor}\", \"${gender}\", \"${company}\", \"${email}\", \"${phone}\", \"${address}\");"
I understand that SQLite works without installing anything, so I'm clueless as to what to do next - has anyone experienced something similar? Any guidance is more than welcomed. Thank you!
------------------------------
Alan Brian Mogliani
------------------------------