Author Topic: Deleting/changing database info in script  (Read 3625 times)

GrantNZ

  • Full Member
  • ***
  • Posts: 178
    • View Profile
Deleting/changing database info in script
« on: December 11, 2005, 01:35:11 am »
Hi all,

Does anyone know of a way in script to do any of the following?
  • Change a database entry
  • Delete a table
  • Delete a database entry
Thanks!

« Last Edit: December 11, 2005, 01:35:35 am by GrantNZ »
 

GrantNZ

  • Full Member
  • ***
  • Posts: 178
    • View Profile
Deleting/changing database info in script
« Reply #1 on: December 11, 2005, 02:38:36 am »
Never mind! I found my own answer once I remembered the database is SQL.

For anyone else who needs it, here's how to change a topic search table entry (I've bolded terms that you need to replace):

HalBrain.RunQuery "UPDATE tablename SET topic = 'newvalue' WHERE searchString = 'lookupvalue'", temp

My issue was updating a "Version" entry in my KAOSSettings table, from 0.1 to 0.2 in script. So my specific command is:
Code: [Select]
HalBrain.RunQuery "UPDATE KAOSSettings SET topic = '0.2' WHERE searchString = 'Version'", KAOSTempAs for the rest of my questions, or how to adjust entries in other types of table, I have no idea [:)] But I'm happy for now.

Cheers,
Grant
« Last Edit: December 11, 2005, 02:40:37 am by GrantNZ »
 

Jake

  • Full Member
  • ***
  • Posts: 146
    • View Profile
    • http://Ainsworth.net
Deleting/changing database info in script
« Reply #2 on: April 21, 2008, 05:42:59 pm »
On the above topic, what is the purpose of the "temp" variable at the end of the statement...

HalBrain.RunQuery "UPDATE tablename SET topic = 'newvalue' WHERE searchString = 'lookupvalue'", temp
Austin, Texas, USA, Earth