ruby-****@sourc*****
ruby-****@sourc*****
2003年 9月 22日 (月) 05:45:58 JST
------------------------- REMOTE_ADDR = 217.117.55.140 REMOTE_HOST = URL = http://ruby-gnome2.sourceforge.jp/?tut-libgda-build-queries ------------------------- = Building commands Before invoking a query you have to build the object containing the command and you can do this with Gda::Command.new. Gda::Command.new(text, command_type, options) Possible command_type are: Gda::Command::TYPE_SQL Gda::Command::TYPE_XML Gda::Command::TYPE_PROCEDURE Gda::Command::TYPE_TABLE Gda::Command::TYPE_SCHEMA The command type we most commonly use is Gda::Command::TYPE_SQL because we will only focus on SQL queries. Possible options are: # Ignores all errors and executes all sentences returning data models. # For failed sentences, it returns an empty data model. Gda::Command::OPTION_IGNORE_ERRORS # Stops when finding and error and doesn't return data models. Gda::Command::OPTION_STOP_ON_ERRORS Here you see an example of creating a command: # text contains one or several (comma-separated) SQL commands. command = Gda::Command.new(text, Gda::Command::TYPE_SQL, Gda::Command::OPTION_STOP_ON_ERRORS)