note 34335 added to function.ibase-query

From: Date: Thu, 24 Jul 2003 09:18:15 +0000
Subject: note 34335 added to function.ibase-query
Groups: php.notes 
Request: Send a blank email to php-notes+get-52543@lists.php.net to get a copy of this message
Two comments on interogating system tables in Interbase or Firebird; I hope it helps. 1. if you try to build a query string to extract data from a system table (that has the form "rdb$some_name"), you should divide the "rdb$some_name" table name in your query string using the string merge operator ".". $query = "select rdb"."$"."relation_name as TABLE_NAME from rdb"."$"."relations where rdb"."$"."system_flag=0"; 2. The second thing is related to the fact that you can later use (after the call to ibase_fetch_object) as field identifier the ALIAS used in the query for the "rdb$some_name" table. Example: $get_table_names_query = "select rdb"."$"."relation_name as TABLE_NAME from rdb"."$"."relations where rdb"."$"."system_flag=0"; // $res_table_names_query = ibase_query($dbconnection, $get_table_names_query); // while ($row_table_names = ibase_fetch_object($res_table_names_query)) { print($row_table_names->TABLE_NAME);//alias used } ---- Manual Page -- http://www.php.net/manual/en/function.ibase-query.php Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+34335 Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+34335&report=yes Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+34335&report=yes

« previous php.notes (#52543) next »