Robotic Process Automation (RPA)

Robotic Process Automation (RPA)

Come for answers. Stay for best practices. All we’re missing is you.

 View Only
  • 1.  SQLite error - Parameter 'connection' missing

    Posted Tue November 15, 2022 12:06 PM
    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
    ------------------------------


  • 2.  RE: SQLite error - Parameter 'connection' missing

    Posted Wed November 16, 2022 09:28 AM
    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
    ------------------------------



  • 3.  RE: SQLite error - Parameter 'connection' missing

    Posted Wed November 16, 2022 10:05 AM
    Hi Vinicius,

    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!

    ------------------------------
    Alan Brian Mogliani
    ------------------------------