stored procedure - insert clob obj - msg error: ORA-01460: unimplemented
Hi allI have a situation where I want to insert an object, clob to my local table using a stored procedure. The clob object stores the large amount of text. The clob data are met to retrieve the content in an external text file. When you run an insert statement in the c# code, the information was inserted successfully. When you run the stored procedure to insert the information, I always "ORA-01460: letter dead or unreasonable conversion requested". I use the StreamReader class ReadToEnd() to extract the context of the external text file. Does anyone know why Oracle is behaving in this way? Thanks for help in advance.
TABLE DEFINITION FOR CLOB_TEST
Name Type Nullable Default Comments
---------- ------------ -------- ------- --------
PKG_NAME VARCHAR2(50) Y
PKG_DESC CLOB Y
PKG_FAM_ID NUMBER Y
STORED PROCEDURE
procedure InsertTempReleaseTable(p_name in varchar2,
p_description in clob,
p_fam_id number) is
begin
insert into clob_test
(pkg_name, pkg_desc, pkg_fam_id)
values
(p_name, p_description, p_fam_id);
end InsertTempReleaseTable;
EXTRACT THE CONTENTS OF A TEXT FILE
public string GetTextFileContents(string path)
{
using (StreamReader sr = new StreamReader(path))
{
return (sr.ReadToEnd());
}
}
C# CALL THE INSERT STORED PROCEDURE
using (OracleCommand cmd = (OracleCommand)database.GetStoredProcCommand("pkg_sptbuildstatus.InsertTempReleaseTable"))
{
cmd.Parameters.Add("p_name", OracleType.VarChar, 255).Value = obj.PackageName; // string
cmd.Parameters.Add("p_description", OracleType.Clob).Value = obj.ChangeDescription; // string
cmd.Parameters.Add("p_fam_id", OracleType.Number).Value = obj.FamilyId; // int
database.ExecuteNonQuery(cmd);
}
Published by: user8976335 on January 11, 2010 16:28Published by: user8976335 on January 11, 2010 16:59
Published by: user8976335 on January 11, 2010 16:59
Published by: user8976335 on January 12, 2010 10:48
Well, that may (or may not) be useful to you.
Can you test your routine with CLOB less than 32K in size (and see if this attempt is successful)?
IF Yes, then it is possible, that's your problem...
[http://asktom.oracle.com/pls/asktom/f?p=100:11:0:P11_QUESTION_ID:122012348063]
"
they are so NOT to cross a clob, they pass a string.
In Java or ProC or OIC you can create a clob customer, fill it and pass it.
My guess is that they use a string and a string is not a clob and a string will be limited
for 32 k as a variable binding, or 4000 bytes as a literal in a sql statement.
"
Tags: Database
Similar Questions
-
Util error message advising apex->; report error: ORA-01460: unimplemented
Hello
I run the Util Apex Advisor and everythingis ok, except that I get this error shown below the result of the filter:
error report:
ORA-01460: dead letter or unreasonable conversion requested
Request Express 4.0.2.00.09
DB 11 XE
I don't get this error anywhere else.
Any suggestions?
Thank you
DanielSeems to be a bug in database: + {: identifier of the thread = 1100619} +.
-
Get the error: ORA-01460: letter dead or unreasonable conversion requested
Hello
I created a Page in Oracle APEX, I have a textarea element Page. I created a Page process on the "submit" button to insert text box data in the CLOB column in a table. If the data in the text box is less than 4,000 characters, it works fine, but if the data exceeds 4000 I get the below error:
"Error during the processing of validation.
"ORA-01460: letter dead or unreasonable conversion requested".
Here's my process of Page:
declare
CLOB v_notes;
Start
v_notes: = wwv_flow_utilities.clob_to_varchar2(:P1_NOTES);
INSERT INTO ENQ_DETAILS (ENQUIRY_TYPE,STOCKS,NOTES,CREATED_BY)
VALUES (1,: P1_RESPONSE_ACTION, v_notes,: APP_USER);
end;
Can someone help me please?
Chaitali salvation,
Check this plugin: Enkitec CLOB support
Kind regards
Jitendra
-
Hello
I am Oracle 10 G and is the next version.
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - production
PL/SQL Release 10.2.0.4.0 - Production
CORE 10.2.0.4.0 Production
AMT for 32-bit Windows: release 10.2.0.4.0 - Production
NLSRTL Version 10.2.0.4.0 - Production
I wrote a small stored procedure, but it is throwing error.
I'm trying to compile the stored procedure on the side using the advanced search tool.
Create procedure SCEMANAME.testtest as
Start
Insert SCHEMANAME. TEST values (10);
commit;
end;
The error that I do face is the following.
37000 (900) [oracle] [ODBC] [Ora] ORA-00900: invalid SQL statement
Any help would be appreciated...The problem may lie in your advanced search tool. What happens if you try it in SQL * more?
BTW, you don't need to specify the schema in the INSERT statement. The procedure is already in this scheme.
-
By clicking on the icon of debugging for a procedure or function survey error ORA-00904
Hi all
By clicking on the icon of debugging for a procedure or function throws the error ORA-00904.
Developer SQL 4.1.0.19.07
Java 1.8.0_40
OS: Linux Mint 17.1
Developer SQL 4.1.0.18.37 on the same machine works very well.
Clues?
Thank you!
It is indeed regressed as RDBMS to 10g have object_id all_procedures notice. Buggy.
-
I can't using stored procedures and need advice.
If I try to run the stored procedure code, I get an error saying that I not provided a required entry, but the LabVIEW looks I'm him.
But I get this error message.
The database table is as follows:
@ID is generated in the process, he is looked at and inserted.
I don't have the opportunity to get into the database. It is a stored procedure of writtin by the DB of my COMPUTER service engineer. The image above has the required fields highlighted in yellow I need to provide when executing my code.
Can you see where my mistake was made?
Thanks for the comments.
Ben
The procedure does not match the names of parameters with the values that you provide. You provide only 5 params, but there are 8 in the stored procedure. In your case, SerialNumber is spent in the ID, PartNumber in SerialNumber, etc.. Add some empty in your cluster params, if they are not mandatory.
-
SQL dynamic stored procedure call
I want to run the following command (which I build dynamically) to pl/sql, stored procedure, but I get the error message
How can I run this command from pl/sql after I built it dynamically?
exec RESEND_MISSING_UFMS (June 5, 13 04.00.00.000000000 AM ', June 6, 13 04.00.00.000000000 AM', 'VPS'); < < works very well on the sql prompt.
create or replace procedure tranhost.ufm_resubmit
AS
v_time1 varchar2 (50);
v_time2 varchar2 (50);
cmd_str1 varchar2 (100);
cmd_str2 varchar2 (100);
BEGIN
Select to_char (sysdate-1,' MON-JJ-AA "") in the double v_time1;
Select to_char(sysdate,'DD-MON-YY') in the double v_time2;
-next fails with ORA-00900: invalid sql statement.
immediately run "exec RESEND_MISSING_UFMS('''||) v_time1 | "04.00.00.000000000 AM","' | v_time2 | ("04.00.00.000000000 AM VPS",""); " ;
END;
/CREATE OR REPLACE PROCEDURE tranhost.ufm_resubmit AS v_time1 VARCHAR2 (50); v_time2 VARCHAR2 (50); cmd_str1 VARCHAR2 (100); cmd_str2 VARCHAR2 (100); var_sql VARCHAR2 (300); BEGIN SELECT TO_CHAR (SYSDATE - 1, 'DD-MON-YY') INTO v_time1 FROM DUAL; SELECT TO_CHAR (SYSDATE, 'DD-MON-YY') INTO v_time2 FROM DUAL; -- follownig fails with ORA-00900: invalid sql statement . var_sql := 'BEGIN RESEND_MISSING_UFMS(''' || v_time1 || ' 04.00.00.000000000 AM'',''' || v_time2 || ' 04.00.00.000000000 AM'',''VPS''); END;'; DBMS_OUTPUT.put_line (' Block :' || var_sql); EXECUTE IMMEDIATE var_sql; END;
-
infinite loop in stored procedure
I am trying to create an infinite loop to test an error condition. I do this in the stored procedure. I have not created a stored procedure before. I get errors when I am writing the script. Can you please tell me what I'm doing wrong with this script?
CREATE OR REPLACE PROCEDURE blah.test_timeout
IS
number of deadline_days: = 1;
grace_period number: = 0;
BEGIN
-get day of the date limit
While deadline_days < 4000
LOOP
grace_period: = grace_period + 1;
dbms_output.put_line (' Hello mum ');
END LOOP;
RAISE_APPLICATION_ERROR (-20071, "what_error error:' | ') SQLERRM (sqlcode));
END;
/
Thank you!First tell me that this error message happens when you run this script.
You can use only * $, _, #* when you give the name of procedure, function, package, variable, trigger. Here, you use * (.) * in your name of the procedure so it will give you error.
and you first declare exception in your procedure declaration section. and raise it in Exception of procedure section.
In this you have to give the condition for which exception condition must raise.This is a sample I'll send to your reefrence:-_
CREATE OR REPLACE PROCEDURE raise_demo (inval NUMBER) IS
evenno EXCEPTION;
oddno EXCEPTION;
BEGIN
MOD IF (inval, 2) = 1 THEN
RAISE oddno;
ON THE OTHER
RAISE evenno;
END IF;
EXCEPTION
WHEN evenno CAN
dbms_output.put_line (to_char (Inval) |) "is even");
WHEN oddno THEN
dbms_output.put_line (to_char (Inval) |) "is weird");
END raise_demo; -
ORA-01460: letter dead or unreasonable conversion requested and INSTR func
Hi all
I have the table and the data, following the output of the query is correct but when the data inside the column gen_value more than
4000 bytes.
I am facing the following error
which include the function Instr can spend just less than 4000 bytes. So how can I solve this problem.ORA-01460:unimplemented or unreasonable conversion requested
drop table a; create table a(id number(9), gen_value CLOB); insert into a values(1, 'ACD BCD AAA, AFD BCF , Egypt,BDE AAC AFC,Egypt,BCF AAE'); insert into a values(2, 'AVF BCD, BBA BBG BCEV, GACD MNF BCV'); insert into a values(3, 'AFC ABC, BBG HUH ABCE, Egypt,JHU KK MNK');
error is,declare gen_value varchar2(20000); id number(9); type bulk_collect is table of varchar2(500) index by PLS_INTEGER; v_bluk1 bulk_collect; v_bluk2 bulk_collect; v_bluk3 bulk_collect; begin select id,gen_value into id, gen_value from a where id=1; select id,v,cnt bulk collect into v_bluk1,v_bluk2,v_bluk3 from( with data as ( select id , gen_value ||',' gen_value from dual ) ,r (id, gen_value , l) as ( select id ,substr( gen_value , instr( gen_value , ',') + 1) ,substr( trim(substr( gen_value ,1, instr( gen_value , ',') - 1)) ,instr(trim(substr( gen_value ,1, instr( gen_value , ',') - 1)),' ',-1) ) from data union all select id ,substr( gen_value , instr( gen_value , ',') + 1) ,substr( trim(substr( gen_value ,1, instr( gen_value , ',') - 1)) ,instr(trim(substr( gen_value ,1, instr( gen_value , ',') - 1)),' ',-1) ) from r where length( gen_value ) > 0 ) select id, soundex(l)as l ,count(*) cnt ,trim(max(l) keep ( dense_rank last order by length(l), l desc nulls first)) v from r where l is not null group by soundex(l),id order by 1); for b in 1..v_bluk1.count loop dbms_output.put_line ('The DOC NUMBER IS '||v_bluk1(b)||v_bluk2(b)||v_bluk3(b)); end loop; end;
Which column includes more than 4000 bytes.ORA-01460:unimplemented or unreasonable conversion requested
concerning
Benjamin
Published by: 973907 on April 14, 2013 04:21
Published by: 973907 on April 14, 2013 06:13Solomon Yakobson says:
If you explain what your code is trying to accomplish, someone might offer an alternative solution.The column GEN_VALUE in table A is a CLOB containing the list separated by commas. Your code divides this list separated by commas into indivitual elements. If none of the elements of comma-separated string exceeds 4000 bytes, what you need is to change GEN_VALUE variable PL/SQL CLOB type and then cast individual items to VARCHAR2:
declare gen_value CLOB; id number(9); type bulk_collect is table of varchar2(500) index by PLS_INTEGER; v_bluk1 bulk_collect; v_bluk2 bulk_collect; v_bluk3 bulk_collect; begin select id,gen_value into id, gen_value from a where id=1; select id,v,cnt bulk collect into v_bluk1,v_bluk2,v_bluk3 from( with data as ( select id , gen_value ||',' gen_value from dual ) ,r (id, gen_value , l) as ( select id ,substr( gen_value , instr( gen_value , ',') + 1) ,substr( trim(substr( gen_value ,1, instr( gen_value , ',') - 1)) ,instr(trim(substr( gen_value ,1, instr( gen_value , ',') - 1)),' ',-1) ) from data union all select id ,substr( gen_value , instr( gen_value , ',') + 1) ,substr( trim(substr( gen_value ,1, instr( gen_value , ',') - 1)) ,instr(trim(substr( gen_value ,1, instr( gen_value , ',') - 1)),' ',-1) ) from r where length( gen_value ) > 0 ) select id, soundex(cast(l as VARCHAR2(4000))) as l ,count(*) cnt ,trim(max(cast(l as VARCHAR2(4000))) keep ( dense_rank last order by length(cast(l as VARCHAR2(4000))), cast(l as VARCHAR2(4000)) desc nulls first)) v from r where l is not null group by soundex(cast(l as VARCHAR2(4000))),id order by 1); for b in 1..v_bluk1.count loop dbms_output.put_line ('The DOC NUMBER IS '||v_bluk1(b)||v_bluk2(b)||v_bluk3(b)); end loop; end; / The DOC NUMBER IS 1AAA512 The DOC NUMBER IS 1AFC256 The DOC NUMBER IS 1BCF256 The DOC NUMBER IS 1Egypt512 PL/SQL procedure successfully completed. SQL>
SY.
-
ORA-01460: dead letter or unreasonable conversion requested
Hello
I use
Database: Oracle Database 11 g Express Edition Release 11.2.0.2.0
APEX: Oracle Application Express Release 5.0.1.00.06
When I passing parameters in my query for report error: ORA-01460: letter dead or unreasonable conversion requested
My source of query report shown as below:
Select cat_desc, brand_desc, sum (dirty) in the sale of salesview
where date between to_date(:sdate,'DD-MON-YYYY') and to_date(:edate,'DD-MON-YYYY')
Group of cat_desc, brand_desc
I also use > = and < = operator but even the results
Kind regards
Jamil
Jamil Malik wrote:
Yes, it uses a database link and regret not mentioning the error ORA-02063: preceding MY_LINK line.
My remote database is 9i
This is caused by the #12728440 of the database bug, for which there is no documented fix or workaround. Your options are limited:
- Upgrade the remote database to a compatible version.
- Try to copy the remote data to the local database outside of the APEX and interrogate him there.
-
ORA-03001: unimplemented function
Hi all
I created 2 contain tables and 1st primary and 2nd table containing the foreign key that refers to 1st 1st column of the table and used * "ON DELETE SET DEFAULT."
Then I get the error message.
can I know what is the problen and my piece of code followingError report:
SQL error: ORA-03001: unimplemented function
03001 00000 - "function not implemented".
* Cause: This function is not available.
Edited by: CoolBuddy 13 Sep 2012 11:46CREATE TABLE A1
(
COL1 NUMBER,
COL2 NUMBER,
COL3 NUMBER
);
ALTER TABLE ADD CONSTRAINT A1_COL1_PK PRIMARY KEY (COL1) A1;
CREATE TABLE A3
(
COL4 DEFAULT NUMBER 123 A2_COL4_FK CONSTRAINT REFERENCES A1 (COL1) ON DELETE SET DEFAULT.
COL5 NUMBER,
COL6 NUMBER
);CoolBuddy wrote:
Hi allI created 2 contain tables and 1st primary and 2nd table containing the foreign key that refers to 1st 1st column of the table and used * "ON DELETE SET DEFAULT."
Then I get the error message.Error report:
SQL error: ORA-03001: unimplemented function
03001 00000 - "function not implemented".
* Cause: This function is not available.can I know what is the problen and my piece of code following
CREATE TABLE A1
(
COL1 NUMBER,
COL2 NUMBER,
COL3 NUMBER
);
ALTER TABLE ADD CONSTRAINT A1_COL1_PK PRIMARY KEY (COL1) A1;
CREATE TABLE A3
(
COL4 DEFAULT NUMBER 123 A2_COL4_FK CONSTRAINT REFERENCES A1 (COL1) ON DELETE SET NULL.
COL5 NUMBER,
COL6 NUMBER
);The piece of code you posted, should not throw any error, are you sure you want this error for this code?
The error means what it says, * "ON DELETE SET DEFAULT" * is not implemented in oracle.
http://docs.Oracle.com/CD/E18283_01/server.112/e17118/clauses002.htm#SQLRF52202 -
Error when inserting Blob by stored procedure
Hi there and thank you for your time,.
I am running a console application in .NET which resembles a particular file on my hard drive, runs through all files, captures the content via a FileStream, the type (by checking the registry), the name and a foreign key which he rises before insertion. This is my code:
public void Insert (MyFileModel file) information gathered by the System.IO.FileInfo object //contains
{
Con OracleConnection = new OracleConnection (System.Configuration.ConfigurationManager.ConnectionStrings ["Oracle"]. ConnectionString);
con. Open();
OracleCommand cmd = new OracleCommand();
cmd.CommandText = INSERT_FILE;
cmd.CommandType = CommandType.StoredProcedure;
cmd. Connection = con;
cmd. Parameters.Add (": p_in_file_contents", OracleDbType.Blob);
cmd. Parameters.Add (": p_in_filename", OracleDbType.Varchar2);
cmd. Parameters.Add (": p_in_item_num", OracleDbType.Int32);
cmd. Parameters.Add (": p_in_file_content_type", OracleDbType.Varchar2);
cmd parameters [0]. Value = file. FileContents; Byte [], populated from a file stream
cmd parameters [1]. Value = file. File name; string
cmd parameters [2]. Value = file. ItemNum; int?
cmd parameters [3]. Value = file. FileContentType; string
cmd ExecuteNonQuery());
con. Close();
con. Dispose();
}
INSERT_FILE (part of a set with the other working procedures) are:
PROCEDURE INSERT_FILE (p_in_file_contents IN p_in_file_content_type IN varchar2, p_in_item_num in numbers, p_in_filename IN varchar2, blob)
IS
BEGIN
INSERT INTO mytable
(FILE_CONTENTS, FILENAME, CREATE_DATE, ITEM_NUM, IS_DELETED, FILE_CONTENT_TYPE)
VALUES
(p_in_file_contents, p_in_filename, SYSDATE, p_in_item_num, 0, p_in_file_content_type);
END INSERT_FILE;
Here's the code LOB on the table. I do not change no matter what this code, is any of the default:
(STORE AS) LOB (FILE_CONTENTS)
TABLESPACE RECENTES5
ALLOW ONLINE STORAGE
CHUNK 32768
RETENTION
NOCACHE
NOLOGGING
INDEX)
TABLESPACE RECENTES5
STORAGE)
INITIAL OF 160K
ACCORDING TO 1 M
MINEXTENTS 1
MAXEXTENTS UNLIMITED
PCTINCREASE 0
DEFAULT USER_TABLES
))
STORAGE)
INITIAL OF 160K
ACCORDING TO 1 M
MINEXTENTS 1
MAXEXTENTS UNLIMITED
PCTINCREASE 0
DEFAULT USER_TABLES
))
TABLESPACE RECENTES5
PCTUSED 0
PCTFREE 10
INITRANS 1
MAXTRANS 255
STORAGE)
INITIAL OF 160K
ACCORDING TO 1 M
MINEXTENTS 1
MAXEXTENTS UNLIMITED
PCTINCREASE 0
DEFAULT USER_TABLES
)
NOLOGGING
NOCOMPRESS
NOCACHE
NOPARALLEL
MONITORING;
This code works fine for all the files and all types (stores and retrieves the document in my web application), with the exception of files whose size is between 32768 and 65535 (2 ^ 15 and 2 ^ 16). On the files that are the size, this error is returned to the insertion:
ORA-01460: dead letter or unreasonable conversion requested
My version 11.1.0.6.0 Oracle Client is installed and the version of the Oracle.DataAccess.dll is 2.111.6.0. I know that this is not the latest version of the software, but software installation is difficult in my organization that we do not have admin privlidges. The .NET web application and this particular application is a 4.0 application web.
I use a similar code of an MVC web application that sees the same results when the files came from an object HttpFileCollectionBase (Request.Files).
What Miss me the code ODP.NET? My table should setting?
Thank you very much for your time and help me with this!
-SeanSuggestions for your ODP.NET code.
1.
using Oracle.DataAccess.Types;
...
OracleBlob myBlob = new OracleBlob (con);
myBlob.Write (Mon_tableau_octets, 0, count); where Mon_tableau_octets is filled by a file stream and count is the number of bytes to write to myBlob
cmd parameters [0]. Value = myBlob;
...2. don't check that when he is not null, then have blob object, command object and a connection object. (No need to close the connection before eliminating)
It is not relevant to the question.Edited by: shsu January 12, 2012 16:16
-
Execution of the stored procedure Oracle EF6 error.
Hello
Need help with the oracle error
{"ORA-06550: line 1, column 8:"}
PLS-00306: wrong number or types of arguments in the call to "sp_name".
ORA-06550: line 1, column 8:
{"PL/SQL: statement ignored '}
This error occurs when the code runs the line in Vb.net application in Model Designer
MyBase.ExecuteFunction ("sp_name" para1, para2, para3, dOBpara4, para5)
I create the SSDL and CSDL, MSL files for oracle to MS SQL connection by the method mentioned in the link JasonShort - professional profile - CodeProject it worked perfectly fine without the stored procedures. I managed to insert, update, and delete records. Then, I created stored procedures for Insert, Update, Delete. It worked fine with MS SQL. I copied and updated oracle files respectively. I gives me the error mentioned above.
I executed stored procedures in Oracle SQL Developer, and it works without error. But when it is executed via the model there is light of the error. Can anyone let me know the solution for this error. I'm using VS2010, EF6, Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64 bit Production
Thank you
Prachin Soparkar
Hello
Sorry for the inconvenience. After I posted this question I took a break and saw that the error was nothing, but I had given FNAME as parameter name in MS SQL. In oracle when I created the sp I created the parameter with p_FNAME. Where the schema defined in the language SSDL and CSDL, MSL had to be changed to MS, but since I want to that it would be same in different databases, I choose to have changed it in oracle stored procedure. The error msg is confusing, it should be something not found parameter or incompatibility etc.
Thank you
Prachin Soparkar
-
Error during the handling of XML column stored as a CLOB
In the Version of SQL Developer 4.0.0.13, build HAND - 13.80, I am unable to view the result of a manipulation of a column of a table that is stored as a CLOB xmltype. The SQL below illustrates this:
CREATE TABLE xml_lob_locator ( xml_data XMLTYPE ) XMLTYPE xml_data STORE AS CLOB / INSERT INTO xml_lob_locator (xml_data) VALUE (XMLTYPE('<ROOT/>')) / SELECT EXTRACT( xml_data , '/*' ) FROM xml_lob_locator /
When you view the value returned by the following SELECT statement, this error is returned in the dialog box "display value":
ORA-22275: specified incorrect LOB Locator
This seems to happen for any operation of XML that returns an XMLTYPE: EXTRACT, UPDATEXML, INSERTCHILDXML, etc.
It is a database bug which I believe has been fixed in 11.2.0.4 and 12cR1
You can use to work around the problem, run as a script:
SELECT
EXTRACT)
donnees_xml
, '/*'
)
of xml_lob_locator
/
What gives the SQL Developer
EXTRACT(XML_DATA,'/*') ------------------------------------
-
Error on the definition of the stored procedure in the simultaneous program
Hello
I created a stored procedure and wanted it attached to the concurrent program. The purpose of this stored procedure when you run it in simultaneous program, the system retrieves the data from the csv file downloaded from the server, then it will insert in the tables of SO / the Interface API. Below, the error occurred.
* Starts * 18 April 2012 18:18:42
Error ORACLE 6550 in FDPSTP
Cause: FDPSTP failed due to the ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in the call to 'SPKO1 '.
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
Steps I did to set the stored proc
< < simultaneous executable program > >
Executable: RDRAGON_SO_IMPORT
Short name: RDRAGON_SO_IMPORT
Application: Order management
Method of execution: PL/SQL, stored procedure
Run file name: SPKO1
< < concurrent program - set > >
Program: RDRAGON SO IMPORT
Short name: RDRAGON_SO_IMPORT
Application: Order management
Name of executable: RDRAGON_SO_IMPORT
Method: PL/SQL, stored procedure
Format: text
No set
-Here are my stored procedure-
CREATE OR REPLACE PROCEDURE APPS. SPKO1 IS
FH UTL_FILE. TYPE_DE_FICHIER;
v_line VARCHAR2 (32767).
v_source_id NUMBER (10);
v_created_by NUMBER (10);
v_creation_date DATE;
v_org_id NUMBER (10);
v_orig_sys_docref VARCHAR2 (50);
V_Customer VARCHAR2 (360);
v_customer_prev VARCHAR2 (360);
v_sold_to_org NUMBER (10);
v_orig_line_ref NUMBER (10);
v_item_code VARCHAR2 (2000);
v_ordered_qty NUMBER (10);
v_selling_price NUMBER (10);
v_count NUMBER (10);
v_stat NUMBER;
/******************************************************************************
NAME: SPKO
PURPOSE:
REVISIONS:
Worm Date Description of the author
--------- ---------- --------------- ------------------------------------
1.0 16/04/2012 administrator 1. Created this procedure.
NOTES:
Keywords to replace automatically available Auto:
Object name: SPKO
SYSDATE: 16/04/2012
Date and time: 16/04/2012, 17:55:42 and 16/04/2012 17:55:42
Username: admin (set in Options of TOAD, editor of the procedure)
Name of the table: (defined in the dialog box "New PL/SQL object")
******************************************************************************/
BEGIN
v_source_id: = 6;
v_created_by: = - 1;
v_org_id: = 204;
v_customer_prev: = null;
v_orig_line_ref: = 0;
v_stat: = 0;
SELECT header_id in (DE) v_orig_sys_docref
Select header_id
of OE_ORDER_HEADERS_ALL
creation_date desc order
) WHERE ROWNUM = 1;
FH: = UTL_FILE. FOPEN ('XXANDDIR2', 'myfile1.csv', 'R', 32767);
< < file_read_lines > >
LOOP
BEGIN
UTL_FILE. GET_LINE (fh, v_line);
V_Customer: = LTRIM (RTRIM (REGEXP_SUBSTR (v_line, "[^,] +' 1, 1") ',' "') ','" ');
v_creation_date: = LTRIM (RTRIM (REGEXP_SUBSTR (v_line, "[^,] +' 1, 2") ',' "') ','" ');
v_item_code: = LTRIM (RTRIM (REGEXP_SUBSTR (v_line, "[^,] +' 1, 3") ',' "') ','" ');
v_ordered_qty: = LTRIM (RTRIM (REGEXP_SUBSTR (v_line, "[^,] +' 1, 4") ',' "') ','" ');
v_selling_price: = LTRIM (RTRIM (REGEXP_SUBSTR (v_line, "[^,] +' 1, 5") ',' "') ','" ');
v_orig_line_ref: = (v_orig_line_ref + 1);
If v_stat = 0 then
v_orig_sys_docref: = (v_orig_sys_docref + 1);
end if;
SELECT hca.cust_account_id from v_sold_to_org
OF hz_cust_accounts AOB.
HP hz_parties
WHERE hca.party_id = hp.party_id
AND hca.request_id is null
AND hp.party_name = v_customer;
If v_stat = 0 then
INSERT INTO OE_HEADERS_IFACE_ALL)
order_source_id,
orig_sys_document_ref,
org_id,
CREATION_DATE,
created_by,
last_update_date,
last_updated_by,
operation_code,
sold_to_org_id,
booked_flag)
VALUES)
v_source_id,
('TEST' | v_orig_sys_docref).
v_org_id,
v_creation_date,
v_created_by,
v_creation_date,
v_created_by,
"INSERT."
v_sold_to_org,
'Y') ;
commit;
end if;
INSERT INTO OE_LINES_IFACE_ALL)
order_source_id,
orig_sys_document_ref,
orig_sys_line_ref,
inventory_item,
org_id,
ordered_quantity,
unit_selling_price,
unit_list_price,
CREATION_DATE,
created_by,
last_update_date,
last_updated_by,
operation_code)
VALUES)
v_source_id,
('TEST' | v_orig_sys_docref).
v_orig_line_ref,
v_item_code,
v_org_id,
v_ordered_qty,
v_selling_price,
v_selling_price,
v_creation_date,
v_created_by,
v_creation_date,
v_created_by,
"INSERT");
commit;
v_customer_prev: = v_customer;
If v_customer_prev = v_customer then
v_stat: = 1;
on the other
v_stat: = 0;
end if;
-DBMS_OUTPUT. Put_line ('Col1: ' | v_source_id |', Col2: ' | v_creation_date |', Col3: ' | v_created_by |', Col4: ' | v_updated_date |', Col5: ' | v_updated_by);
EXCEPTION
WHEN NO_DATA_FOUND THEN
OUTPUT file_read_lines;
END;
END LOOP;
SELECT count (*) in the OE_HEADERS_IFACE_ALL v_count;
DBMS_OUTPUT. Put_line (' record Total inserted successfully: ' | v_count);
UTL_FILE. FCLOSE (FH);
END SPKO1;
/
But when I run the stored procedure using TOAD his work.
Help, please. This is my first time to attach the stored procedure in the concurrent program.
Thank you very much.
Kind regards
Diane
Published by: peopsquik08 on April 18, 2012 03:58as clive_t solier
>
You must explicitly reference the settings out
>Try
DECLARE VFILE VARCHAR2(32767); V_SOURCE_ID NUMBER; -- ERRBUF VARCHAR2(200); RETCODE NUMBER; BEGIN VFILE := 'myfile1.csv'; V_SOURCE_ID := 6; --APPS.OMORDERLOADER.SPKO1 ( VFILE, V_SOURCE_ID ); --COMMIT; APPS.OMORDERLOADER.SPKO1( ERRBUF => ERRBUF, RETCODE => RETCODE, VFILE => VFILE, V_SOURCE_ID => V_SOURCE_ID ); END;
but the code above to test your proc
to run concurrent SQL, you can use fnd_submit.submit_program
Maybe you are looking for
-
maybe simple question of string of the variable in the pop up window
Hello I write a name who helped me in the previous question, but now the list is great and sorry, no nicks personal Hi all We have a chain scany_col value {{15677, 5654, 7453}, {37008, 19532 17733}, {32896, 15163 14906}, {15934, 6939, 9509}, {16705,
-
Satellite P20: no but only encryption WEP WPA
Updated my P20 for win XP pro media edition, but unable to connect to the network wireless as the network options only lists WEP and not WPA. Checked and I have SP2 installed and reinstalled the drivers wireless but still not WPA. Someone knows why?
-
Boots of my HP DESKTOP IMEDIA X 2414 (bought from PC World UK 2.5 years) is no longer.TECHNICAL DATA:MATERIAL:IMEDIA X 2414Intel Core 2 QUAD processor Q66003 GB DDR2 #320 GB 7200 RPM SATA HARDISKNVIDIA: GEFORCE 7050 up to 1407 MBP/N: PB80128501[Perso
-
external 14.2 iMac SSD upgrade
I have an iMac of end of 2013 with a 1 TB HARD drive. I'm looking to upgrade to an SSD because I believe that the HARD drive is really slow. I will use an external SSD as the startup disk with the existing as disk HARD drive "data". I wrote a questio
-
How to use the USRP2920 as a CW transmitter
Hello For a simple application, I would use the USRP2920 as a CW transmitter. I would like to generate a signal cw about 101 MHz and the frequency and the amplitude of the signal will change while the program is running. My first idea was to use the