
- #Informix odbc parameterized query syntax how to#
- #Informix odbc parameterized query syntax driver#
- #Informix odbc parameterized query syntax password#
To retrieve the count of affected rows use the TFD.RowsAffected property.įDQ.SQL.Yes, I noticed it and already did it. The ExecSQL method will return an error if the query returns a result set. To execute a query that does not return a result set, use the ExecSQL method. The Open method will return an error if the query does not produce a result set.įDQuery1->SQL->Text := "select * from Books where category = :Category" įDQuery1.ParamByName("category")->AsString = "US" The Open method executes the query, returns the result set, and opens it. To execute a query that returns a result set, such as a select query, use the Open method. To disable statement preparation, set ResourceOptions.DirectExecute to True for example, when you need to execute a query only once. By default, FireDAC prepares the query to avoid recompiling the same query over and over. The connection must be active and open while a statement is prepared. Preparing statements is costly in system resources and time. The example above binds a string-type input parameter by name and then opens the dataset that results. To create a parameterized query, use the following syntax below:įDQuery1->SQL->Text = "select * from Books where category = :Category" įDQuery1->ParamByName("category")->AsString = "US" When a TFDQuery component is added at design time, its Connection property is automatically set to point to a TFDConnection on the form, as in the application above. To connect the TFDQuery component to IBM Informix data, set the Connection property of the component. You can set the same properties from code:įDConnection1->ConnectionDefName = "CData IBM Informix ODBC Source" To connect to the data source, set the Connected property of the TFDConnection component to true. This section provides IBM Informix-specific examples of executing queries with the TFQuery component. You can use the TFDConnection and TFQuery components to execute queries to IBM Informix data. Drop a TFDGUIxWaitCursor onto the form - this is required to avoid a run-time error.Įxecute Commands to IBM Informix with FireDAC Components.DataSource: Select the name of the TDataSource.DataSet: In the menu for this property, select the name of the TFDQuery component.ĭrop a TDBGrid control onto the form and set the following property:.SELECT Id, Price FROM Books WHERE Category = 'US'ĭrop a TDataSource component onto the form and set the following property: SQL: Click the button in the SQL property and enter a query. Connection: Set this property to the TFDConnection component, if this component is not already specified.Connected: Select True from the menu and, in the dialog that appears, enter your credentials.ĭrop a TFDQuery component onto the form and set the properties below:.ConnectionDefName: Select the FireDAC connection to IBM Informix.In the FireDAC Connection Editor that appears, set the DataSource property to the name of the ODBC DSN for IBM Informix.Ĭreate VCL Applications with Connectivity to IBM Informix Dataįollow the procedure below to start querying IBM Informix data from a simple VCL application that displays the results of a query in a grid.ĭrop a TFDConnection component onto the form and set the following properties:.



You can then follow the steps below to use the Data Explorer to create a FireDAC connection to IBM Informix.
#Informix odbc parameterized query syntax password#
Password: Set this to the password of a user allowed to access the database.User: Set this to the username of a user allowed to access the database.Database: Set this to the name of the IBM Informix database.Port: Set this to the port the IBM Informix server is listening on.Server: Set this to the name of the server running IBM Informix.Set the following properties to connect to IBM Informix You can use the Microsoft ODBC Data Source Administrator to create and configure ODBC DSNs.
#Informix odbc parameterized query syntax driver#
This is the last step of the driver installation. If you have not already, first specify connection properties in an ODBC DSN (data source name).
#Informix odbc parameterized query syntax how to#
An additional section shows how to use FireDAC components to execute commands from code.Ĭreate a FireDAC Connection to IBM Informix Data

This article shows how to create a simple visual component library (VCL) application in C++Builder that connects to IBM Informix data, executes queries, and displays the results in a grid. The CData ODBC Driver for IBM Informix makes it easy to integrate connectivity to live IBM Informix data with standard data access components in C++Builder.
