iam using zendFramework2.5.1 with Oracle 11g. Database connectivity/DML queries executing fine.
i need to export the column names of a table present in oracleDB. i use Zend\Db\TableGateway\TableGateway for DB connectivity. i learnt that by using Zend\Db\Metadata\Metadata column names could be retrived. Using the $tableObject (as shown below), i retrieved the existing adapter object and table name. No issues here.
$metadataObject = new Metadata($tableObject->getAdapter());
$tableName = $tableObject->getTable();
But when below code executes, exception occurs.
$metadataTable = $metadataObject->getTable($tableName);
Exception
Zend\Db\Adapter\Exception\RuntimeException
File:
C:\wamp\www\zfc2\vendor\zendframework\zend-db\src\Adapter\Driver\Oci8\Statement.php:260
Message:
ORA-01745: invalid host/bind variable name
Stack trace:
#0 C:\wamp\www\zfc2\vendor\zendframework\zend-db\src\Metadata\Source\OracleMetadata.php(137): Zend\Db\Adapter\Driver\Oci8\Statement->execute(Array)
#1 C:\wamp\www\zfc2\vendor\zendframework\zend-db\src\Metadata\Source\AbstractSource.php(316): Zend\Db\Metadata\Source\OracleMetadata->loadConstraintData('CSS_MILIBRIS_US...', 'LNK1DB')
#2 C:\wamp\www\zfc2\vendor\zendframework\zend-db\src\Metadata\Source\AbstractSource.php(142): Zend\Db\Metadata\Source\AbstractSource->getConstraints('CSS_MILIBRIS_US...', 'LNK1DB')
#3 C:\wamp\www\zfc2\vendor\zendframework\zend-db\src\Metadata\Metadata.php(178): Zend\Db\Metadata\Source\AbstractSource->getTable('CSS_MILIBRIS_US...', NULL)
#4 C:\wamp\www\zfc2\module\Kiosque\src\Kiosque\Controller\LandingController.php(76): Zend\Db\Metadata\Metadata->getTable('CSS_MILIBRIS_US...')
#5 C:\wamp\www\zfc2\vendor\zendframework\zend-mvc\src\Controller\AbstractActionController.php(82):
i referred the ZendDBManual Link. and tried the same. i analyzed the exception,but couldn't proceed further with what i have analyzed.
What i observed going through websites is, this has something to do with accessing restricted variables present in oracle (am not sure about it).
. Any help in providing solution for this issue is much appreciated.