Trying to print the ocierror message but nothing comes
Greetings,
I'm trying to implement a VARRAY sample as describe here:
http://www.oracle.com/technology/pub/articles/oracle_php_cookbook/seliverstov_multirows.html
My xmlrpc php function is this:
===========
function save_word_code_vector ($params)
include("connect.php");
$table_name_val = $params->getParam(0);
$table_name = $table_name_val->scalarval();
$table_column_name_val = $params->getParam(1);
$table_column_name = $table_column_name_val->scalarval();
$table_line_val = $params->getParam(2);
$table_line = $table_line_val->scalarval();
$vector_size_val = $params->getParam(3);
$vector_size = $vector_size_val->scalarval();
$word_code_vector_val = $params->getParam(4);
$collection = oci_new_collection($db_conn, "V_ARR_WORD_CODE_VECTOR");
for ($i = 0; $i < $vectorsize; $i++)
$collection->append($word_code_vector_val->arraymem($i)->scalarval());
$query = "BEGIN SAVE_WORD_CODE_VECTOR(:table_name, :table_column_name, :table_line, :word_code_vector); END;";
$parsed = oci_parse($db_conn,$query);
oci_bind_by_name($parsed,':table_name', $table_name);
oci_bind_by_name($parsed,':table_column_name', $table_column_name);
oci_bind_by_name($parsed,':table_line', $table_line);
oci_bind_by_name($parsed,':word_code_vector', $collection, -1, OCI8_B_NTY);
$error = ociexecute($parsed);
if (!$error)
$e = ocierror();
$handle = fopen("/var/www/html/db_server/save_word_code_vector.log", "a+");
fprintf ($handle, "Function:: save_word_code_vector\n");
fprintf ($handle, " %s\n", $query);
fprintf ($handle, " %s\n\n", $e['message']);
fclose($handle);
include("disconnect.php");
return new xmlrpcresp (new xmlrpcval(0, 'int'));
include("disconnect.php");
return new xmlrpcresp (new xmlrpcval(1, 'int'));
===========
It enters the if(!$error) but my output error file only contains:
===========
Function:: save_word_code_vector
BEGIN SAVE_WORD_CODE_VECTOR(:table_name, :table_column_name, :table_line, :word_code_vector); END;
===========
The message of the ocierror does not appear. Could anyone please tell me what is wrong?
Thanks in advance,
Fernando Líbio.
Read the manual again on error handling. Check typos
(e.g. $vector_size vs. $vectorsize), and use a PHP debugger or echo
statements to follow the code flow.
Perhaps use a function to handle error conditions to avoid repeating
code.
You might consider using the bulk FORALL statement in your PL/SQL procedure.
See the example in the Underground PHP and Oracle Manual.
In your example you would use:
FORALL i IN INDICES OF word_code_vector
INSERT INTO WORD_CODE_VECTOR (SEQUENCIAL, TABLE_NAME, TABLE_COLUMN_NAME, TABLE_LINE, WORD_CODE) VALUES (WORD_CODE_VECTOR_SEQ.nextval, table_name, table_column_name, table_line, word_code_vector(i));
If all you are doing with the collection is inserting individual values into a table, consider
passing a simple PHP array to PL/SQL using oci_bind_array_by_name() instead. See
the Underground manual for an example.
This PHP code works for me:
<?php
$db_conn = oci_connect('hr', 'hrpwd', '//localhost/XE');
if (!$db_conn) {
$m = oci_error();
echo $m['message'], "\n";
exit;
$table_name = "some table";
$table_column_name = "some column";
$table_line = 123;
$word_code_vector_val = array(10, 20, 40, 50);
$vector_size = count($word_code_vector_val);
/* Create the collection for the VARRAY */
$collection = oci_new_collection($db_conn, "V_ARR_WORD_CODE_VECTOR");
/* Check for errors on oci_new_collection */
if (!$collection) {
$parse_error = ocierror($db_conn);
printf ("Function:: save_word_code_vector\n");
printf (" New Collection:: %s\n\n", $parse_error["message"]);
exit;
/* Append each value */
for ($i = 0; $i < $vector_size; $i++) {
$collection->append($word_code_vector_val[$i]);
/* Build the query that will call the stored procedure for insertion */
$query = "BEGIN SAVE_WORD_CODE_VECTOR(:table_name, :table_column_name, :table_line, :word_code_vector); END;";
$parsed = oci_parse($db_conn,$query);
if (!$parsed) {
/* Check for parse errors */
$parse_error = oci_error($db_conn);
printf ("Function:: save_word_code_vector\n");
printf (" %s\n", $query);
printf (" Parsing:: %s\n\n", $parse_error["message"]);
exit;
/* Bind the parameters */
if (!oci_bind_by_name($parsed,":table_name", $table_name)) {
printf ("Function:: save_word_code_vector\n");
printf (" Binding table_name:: %s\n\n", $table_name);
exit;
if (!oci_bind_by_name($parsed,':table_column_name', $table_column_name)) {
printf ("Function:: save_word_code_vector\n");
printf (" Binding table_column_name:: %s\n\n", $table_column_name);
exit;
if (!oci_bind_by_name($parsed,':table_line', $table_line)) {
printf ("Function:: save_word_code_vector\n");
printf (" Binding table_line:: %s\n\n", $table_line);
exit;
if (!oci_bind_by_name($parsed,':word_code_vector', $collection, -1, OCI_B_NTY)) {
printf ("Function:: save_word_code_vector\n");
printf ("Binding word_code_vector::\n\n");
exit;
$error = oci_execute($parsed);
if (!$error) {
$e = oci_error($parsed);
printf ("Function:: save_word_code_vector\n");
printf (" %s\n", $query);
printf (" %s\n\n", $e['message']);
exit;
echo "Success\n";
?>
[pre]
Similar Messages
-
I started updating my iPhone 4, but it went black screan and then started turning on and off non stop. I tried to hold the two buttons, but nothing different happened. Please, help! What should I do?!
First see if placing the iPod in Recovery Mode will allow a restore.
Next try DFU mode and restore.
How to put iPod touch / iPhone into DFU mode « Karthik's scribblings
If not successful then time for an appointment at the Genius Bar of an Apple store. You are not alone with this problem. -
My ipods frozen on the white apple and black background page. I've tried resetting with the hold button, but nothing's changed. How can I fix this!?
Try this...
Restarting your device
1) Press and hold the Sleep/Wake button for a few seconds until the red "slide to power off" slider appears, and then slide the slider.
2) Press and hold the Sleep/Wake button until the Apple logo appears.
Follow these steps to reset your device
Note: Reset your device only if it is no longer responding and the steps above do not work.
Press and hold the Sleep/Wake button and the Home button together for at least ten seconds, until the Apple logo appears.
Restart / Reset
http://support.apple.com/kb/ht1430 -
I have an epson T50 shared network, which is connected to a computer that runs on Windows 7 64-bit. The 10 days Apple has updated the printer drive and since then has been trying to print the following message: / Library/Printers/EPSON/InkjetPrinter2/Filter/rastertoescpII.app/Contents/MacOS/ rastertoescpII failed.
What should I do?The first thing you should do is re-write your post to make it a bit more understandable. I got you have an Epson printer connected to your PC, however after that your post doesn't make any sense. Are you attempting to print from your iMac, if so then you need to download and install Bonjour for Windows on your Windows machine. Then set Windows so it has printer sharing turned on and then on the iMac simply follow Apple's instructions for adding a printer.
http://support.apple.com/kb/DL999
http://support.apple.com/kb/HT4670 -
my ipod is stuck on hold mode....i tried plugging into a power source but it doesn't respond and iTunes doesn't recognize it...i also tried playing with the hold key but nothing happens...plz help
Have you tried holding the centr button and menu. This will force a shutdown.
-
HP4500 printer went off line. I can print the test page but nothing from the IMAS
Network down, re-set - now can't get the printer to function. HP4500 wireless. Was able to print a test page but when I try to print from the computer I get the "printer off-line" message. I don't know how to fix this.
Try removing the printer from the printer list, then re-add it.
Are you sure you have the latest drivers? -
Trying to open the iTunes installer but nothing appears.
Hello People.
I've just downloaded the iTunes latest version (I have never tried to install any version of iTunes before) and basically the installer doesn't open. I try to execute the installer file and nothing appears, even an error message or something.
Anyone has ever seen something like this? Anyone help me fixing this problem?
I have an iPod nano and I do need iTunes (that's the biggest issue). I use Windows XP Pro.
Thanks for the attention, looking forward to hearing you.
ps: I'm brazilian and my english is terrible, so forgive me about the mistakes please.I ve checked several forums in the net and a think that this might help us with the issue.
1st, check that you have inside your c:\windows\system32 the following dlls:
sccbase.dll
sccsccp.dll
slbcsp.dll
slbiop.dll
wmasf.dll
wmidx.dll
slbrccsp.dll
And you need to register most of them. to register them you ve to execute the command : regsvr32 xxx.dll
Doing this and making sure of uninstalling any trace of apple old installations (like old msi files) i ve reached to make the quicktime installer run !
Tonight i will try testing to install quicktime first and then the famous itunes !
The thing is that i am not sure if reinstalling windows will solve the issue (i ve formated my disck 2 months ago)
I ll let you know if i progress with this issue.
Tks. -
My ipod touch is frozen on the apple logo screen, I've tried everything on the trouble shooting page and nothing works, any suggestions?
Please tell us what you tried (the support page) to avoid wasting ours and your time.
-
One day the phone just got stuck on ios6 screen then once unlocked it said plug into iTunes. Once I did the phone will not allow me to complete a restore. At the last stages the phone will cut off. I have asked a friend to have a look and he thinks it is stuck in recovery mode loop? I don't know what else to do. The phone is not under warranty and I bought it second hand before Christmas. Please give me any help or advice.
Sounds like a hardware failure. Make an appointment at the genius bar of your local Apple Store. There is no magic that can fix a hardware failure.
-
hello . i have problem that is i forget my security answers i tried to send it to email but nothing come . how can i slove this problem . please help my thank you .
Alternatives for Help Resetting Security Questions and Rescue Mail
1. Apple ID- All about Apple ID security questions.
2. Rescue email address and how to reset Apple ID security questions
3. Apple ID- Contacting Apple for help with Apple ID account security.
4. Fill out and submit this form. Select the topic, Account Security.
5. Call Apple Customer Service: Contacting Apple for support in your
country and ask to speak to Account Security.
How to Manage your Apple ID: Manage My Apple ID -
I am using Adobe XI Pro and in various parts of the document there is brown / biege lettering when on the document it shows as black. My printer guy has been in and checked it out top to bottom and that part is fine. I have tried to print the same document and it comes out fine. Any ideas ? Using Windows 7 Service Pack 1
Sorry my bad. I have tried to print the same document on another printer and all the formatting is fine.
-
Hello,
I just got the IPhone 5 and I want to transfer photo's from my Iphone to my computer. I plug in the USB cable but nothing comes up to click on. The apple software has been updated on my computer.importing pics http://support.apple.com/kb/HT4083
restart apple mobile device http://support.apple.com/kb/TS1567 -
When I print a photo to my epson printer, it comes out larger than the original photo - so the photo prints beyond the borders. Tried readjusting all sorts of things but nothing helps. I had this same problem with my Canon. any ideas?
Crop to the print size before pringing
LN -
My itunes will not open at all - I repeatedly get the message"itunes library is corrupted...not installed correctly...please reinstall itunes" I have tried opening all my itunes folders but nothing will even open.
Let's try a repair install of iTunes first.
Restart the PC. If you're using Vista or 7, now head into your Uninstall a program control panel, select "iTunes" and then click "Repair". If you're using XP, head into your Add or Remove Programs control panel, select "iTunes", click "Change" and then click "Repair".
Can you launch your iTunes now? -
My iphone 4 has died and says connect to itunes. itunes restore wont work, error message 2001, then 2006 appears.Tried all the troubleshooting help, but nothing works. Any ideas???
I solved my own problem. Hopefully this will help someone else.
I did a DFU restore, then started it up as a new phone on iTunes. Everything loaded properly, then from iTunes did a restore from backup, selected the one I wanted and it still took me to the same screen with 3 options of restore. I chose the start up as new phone from the actual phone and after all the syncing was completed, my phone is back in working order.
Maybe you are looking for
-
CD/DVD Drive Not Recognized
I have a Dell Laptop with Vista. After installing iTunes the CD/DVD drive is no longer recognized by the computor. I have to remove the upper filter for the CD/DVD drive using 'regedit', reboot the computor and the drive is recognized again. But, iTu
-
LR may require PS Cam Raw plug-in v 8.5 for compatibility
I get the msg "this version of Lightroom may require the Photoshop camera raw plug-in version 8.5 for full compatibility" I have updated ACR, LR and PS. Removed older version of PS (Now at 2014 release, 20140508.r.58 x64) on macbook pro, OS X. How d
-
Using Photoshop layers in InDesign?
Hi all, I'm having much more difficulty finding a solution than I thought I would. Any help is greatly appreciated! I have a designer that has put a magazine spread together in Photoshop. It has the background, graphics, and text. I'm looking to
-
Aperture 3 and underexposed RAW conversion
I run Aperture 3.03 with CameraRAW 3.3 and OS 10.6.4. I use a Nikon D300 and download as referenced images into Aperture via a SanDisk card reader. Somewhere around the time I upgraded to CameraRAW 3.3 and OS 10.6.4 (not exactly at the same time but
-
Do you recommend an antivirus?
Hello, I am downloading files using Utorrent, Do you recommend to get an antivirus for my mac or i dont need to? if so which is the best one? Thank you very much Norman