Home » Developer & Programmer » Forms » unable to preform query (merged by CM)
icon12.gif  unable to preform query (merged by CM) [message #455580] Wed, 12 May 2010 04:06 Go to next message
purelove
Messages: 32
Registered: May 2010
Location: bahrain
Member
hi everyone
Actually as I'm new to Oracle and now these days I'm trying to create my first project,well I have a book table,and i want to put a picture"book title" for each book...
I had read the all pages here which is disscused before about the BLOB,but i didn't get any meaningful things,,,


first of all,,
i change my actual book table,to put the BLOB by:

alter table book
add photo BLOB;

>>>> the table was altered successfully

then i create a data block"form" form the book

after that i nsert a text_box--->>i named "BOX" this text_box to write the path of the picture,,
after that i create a button ,which contains a trigger:when_button_pressed: I write in it this code:



begin
EXECUTE_QUERY(NO_VALIDATE);
:System.Message_Level := '25';
READ_IMAGE_FILE(:book.box,'ANY','book.photo');
WRITE_IMAGE_FILE(:book.box,'ANY','book.photo');
IF NOT FORM_SUCCESS THEN
MESSAGE('This book does not have a photo on file.');
END IF;
:SYSTEM.MESSAGE_LEVEL := '0';
COMMIT_FORM;
end;



when i run the form,,,
and I try to execute the query,it doesn't execute at all,,
I don't konw why the fields it's sems to be empty with no data!!
but when i put the path of the picture in the text_box and then i pressed the button in which i put the trigger in it:
an error occure is:
1- frm-40505 oracle error:unable to preform query.
but the picture is displayed successfully... but the other fields of book table:isbn,author..... etc it's empty!!! but I already insert such of values in it by sql*plus.....



so the main problem here,to how can I retrive my data!and run the query successfully..!!
I hope u help as soon as possible,,thank you very much..!!!

and here a snapshoot of my form,,,
  • Attachment: book_form.jpg
    (Size: 16.75KB, Downloaded 530 times)
Re: unable to preform query (merged by CM) [message #455586 is a reply to message #455580] Wed, 12 May 2010 04:11 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
Use help -> display error on the menu to see what the problem is.
Re: unable to preform query (merged by CM) [message #455594 is a reply to message #455586] Wed, 12 May 2010 04:23 Go to previous messageGo to next message
purelove
Messages: 32
Registered: May 2010
Location: bahrain
Member
I don't know what's the problem is..!!!!!
Re: unable to preform query (merged by CM) [message #455598 is a reply to message #455586] Wed, 12 May 2010 04:31 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
cookiemonster wrote on Wed, 12 May 2010 10:11
Use help -> display error on the menu to see what the problem is.

Re: unable to preform query (merged by CM) [message #455601 is a reply to message #455594] Wed, 12 May 2010 04:36 Go to previous messageGo to next message
purelove
Messages: 32
Registered: May 2010
Location: bahrain
Member
cuz when I put that error in the help bar:
Processing error encountered. The table associated with the current block of the form might not exist, or your username might not have authority to perform the specified action on the table.

but the table "book: it's exits in my DB,,,also am working with admin authority,,!!! so what's maybe the problem with this,,,,plz help me...!!
Re: unable to preform query (merged by CM) [message #455612 is a reply to message #455601] Wed, 12 May 2010 04:49 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
That doesn't sound like anything display error should show.
Did you select it immediately after getting the frm-40505 error?
Post a screen shot.
Re: unable to preform query (merged by CM) [message #455621 is a reply to message #455612] Wed, 12 May 2010 05:11 Go to previous messageGo to next message
purelove
Messages: 32
Registered: May 2010
Location: bahrain
Member
after i run the form,
a press o execute--->to execute the form,but the information for each field it doesn't display...but after that i wrote the path in the tex_box and press the upload button --->what is shows "snap shoot"..
an error occur... frm-40505 oracle error:unable to preform query.

i want to know why the info of table "book" it doesn't display??!!!!!!!!!!!!!!!!!!


Re: unable to preform query (merged by CM) [message #455624 is a reply to message #455621] Wed, 12 May 2010 05:16 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
purelove wrote on Wed, 12 May 2010 11:11
after i run the form,
a press o execute--->to execute the form,but the information for each field it doesn't display...but after that i wrote the path in the tex_box and press the upload button --->what is shows "snap shoot"..
an error occur... frm-40505 oracle error:unable to preform query.

And once you get that error select display error from the help menu. Then post a screenshot of the window that gets displayed here.
Re: unable to preform query (merged by CM) [message #455630 is a reply to message #455624] Wed, 12 May 2010 05:27 Go to previous messageGo to next message
purelove
Messages: 32
Registered: May 2010
Location: bahrain
Member
"BOX">>>>>INVALID idintifier!!!!!!!
  • Attachment: err.jpg
    (Size: 20.67KB, Downloaded 533 times)
Re: unable to preform query (merged by CM) [message #455631 is a reply to message #455630] Wed, 12 May 2010 05:29 Go to previous messageGo to next message
purelove
Messages: 32
Registered: May 2010
Location: bahrain
Member
the "BOX" is the name of the text_box in which i will put the path of the "picture"..!!
Re: unable to preform query (merged by CM) [message #455633 is a reply to message #455631] Wed, 12 May 2010 05:33 Go to previous messageGo to next message
purelove
Messages: 32
Registered: May 2010
Location: bahrain
Member
ammmm so I have also to declare the file path in my db"table book"???


cuz i alter the table like this:
alter table book
add photo BLOB;


i have to alter it like that:

alter table book
add photo BLOB NULL
BOX VARCHAR2(255) NULL ; // BOX=which is the file path..???!!


isn't ..???


ammmm !!?????

[Updated on: Wed, 12 May 2010 05:36]

Report message to a moderator

Re: unable to preform query (merged by CM) [message #455634 is a reply to message #455633] Wed, 12 May 2010 05:36 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
No.
You need to change the database item property of the box item to No.
Re: unable to preform query (merged by CM) [message #455639 is a reply to message #455634] Wed, 12 May 2010 05:59 Go to previous messageGo to next message
purelove
Messages: 32
Registered: May 2010
Location: bahrain
Member
yaaaaaaaa the query it displayed
but when i upload the pic : an error occur which is : frm-47105 no image name specefied
after that when i go back and change the BOX to an db item,and do these step again,the pic is displayed but the query not!!!so what is the problem now!!!!!
Re: unable to preform query (merged by CM) [message #455640 is a reply to message #455639] Wed, 12 May 2010 06:03 Go to previous messageGo to next message
purelove
Messages: 32
Registered: May 2010
Location: bahrain
Member
and also it display the msg which i wrote it in if statement 'This book does not have a photo on file.'

IF NOT FORM_SUCCESS THEN
MESSAGE('This book does not have a photo on file.');
END IF;



so this mean the form doesn't SUCCESS,,!!!!
Re: unable to preform query (merged by CM) [message #455642 is a reply to message #455640] Wed, 12 May 2010 06:14 Go to previous messageGo to next message
purelove
Messages: 32
Registered: May 2010
Location: bahrain
Member
I try so many things,, also same error!! what can I do??..!!!
Re: unable to preform query (merged by CM) [message #455647 is a reply to message #455642] Wed, 12 May 2010 06:32 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
If the image is not stored in the database, query can not retrieve it. You might need to do that in POST-QUERY trigger.
Re: unable to preform query (merged by CM) [message #455653 is a reply to message #455647] Wed, 12 May 2010 06:51 Go to previous messageGo to next message
purelove
Messages: 32
Registered: May 2010
Location: bahrain
Member
this mean i have to put my query in post-query trigger instead of when_button_pressed"..????
Re: unable to preform query (merged by CM) [message #455654 is a reply to message #455653] Wed, 12 May 2010 06:56 Go to previous messageGo to next message
purelove
Messages: 32
Registered: May 2010
Location: bahrain
Member
I write the same code in the post-query,,,
an errors occur-->> then i removed execute_query; also I remove the coomit_form;!!! also the the query doesn't retrieve the pic!!!
Re: unable to preform query (merged by CM) [message #455655 is a reply to message #455654] Wed, 12 May 2010 07:03 Go to previous messageGo to next message
purelove
Messages: 32
Registered: May 2010
Location: bahrain
Member
i just remove the execute_query also i renove the commit_form>>>>>it work now Smile


thank u cookiemonster and littlefoor for your attention,god plus u
Re: unable to preform query (merged by CM) [message #455676 is a reply to message #455655] Wed, 12 May 2010 08:36 Go to previous message
gregor
Messages: 86
Registered: March 2010
Location: Germany
Member
hi,

- here an example
to use on the upload-button. Call the function (attached/load_pictures). The Returnvalue can be use to make a Query on a block base the Picturetable.
-- Restrictions: you can only load pictures from "Directroy(ies)", you had definied per "Create DIRECTORY..". The Inputvalue of the function is only the filename.
Previous Topic: Java in Oracle Developer 10g R2
Next Topic: Forms
Goto Forum:
  


Current Time: Fri Sep 20 08:36:21 CDT 2024