Home » SQL & PL/SQL » SQL & PL/SQL » Insert pdf
Insert pdf [message #375968] Mon, 15 December 2008 08:53 Go to next message
vijju56
Messages: 22
Registered: December 2008
Junior Member
Hi,

I know that there is discussion before of inserting pdf file into BLOB column.

But here, I am inserting pdf file as BINARY data like (space occupied by the pdf file) into the BLOB column.

So, here is my code:

CREATE OR REPLACE PROCEDURE insert_pdf(v_id IN tmp_pdf.id%TYPE,
v_pdf IN tmp_pdf.pdf%TYPE
) IS

BEGIN
INSERT INTO tmp_pdf
(id,
pdf)
VALUES
(v_id,
v_pdf);
COMMIT;

END insert_pdf;


But when my java team member tried to insert pdf from java program , he is getting an error like

ORA-06550: line 1, column 7:

PLS-00905: object DBA_PDF3.INSERT_PDF is invalid

ORA-06550: line 1, column 7:

PL/SQL: Statement ignored


Can any one help me in this

Thanks


Re: Insert pdf [message #375969 is a reply to message #375968] Mon, 15 December 2008 08:55 Go to previous messageGo to next message
Michel Cadot
Messages: 64111
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
This means your procedure didn't compile.

Please read OraFAQ Forum Guide, especially "How to format your post?" section.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code (See SQL Formatter) and use code tags.
Use the "Preview Message" button to verify.
Also always post your Oracle version (4 decimals).

Use SQL*Plus and copy and paste your session when creating the procedure including the command "show errors".

Regards
Michel

[Updated on: Mon, 15 December 2008 08:56]

Report message to a moderator

Re: Insert pdf [message #375971 is a reply to message #375968] Mon, 15 December 2008 09:05 Go to previous messageGo to next message
vijju56
Messages: 22
Registered: December 2008
Junior Member
Hi,

I am new to the oracle side. I compiled the code without errors.

Thanks
Re: Insert pdf [message #375973 is a reply to message #375971] Mon, 15 December 2008 09:13 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
No. The error message that you have shown us says that there is a procedure called INSERT_PDF in the schema DBA_PDF3, but that it is invalid.

Have a look at the view ALL_ERRORS - this should show you what the problem with the procedure is.
Re: Insert pdf [message #375974 is a reply to message #375968] Mon, 15 December 2008 09:19 Go to previous messageGo to next message
vijju56
Messages: 22
Registered: December 2008
Junior Member
Hi,

I am trying to insert pdf as BYTES into a BLOB column. Is my code correct or any modifications required

Thanks
Re: Insert pdf [message #375976 is a reply to message #375974] Mon, 15 December 2008 09:33 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
Have a look in the ALL_ERRORS view, and tell us what the reported error with your procedure is.

Or, give us the create table script for the table TMP_PDF - that way we can test your code against your table ourselves.
Re: Insert pdf [message #375981 is a reply to message #375968] Mon, 15 December 2008 09:37 Go to previous messageGo to next message
vijju56
Messages: 22
Registered: December 2008
Junior Member
This is the table code



  CREATE TABLE "DBA_PDF3"."TMP_PDF" 
   (	"ID" NUMBER(9,0) NOT NULL ENABLE, 
	"PDF" BLOB NOT NULL ENABLE, 
	 CONSTRAINT "TMP_PDF_PK" PRIMARY KEY ("ID")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "MBS_DATA_TBLSP_01"  ENABLE
   ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "MBS_DATA_TBLSP_01" 
 LOB ("PDF") STORE AS BASICFILE (
  TABLESPACE "MBS_DATA_TBLSP_01" ENABLE STORAGE IN ROW CHUNK 8192
  NOCACHE LOGGING 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)) ;
 


Thanks
Re: Insert pdf [message #375988 is a reply to message #375968] Mon, 15 December 2008 09:54 Go to previous message
vijju56
Messages: 22
Registered: December 2008
Junior Member
Hi,

Problem is solved. Thanks for the quick answers. problem is that SQLDeveloper is executing the procedure without semicolon at the end. I edited that mistake. '

Thanks
Previous Topic: Which is better Option for Extracting the OBJECT DDL ?
Next Topic: Small Urgent Help Neede in PL?SQL
Goto Forum:
  


Current Time: Mon Dec 05 14:41:42 CST 2016

Total time taken to generate the page: 0.08436 seconds