Problems with importing SQLite3 with Exec in Gambas

Post

Posted
Rating:
#1 (In Topic #1219)
Enthusiast
gambafeliz is in the usergroup ‘Enthusiast’
I have a file with data that I want to add to an empty table. But when I use this statement on an already open database, it doesn't work. But when I do it from within in SQLite3 this same statement works perfectly fine. Give me some clue why it doesn't work. Indicate tells me that the (.) in front of import is the problem.

Code (gambas)

  1.       sSQL = ".import " & Application.Path & "/" & "file.dat table1"
  2.       mg.gConn.Exec(sSQL)
  3.  

For your misfortunes I am Spanish and I only know Spanish, please, be patient with me, Thank you. :)
Online now: No Back to the top

Post

Posted
Rating:
#2
Avatar
Regular
thatbruce is in the usergroup ‘Regular’
 Thats because ".import" is an sqlite (the terminal front end) command, not an SQL verb. The gb.db.sqlite component works with the sqlite library, not the front end. You need to send the command to the front end via Shell or Exec.
b

Online now: No Back to the top

Post

Posted
Rating:
#3
Enthusiast
gambafeliz is in the usergroup ‘Enthusiast’
Thank you very much, it will surely be like that.

For your misfortunes I am Spanish and I only know Spanish, please, be patient with me, Thank you. :)
Online now: No Back to the top
1 guest and 0 members have just viewed this.