Well depends on what you call native support:
I'd say:
Casper.
- sql access
- webservices
/**
* Returns an array of the fields in given table name.
*
* @param Model $model Model object to describe
* @return array Fields in table. Keys are name and type
*/
function &describe(&$model) {
$cache=parent::describe($model);
if ($cache != null) {
return $cache;
}
$fields = array();
$sql = 'SELECT * FROM ' . $this->fullTableName($model);
$result = odbc_exec($this->connection, $sql);
$count = odbc_num_fields($result);
for ($i = 1; $i <= $count; $i++) {
$cols[$i - 1] = odbc_field_name($result, $i);
}
foreach ($cols as $column) {
$type = odbc_field_type(odbc_exec($this->connection, 'SELECT ' . $column . ' FROM ' . $this->fullTableName($model)), 1);
$fields[$column] = array('type' => $type);
}
$this->__cacheDescription($model->tablePrefix . $model->table, $fields);
return $fields;
}
/**
* Returns an array of the fields in given table name.
*
* @param Model $model Model object to describe
* @return array Fields in table. Keys are name and type
*/
function &describe(&$model) {
$cache=parent::describe($model);
if ($cache != null) {
return $cache;
}
$fields = array();
// modifying this area to be incompliance with Progress DB's quirks
// Can't have those backtics on the table name...
$myTableName = $this->stripTics($this->fullTableName($model));
// Use Progress's SYSPROGRESS table to get the column attributes of the table
$sql = ' SELECT "SYSCOLUMNS"."COL",
"SYSCOLUMNS"."WIDTH",
"SYSCOLUMNS"."COLTYPE"
FROM "SYSPROGRESS"."SYSCOLUMNS" "SYSCOLUMNS"
WHERE "SYSCOLUMNS"."TBL"=\''.$myTableName.'\'';
$result = odbc_exec($this->connection, $sql);
while (odbc_fetch_row($result)) {
$column = odbc_result($result, 1);
$type = odbc_result($result, 3);
$fields[$column] = array('type' => $type);
}
$this->__cacheDescription($model->tablePrefix . $model->table, $fields);
return $fields;
}
/**
* Returns the table name stripped of the tic marks.
*
* @param string $tableName String to be stripped of tics for Progress DB use
* @return string "naked" table name, just the characters, ma'am
* @todo Clean up this whole thing for production
*/
function stripTics($tableName) {
$myTableNameLength = strlen($tableName);
$myTableName = substr($tableName, 1, $myTableNameLength - 2);
return $myTableName;
}
In the time since I made the OP, I've decided to go it alone. There's a framework called Cakephp that handles ODBC but it doesn't subscribe to the Progress way of doing things, so I'm re-writing the ODBC portion of the framework to support Progress (as well as possible). From what I understand, Sybase and a few other DBMS are similar to Progress. If anybody is interested in this little project of mine, feel free to ask questions or provide suggestions. I'm writing this against a 9.1E database, if that makes a difference.
Suggestions are welcome.