Firebird Documentation IndexFirebird Vulcan Release Notes v. 1.1The fb_config Utility → Using Internal SQL
Firebird Home Firebird Home Prev: Object Definition SyntaxFirebird Documentation IndexUp: The fb_config UtilityNext: Building Firebird Vulcan

Using Internal SQL

Internal SQL is very much like JDBC. One starts by constructing a PStatement object by invoking the prepareStatement method of the Connection object on a SQL string that can include wild cards.

Syntax

PStatement statement = connection->prepareStatement (
      "select"
      "   rfr.rdb$field_name,"
      "   rfr.rdb$field_position "
      "from "
      "   rdb$relation_fields rfr join"
      "   rdb$fields fld on"
      "      rfr.rdb$field_source = fld.rdb$field_name "
      "where"
      "    rdb$relation_name = ?");
  

The PStatement has a method for establishing values for the wildcards.-

      statement->setString(1, rel_name);
  

Executing a query statement produces an RSet object.-

      RSet resultSet = statement->executeQuery();
  

The RSet object iterates through the query results.-

  while (resultSet->next())
      {
      int seq = resultSet->getInt(2);
      const char *fieldName = resultSet->getString(1);
      &
      }
  
Prev: Object Definition SyntaxFirebird Documentation IndexUp: The fb_config UtilityNext: Building Firebird Vulcan
Firebird Documentation IndexFirebird Vulcan Release Notes v. 1.1The fb_config Utility → Using Internal SQL