note 32949 added to function.ora-do
| From: | ecingala at caramail dot com | Date: | Wed, 11 Jun 2003 15:21:52 +0000 |
| Subject: | note 32949 added to function.ora-do | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-50194@lists.php.net to get a copy of this message | ||
// THIS IS THE NEXT PART OF THE PREVIOUS CODE
// ------------------- execution de la requete -----------------
// create cursor1 and parse it with query1
if (!($cursor1= ora_open($ora_conn)))
{ reportError ($ora_conn, "* Insert Cursor could not be opened for the first query!
");
exit; // Termine le script courant }
if (!ora_parse ($cursor1, $query1))
{ reportError ($cursor1, "* Connection opened but Statement could not be parsed for the
first query! ");
exit; }
// create cursor2 and parse it with query2
if (!($cursor2= ora_open($ora_conn)))
{ reportError ($ora_conn, "* Insert Cursor could not be opened for the second query!
");
exit; }
if (!ora_parse ($cursor2, $query2))
{ reportError ($cursor2, "* Connection opened but Statement could not be parsed for the
second query! ");
exit; }
// create cursor3 and parse it with query3
if (!($cursor3= ora_open($ora_conn)))
{ reportError ($ora_conn, "* Insert Cursor could not be opened for the third query!
");
exit; }
if (!ora_parse ($cursor3, $query3))
{ reportError ($cursor3, "* Connection opened but Statement could not be parsed for the
third query! ");
exit; }
// execution de la query1
if (!ora_exec($cursor1))
{ ora_close($cursor1); ora_close($cursor2); ora_close($cursor3);
ora_rollback($ora_conn);
reportError ($cursor1, "* Statement could not be executed, but has been parsed! Error
in query1.");
exit;
}
// execution de la query2
if (!ora_exec($cursor2))
{ ora_close($cursor1); ora_close($cursor2); ora_close($cursor3);
ora_rollback($ora_conn);
reportError ($cursor2, "* Statement could not be executed, but has been parsed! Error
in query2.");
exit;
}
// execution de la query3
if (!ora_exec($cursor3))
{ ora_close($cursor1); ora_close($cursor2); ora_close($cursor3);
ora_rollback($ora_conn);
reportError ($cursor3, "* Statement could not be executed, but has been parsed! Error
in query3.");
exit;
}
/* Si toutes les etapes precedentes ont reussies, alors on arrive ici :
Les 3 requetes ont été exécutées. */
ora_commit($ora_conn); // if everything is OK
echo "<p><font size='+1'><b>VOS DONNEES ONT ETE AJOUTEES A LA
BASE.</b></p>";
echo "<p><font size='+1'><b>YOUR DATAS HAVE BEEN ADDES TO THE
DATABASE</b></p>";
//Se déconnecter de la base
ora_logoff($ora_conn);
Use it well !!!
Eddy Cingala
ecingala@caramail.com
----
Manual Page -- http://www.php.net/manual/en/function.ora-do.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+32949
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+32949&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+32949&report=yes