Author Topic: Question about updating braintable's on the fly.  (Read 5657 times)

ll420ll

  • Newbie
  • *
  • Posts: 10
    • View Profile
Question about updating braintable's on the fly.
« on: December 22, 2012, 06:46:32 pm »
I want a  braintopic table to contain a whole list of attributes, but be able to edit them as conversations progress.
Is there a way to either delete, or update lines of brain tables using a hal commands or coding?
I know theres a way to pull data from brain tables into an temp array, but how could I possibly change or update that data and have hal also update that data in the braintable.
Any help would be greatly appreciated.

Is this type of function used to edit tables? or just temporary arrays?
HalBrain.RunQuery "UPDATE " & lonelyTableName & " SET topic = " & loPatience & " WHERE searchString = " & """" & patParam & """", tempQuery


This how I was storing variables that I want to save but change on the fly.  But I want to be able to save and update this data in a braintable.
    Rem PLUGIN: CUSTOMMEM

    attribute2 = HalBrain.ExtractVar(CustomMem, "attribute2")

    'PROCESS: PRESERVE ALL VARIABLES
    CustomMem = HalBrain.EncodeVar(attribute2, "attribute2")
 

Art

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3859
    • View Profile
Re: Question about updating braintable's on the fly.
« Reply #1 on: December 22, 2012, 09:27:27 pm »
Just off the top of my head: I believe Hal loads everything (including tables & scripts) from initial start up, therefore, I don't really see how it would be possible to have Hal perform an update on the FLY, so to speak. He (the program) would need to be able to load the tables and process them in accordance to your changes and such on-the-fly procedures don't seem likely.

I'm not speaking for Hal's developer, Robert Medeksza, so perhaps an email to him might offer a faster and possibly more accurate evaluation for your inquiry.

Best of luck!
In the world of AI it's the thought that counts!

- Art -

One

  • Hero Member
  • *****
  • Posts: 2184
  • Technology Advocate
    • View Profile
Re: Question about updating braintable's on the fly.
« Reply #2 on: December 28, 2012, 04:34:09 pm »
beyond talking to the modem, what are you doing on the table?

ya know the trend here is to put a silly oversized eraser on your desk, and just expect 'computer' todo the rest.

yea, and everything is also in pen.
Today Is Yesterdays Future.

Art

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3859
    • View Profile
Re: Question about updating braintable's on the fly.
« Reply #3 on: December 29, 2012, 08:13:33 am »
Wow...nice to see that you're still around, One! I thought the aliens had taken you!! ;)
In the world of AI it's the thought that counts!

- Art -

Medeksza

  • Administrator
  • Hero Member
  • *****
  • Posts: 1469
    • View Profile
    • http://www.zabaware.com
Re: Question about updating braintable's on the fly.
« Reply #4 on: December 29, 2012, 09:38:52 am »
Is this type of function used to edit tables? or just temporary arrays?
HalBrain.RunQuery "UPDATE " & lonelyTableName & " SET topic = " & loPatience & " WHERE searchString = " & """" & patParam & """", tempQuery

Yes, this is SQL, and can be used to update existing records, add new ones, delete records, or load them into an array. I recommend maybe reading an intro to SQL book or going through a tutorial of some sort. You can open up Hal's database outside of the brain editor with a free program called "SQLite Studio". If you work on a copy of the brain database, you can experiment with different SQL commands to see what they do.
Robert Medeksza

One

  • Hero Member
  • *****
  • Posts: 2184
  • Technology Advocate
    • View Profile
Re: Question about updating braintable's on the fly.
« Reply #5 on: December 29, 2012, 03:17:29 pm »
Art,
Aliens? naw just, Hospitals, jails, ect
ever since the accident it's getting progressivly worse.

(Im really tired of the state putting me with robert in different hospitals.)
Today Is Yesterdays Future.