Welcome to Pauls PureProject
 Home Online Reference Guide duplicated from http://cvs.purebasic.com  
 Online Resources
   · Reference

 Libraries
     2DDrawing
     Billboard
     Camera
     CDAudio
     Cipher
     Clipboard
     Console
     Database
     Date
     Desktop
     Engine3D
     Entity
     File
     FileSystem
     Font
     Gadget
     Help
     Image
     ImagePlugin
     Joystick
     Keyboard
     Library
     Light
     LinkedList
     Material
     Math
     Memory
     Menu
     Mesh
     Misc
     Module
     Mouse
     Movie
     Network
     OnError
     Packer
     Palette
     Particle
     Preference
     Printer
     Requester
     Sort
     Sound
     SoundPlugin
     Sprite
     Sprite3D
     StatusBar
     String
     SysTray
     Terrain
     Texture
     Thread
     Toolbar
     Window

 DatabaseUpdate

Syntax

Result = DatabaseUpdate(Request$)
Description
Executes the SQL 'Request$' on the current database. This command is similar to DatabaseQuery() but doesn't affect the NextDatabaseRow() command, which means it's not possible to do a 'SELECT' like request with this command. This command is very handy when something has to be changed in the database for each record. If the 'Result' is 0, then the query can't be executed correcty (SQL fault, bad formatted query, etc.. The error text can be retreived with DatabaseError()).

Example
  ; First, connect to a database with an employee table
  ;
  If DatabaseQuery("SELECT * FROM employee") ; Get all the records in the 'employee' table
  
    While NextDatabaseRow() ; Loop for each records
      
      ; Update the 'checked' field for each records, assuming the 'id' field is 
      ; the first one in the 'employee' table
      ;
      DatabaseUpdate("UPDATE employee SET checked=1 WHERE id="+GetDatabaseString(0)) 
    Wend
  EndIf

Supported OS

Windows, Linux

<- DatabaseQuery() - Database Index - ExamineDatabaseDrivers() ->



Hosted by Reel Media Productions Copyright©2001-2004 All Rights Reserved