Steve Lloyd
Steve Lloyd

Reputation: 949

Retrieving LOB objects in HANA database via ODBC and PHP

I am trying to get the definition column from sys.functions using PHP. When I query that table the definition column is blank. I am sure it is because it is a LOB column.

select definition from sys.functions

Is there a way to retrieve LOB objects from HANA using ODBC?

<?php
$odbc =     odbc_pconnect($params['dbname'],$params['dbuser'],$params['dbpass'],SQL_CUR_USE_    ODBC );
    try{
        $result=odbc_exec($odbc,$query);
        if(!$result){
            echo printValue($odbc_errormsg($odbc));exit;
        }
    }
    catch (Exception $e) {
        echo printValue($e);exit;
    }
    while(odbc_fetch_row($result)){
    for($i=1;$i<=odbc_num_fields($result);$i++){
        $field=strtolower(odbc_field_name($result,$i));
        $val=odbc_result($result,$i);
        echo "{$i}. {$field}:  {$val}".PHP_EOL;
    }
    
}
odbc_free_result($result);

?>

Upvotes: 1

Views: 234

Answers (0)

Related Questions