0
I intend to generate a view
through a select
with the code below, but it doesn’t work, which may be?
$row[0]
contains "select col1, col2, col3, col4, col5 from tabela1"
$select= oci_parse($ora_conexao, 'SELECT * FROM TABELA');
oci_execute($select);
while (($qrow = oci_fetch_row($select)) != false) {
$arrData[] = $row[0].'<br />';
}
$var = implode('',$arrData);
//--> cria temp view
$view = oci_parse($ora_conexao,"CREATE OR REPLACE FORCE VIEW \"TD_ADMIN\".\"view1\" (\"col1\", \"col2\", \"col3\", \"col4\", \"col5\") AS $var");
oci_execute($view);
Your description. Any error message appears?
– rray
no, the page is blank.
– user26858
Put that at the top of the page,
ini_set('display_error', true); error_reporting(E_ALL);
see if the error appears.– rray
continues blank, by the way, now I have given an echo on the connection to the bank and it presents OK for the connection and the select of the variable $var gives the result 'select col1... from Tabela1'...
– user26858
So it’s all right, only one left to do
fetch()
get the results, in the database the view is created?– rray
to test the creation of the view, I replaced the value of the $var variable with the result of $select and generated the view, so the problem must be in that chunk of the $view variable... :/ fetch() fits where?
– user26858
found the error... :/ on the line $arrData[] = $Row[0]. '<br />'; the line break for the select in the creation of the view gives sql error but did not show on the screen... : $arrData[] = $Row[0]; now yes, all solved. Thanks for the help rray.
– user26858
Creates an answer with these details :) Aaah yes syntax error.
– rray