Author Topic: Rob Database request in next version  (Read 2830 times)

onthecuttingedge2005

  • Guest
Rob Database request in next version
« on: June 18, 2012, 06:01:10 pm »
Hi Rob.

I have tried to use the delete by ID# in the table rows within the database inside HAL's brain editor but
the rows in the data do not have ID#'s, they are just blank and show no ID.

in the next version update can we include the ID# for the Table rows that way I can use this code.

Code: [Select]
Dim EmotQuery()
HalBrain.RunQuery "DELETE FROM " & UserName & "_Emotion" & " WHERE id = 1", EmotQuery

which would delete the number 1 row only.

thanks
Jerry

onthecuttingedge2005

  • Guest
Re: Rob Database request in next version
« Reply #1 on: June 18, 2012, 06:57:43 pm »
I would also like to be able to do this inside Hal's Table creation

Code: [Select]
Dim EmotQuery()
    HalBrain.RunQuery "INSERT INTO LogTest(OldName, NewName, Date) VALUES(old.Name, new.Name, datetime('now'))", EmotQuery

and also use the CREATE Table as well as all the SQLite functions.

I'm actually starting to like SQL better than I do VBscript
It's very powerful

at some point in the future could we get an SQL version of HAL's Brain with no VBscript?

Thanks
Jerry
« Last Edit: June 18, 2012, 07:01:53 pm by onthecuttingedge2005 »

freddy888

  • Hero Member
  • *****
  • Posts: 1693
    • View Profile
    • AiDreams
Re: Rob Database request in next version
« Reply #2 on: June 19, 2012, 08:08:31 am »
SQL is good but it wouldn't allow you the freedom of VBscript.

Medeksza

  • Administrator
  • Hero Member
  • *****
  • Posts: 1472
    • View Profile
    • http://www.zabaware.com
Re: Rob Database request in next version
« Reply #3 on: June 19, 2012, 09:05:13 pm »
Hi Rob.

I have tried to use the delete by ID# in the table rows within the database inside HAL's brain editor but
the rows in the data do not have ID#'s, they are just blank and show no ID.

in the next version update can we include the ID# for the Table rows that way I can use this code.

Code: [Select]
Dim EmotQuery()
HalBrain.RunQuery "DELETE FROM " & UserName & "_Emotion" & " WHERE id = 1", EmotQuery

which would delete the number 1 row only.

thanks
Jerry

The hal database uses "recordId" as its primary key, not "id", so I think this should work:

Code: [Select]
Dim EmotQuery()
HalBrain.RunQuery "DELETE FROM " & UserName & "_Emotion" & " WHERE recordId = 1", EmotQuery

Hal uses the SQLite2 engine. It should support all the SQL commands and functions built into that engine.  On the zabaware.com server side Hal is using multiple MySQL servers in a master-slave setup plus the Sphinx full-text indexing from http://sphinxsearch.com/  It is vastly superior to full text search capabilities of MySQL.
« Last Edit: June 19, 2012, 09:08:54 pm by Medeksza »
Robert Medeksza

onthecuttingedge2005

  • Guest
Re: Rob Database request in next version
« Reply #4 on: June 20, 2012, 10:32:21 am »
Thanks Rob that did the trick, works like a charm.

thanks for the additional help and heads up.


much to do.
Jerry 8)