Jump to content

_SQLite_Exec() and adding multiple lines of data


Recommended Posts

My SQL skills are limited so I am unsure how to resolve this SQL issue?

Data1.txt fails to add but Data2.txt is successful.

Any help would be greatly appreciated.

The AutoIT Code:

#include <SQLite.au3>
#include <SQLite.dll.au3>

$var1 = FileRead(@ScriptDir & "\data1.txt")
$var2 = FileRead(@ScriptDir & "\data2.txt")

_SQLite_Startup()
_SQLite_Open()
_SQLite_Exec(-1, "CREATE TABLE test (a, b, c);")
_SQLite_Exec(-1, "INSERT INTO test VALUES ('hello', 'world', '" & $var1 & "');")
_SQLite_Exec(-1, "INSERT INTO test VALUES ('hello', 'world', '" & $var2 & "');")
_SQLite_Close()
_SQLite_Shutdown()

The error provided:

!   SQLite.au3 Error
--> Function: _SQLite_Exec
--> Query:    INSERT INTO test VALUES ('hello', 'world', '1/2 cup tomato sauce
1/4 cup honey
2 tablespoons Chang's Soy Sauce
2 tablespoons malt vinegar
1 tablespoon brown sugar
1 teaspoon powdered mustard
1kg beef ribs
vegetable oil, for deep-frying
4 Sebago potatoes, peeled, very thinly sliced
dressed spinach leaves, to serve');
--> Error:    near "s": syntax error

data1.txt

data2.txt

Link to comment
Share on other sites

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...