SOA calling a MS SQL table to insert data.
HelloI configured a XA driver to insert data into the MS SQL Server table. When I execute the stream with a SOAP user interface. I was able to insert the data from MS SQL table. But in the end, the transaction is rolled back.
I would ask you
< soapenv:Envelope xmlns:soapenv = 'http://schemas.xmlsoap.org/soap/envelope/' xmlns:mvn = "http://xmlns.oracle.com/MVNEIDM/MVNESelfRegistration/MVNESelfRegistration" >
< soapenv:Header / >
< soapenv:Body >
< mvn:MVNESelfRegistrationRequest >
< mvn:subscriberId > 12345 < / mvn:subscriberId >
< mvn:Keyword > 456 < / mvn:Keyword >
< mvn:completionDt > 2013-02-06 T 16: 24:06.952 < / mvn:completionDt >
< mvn:expirationdt > 2013-02-06 T 16: 24:06.952 < / mvn:expirationdt >
< / mvn:MVNESelfRegistrationRequest >
< / soapenv:Body >
< / soapenv:Envelope >
Erros on SOAP UI are:
< env:Envelope = "http://schemas.xmlsoap.org/soap/envelope/" xmlns:env >
< env:Header / >
< env:Body >
< env:Fault >
env:Server < faultcode > < / faultcode >
incorrect object name < faultstring > [FMWGEN] [SQLServer JDBC Driver] [SQL Server] ' dbo. SelfRegistration'. < / faultstring >
< faultactor / >
< detail >
< exception / >
< / details >
< / env:Fault >
< / env:Body >
< / env:Envelope >
The managed server log the error is
Form weblogic server: -.
Error committing transaction:; nested exception is: Exception [EclipseLink-4002] (Eclipse - 2.1.3.v20110304 persistence Services - r9073): org.eclipse.persistence.exceptions.DatabaseException internal Exception: weblogic.jdbc.sqlserverbase.ddc: invalid object name [FMWGEN] [SQLServer JDBC Driver] [SQL Server] ' dbo. SelfRegistration'. Error code: 208
The process ends with an error, but why he is rolling abck the transaction at the end. The table of the object was existing in the database and I traced the table to insert the data from the input variable reception to invoke the input variable. BPEL Instance he executed until the end, but in the end, the transaction is rolled back.
Thank you
Newcomer Raja
Invalid object name ' dbo. SelfRegistration'
I'm assuming you can see a SelfRegistration table in your database... So, I guess that BOD is not the name of the diagram on the right...
Tags: Fusion Middleware
Similar Questions
-
Error in SQL syntax when inserting data to the table in the form of values using insert record
Hello
I was hoping that someone could help me. I am creating a form of registration on a website to insert data into a database table. When you try to create the form, I get the following error:
You have an error in your SQL syntax; consult the manual for your version of the MySQL server for the right syntax to use near ' VALUES (name, regno, reason) leave (has ', 1, 'dddd')' at line 1
I checked the syntax, but you don't know what's wrong.
I am running Windows 7 with Dw cs6 and wamp server.
Leave with the names of column (name, regno, reason) is the name of the table.
Thank you for your help and please help me.
The code is as below:
<? php require_once('Connections/connect.php');? >
<? PHP
If (! function_exists ("GetSQLValueString")) {}
function GetSQLValueString ($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
If (via PHP_VERSION < 6) {}
$theValue = get_magic_quotes_gpc()? stripslashes ($TheValue): $theValue;
}
$theValue = function_exists ("mysql_real_escape_string")? mysql_real_escape_string ($TheValue): mysql_escape_string ($theValue);
Switch ($theType) {}
case 'text ':
$theValue = ($theValue! = "")? « " ». $theValue. "" "": "NULL";
break;
case "long":
case "int":
$theValue = ($theValue! = "")? intval ($TheValue): 'NULL ';
break;
case "double":
$theValue = ($theValue! = "")? doubleVal ($TheValue): 'NULL ';
break;
case "date":
$theValue = ($theValue! = "")? « " ». $theValue. "" "": "NULL";
break;
case "set":
$theValue = ($theValue! = "")? $theDefinedValue: $theNotDefinedValue;
break;
}
Return $theValue;
}
}
$editFormAction = $_SERVER ['PHP_SELF'];
If (isset {}
$editFormAction. = « ? ». htmlentities($_SERVER['QUERY_STRING']);
}
If ((isset($_POST["MM_insert"])) & & ($_POST ["MM_insert"] == "form1")) {}
$insertSQL = sprintf ("INSERT INTO leave (name, regno, reason) VALUES (%s, %s, %s)',
GetSQLValueString ($_POST ['name'], "text").
GetSQLValueString ($_POST ['reg'], "int").
GetSQLValueString ($_POST ['reason'], "text"));
@mysql_select_db ($database_connect, $connect);
$Result1 = mysql_query ($insertSQL, $connect) or die (mysql_error ());
}
? >
< ! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict / / IN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" > ""
" < html xmlns =" http://www.w3.org/1999/xhtml ">
< head >
< meta http-equiv = "content-type" content = text/html"; charset = utf-8 "/ >"
< title > online form let < /title >
< name meta = "keywords" content = "" / > "
< name meta = "description" content = "" / > "
< link href = "styless.css" rel = "stylesheet" type = "text/css" media = "screen" / > "
< / head >
< body >
< div id = 'wrapper' >
< div id = "header" >
< div id = 'menu' >
< ul >
< class li = "current_page_item" > < a href = "#" > home < /a > < /li >
< li > < /li >
< li > < /li >
< li > < a href = "#" > on < /a > < /li >
< li > < /li >
< li > < a href = "#" > Contact < /a > < /li >
< /ul >
< / div >
<!-end #menu->
< div id = "Search" >
< / div >
<!-end #search->
< / div >
<!-end #header->
< div id = "logo" >
E - SCHOOL of CHRIST < h1 > < / h1 >
< p > < / p >
< / div >
< hr / >
<!-end #logo->
<! - end #header - wrapper->
< div id = "page" >
< div id = "content" >
< div class = "post" >
< h2 class = "title" > leave application online < / h2 >
< div class = "entry" > < / div >
< / div >
< do action = "<?" PHP echo $editFormAction;? ">" method = "POST" name = "form1" id = "form1" >
< table width = "200" border = "2" cellspacing = "5" cellpadding = "5" >
< b >
< scope th 'row' = > name < /th >
< td > < label for = "name" > < / label >
< input type = "text" name = "name" id = "name" / > < table >
< /tr >
< b >
< scope = "row" th > Reg No. < /th >
< td > < label for = "reg" > < / label >
< input type = "text" name = "reg" id = "reg" / > < table >
< /tr >
< b >
< scope = "row" th > why < /th >
< td > < label for = "reason" > < / label >
< name textarea = 'reason' id = cols 'reason' = "45" rows = "5" > < / textarea > < table >
< /tr >
< b >
< scope = "row" th > < /th >
< td > < input type = "submit" name = "b1" id = "b1" value = "Submit" / > < table >
< /tr >
< /table >
< input type = "hidden" name = "MM_insert" value = "form1" / >
< / make >
< / div >
<!-end #content->
< div id = "sidebar" >
< ul >
< li >
Notice of < h2 > < / h2 >
< p > students must present the appropriate documents supporting the reason for leave within 3 working days. < /p >
< /li >
< li id = "calendar" >
Calendar < h2 > < / h2 >
< div id = "calendar_wrap" >
< table summary = "Calendar" >
< caption >
March 2014
< / legend >
< thead >
< b >
< th abbr = "Monday" scope = "col" title = "Monday" > M < /th >
< th abbr = "Tuesday" scope = "col" title = "Tuesday" > T < /th >
< th abbr = "Wednesday" scope = "col" title = "Wednesday" > W < /th >
< th abbr = "Thursday" scope = "col" title = 'Thursday' > T < /th >
< th abbr = "Friday" scope = "col" title = 'Friday' > F < /th >
< th abbr = "Saturday" scope = "col" title = 'Saturday' > S < /th >
< th abbr = "Sunday" scope = "col" title = 'Sunday' > S < /th >
< /tr >
< / thead >
< tfoot >
< b >
< td abbr = "February" colspan = "3" id = "prev" > < a href = "#" title = "" > & laquo; Feb < /a > < table >
< class td = "pad" > < table >
< td abbr = "April" colspan = "3" id = "next" > < a href = "#" title = "" > Apr & raquo; < /a > < table >
< /tr >
< / tfoot >
< tbody >
< b >
< td colspan = "5" class = "pad" > < table >
< td > < table > 1
< td > < table > 2
< /tr >
< b >
< td > 3 < table >
< td > < table > 4
< td > 5 < table >
< td > < table > 6
< td > < table > 7
< td > < table > 8
< td > < table > 9
< /tr >
< b >
< td > < table > 10
< td id = 'today' > < table > 11
< td > < table > 12
< td > < table > 13
< td > < table > 14
< td > < table > 15
< td > < table > 16
< /tr >
< b >
< td > < table > 17
< td > < table > 18
< td > < table > 19
< td > < table > 20
< td > < table > 21
< td > < table > 22
< td > < table > 23
< /tr >
< b >
< td > < table > 24
< td > < table > 25
< td > < table > 26
< td > < table > 27
< td > < table > 28
< td > < table > 29
< td > < table > 30
< /tr >
< b >
< td > < table > 31
< class td = "pad" colspan = "6" > < table >
< /tr >
< / tbody >
< /table >
< / div >
< /li >
< li > < /li >
< /ul >
< / div >
<!-end #sidebar->
< div style = "" clear: both; "> < / div >"
< / div >
<!-end #page->
< div id = "footer" >
< p > Copyright (c) University of Christ. All rights reserved. < /p >
< / div >
<!-end #footer->
< / div >
< div align = center > < / div > < / body >
< / html >
The LEAVE is a reserved word in MySQL. You can try to quote, but you are better to rename it.
-
I created another table for practice on two tables queries now.
That's what I have:
Insert in the test
(address, age, status, DriverID)
values ("131 Shore Drive", "Edison, NJ, 08011 ', ' 55', m ', '2').
("' 62 central avenue", "Middletown, NJ 08011', ' 43 ', am ', ' 1'");
('98 main street', ' Bristol, PA 19116 ', ' 67', the of ', '3' ").
('15 wrong Way', ' Long Island, NY 10111 ', ' 60', 'W', '4' '),
("' Kevin 9 Place", "New York, NY 10111 ', ' 25', the of ', '5'");
It says command SQL is not properly terminated.
Like this:
Insert into test (address, age, status, DriverID)
values ("131 Shore Drive", "Edison, NJ, 08011 ', ' 55', m ', '2');
Insert into test (address, age, status, DriverID)
values ("62 Middle Avenue", "Middletown, NJ 08011', ' 43 ', am ', ' 1'");
...
-
Calling a PL/SQL of BPEL function throws the fault.
Hi, I'm calling a PL/SQL function that inserts data into a table from a BPEL via the DB adapter. The process, when I test it, get an error runtime as follows:
* Exception occurred when the link was invoked. Exception occurred during invocation of the JCA binding: "JCA binding run operations reference 'EmpRegister' have to: connection problem component binding JCA.". JCA Binding component is unable to create an outgoing connection of JCA (CCI). AddEmployee:EmpRegister [EmpRegister_ptt::EmpRegister (InputParameters, OutputParameters)]: The JCA Binding component could not establish an outbound connection of JCA CCI due to the following problem: BINDING. Error of JCA - 12510 JCA adapter localization resources. Cannot find the adapter in JCA resources via the element of the binding .jca file <-factory connections / > The JCA Binding component is unable to startup of the resource adapter that is specified in the <-factory connections / > element: location = ' EI/DB/DBConn_215. The reason is most likely that 1) the resource adapter RAR file has not been deployed successfully to the application server WebLogic or 2) the element '< jndi name >' in weblogic - ra.xml has not been set to eis/DB/DBConn_215. In the latter case, you need to add a new factory of connections from WebLogic JCA (deploy a RAR). If please fix this and then restart the application server". The called JCA adapter threw an exception of resource. Please examine the error message above carefully to determine a resolution.*
In addition, the error description was that follows a s:
* Error JCA adapter localization resources. Cannot find the adapter in JCA resources via the element of the binding .jca file <-factory connections / > The JCA Binding component is unable to startup of the resource adapter that is specified in the <-factory connections / > element: location = ' EI/DB/DBConn_215. The reason is most likely that 1) the resource adapter RAR file has not been deployed successfully to the application server WebLogic or 2) the element '< jndi name >' in weblogic - ra.xml has not been set to eis/DB/DBConn_215. In the latter case, you need to add a new factory of connections from WebLogic JCA (deploy a RAR). Please fix this and then restart the messagerie.* Application Server
I know, it looks like a mistake to JCA adapter, but when I do a synchronization of the table DB to DB with this factory of connections, no problems occur. Is there any procedure I should follow when mapping the input with db schema data?you update the JNDI name that you used ' ÉI/DB/DBConn_215' in weblogic - RA.xml file DbAdapter.rar @ weblogic_home\Oracle_SOA1\soa\connectors with the correct as data source
xADataSourceName
JDBC/scottdb (your Datasouce jndi name)
and you need to redeploy this .rar file updated.
-
Hello
I am a fairly new user for Oracle and have found this place to be very useful as I'm learning! One of the guidelines is to provide sample CREATE TABLE and INSERT data. I read the FAQ and in other forums to see if I could better understand this process, but I'm still struggeling reflected. Please can someone explain exactly what I do for these data, I want to be sure that I provided as useful information a lot in my posts to get help as soon as possible. I appreciate everything / all the answers!
Hello
Daniel Strong wrote:
So, something like this:
INSERT INTO skills (mu_id, external_id, skill_nm, skill_level) VALUES(220,AB,FAST,1);
INSERT INTO skills (mu_id, external_id, skill_nm, skill_level) VALUES(7,BB,SLOW,7);
INSERT INTO skills (mu_id, external_id, skill_nm, skill_level) VALUES(221,BC,FAST,1);
INSERT INTO skills (mu_id, external_id, skill_nm, skill_level) VALUES(8,BD,SLOW,2);
INSERT INTO skills (user_id, skill_nm) VALUES (AB, SLOW);
INSERT INTO skills (user_id, skill_nm) VALUES (BB, SLOW);
INSERT INTO skills (user_id, skill_nm) VALUES (BC, DOWN);
INSERT INTO skills (user_id, skill_nm) VALUES (BD, SLOW);
DESIRED RESULTS:
MU_ID EXTERNAL_ID SKILL_NAME SKILL_LEVEL
220 AB FAST 1
221 AV FAST 1When you get a response, you want it works or is it OK if the answer causes errors?
Obviously, you want people to post answers that work. Make sure that the code of that validation works, too. Test (and, if necessary, correct) your INSERT statements in your own development before posting on this forum system.The literal string values must be in single quotes. I think you meant:
INSERT INTO skills (external_id, skill_nm, mu_id, skill_level) VALUES (220, "AB", "QUICK", 1);
Without the single quotes, AB and FAST are considered as column names or function.
-
Calling PL/SQL table...
I have a procedure called from a package that returns all the data, the package uses a PL/SQL table that I do not know HOW to call or values that I would need to run the XXINV_PWB_HIST_FCST_PUB. XXINV_PWB_ORG_HIST_TBL (structure) with in the package, can someone tell me how it's done?
Call package is downstairs, the record structure is less than the package call.
DECLARE
P_ITEM_NUMBER VARCHAR2 (200);
DATE OF P_CURRENT_DATE;
X_PWB_ORG_HIST_TBL APPS. XXINV_PWB_HIST_FCST_PUB. XXINV_PWB_ORG_HIST_TBL;
BEGIN
P_ITEM_NUMBER: = NULL;
P_CURRENT_DATE: = NULL;
-Modify the code to initialize the variable
-X_PWB_ORG_HIST_TBL: = NULL;
XXINV_PWB_HIST_FCST_PUB. () GET_ORG_DETAILS
P_ITEM_NUMBER = > 91,
P_CURRENT_DATE = > 2 February 2014 ",
X_PWB_ORG_HIST_TBL = > X_PWB_ORG_HIST_TBL (which values should I put in the section)
);
Legacy release:
DBMS_OUTPUT. PUT_LINE ('X_PWB_ORG_HIST_TBL =' |) X_PWB_ORG_HIST_TBL);
-: X_PWB_ORG_HIST_TBL: = X_PWB_ORG_HIST_TBL;
END;
TYPE XXINV_PWB_Hist_Tbl IS TABLE OF THE XXINV_PWB_Hist_Rec
INDEX OF DIRECTORY;
TYPE XXINV_PWB_Org_Hist_Rec IS RECORD
(
Org_Hist_Index_Id NUMBER: = ".
Item_Number Varchar2 (30): = ".
Number of Quantity_1: = ".
Number of Quantity_2: = ".
Number of Quantity_3: = ".
Number of Quantity_4: = ".
Number of Quantity_5: = ".
Number of Quantity_6: = ".
Number of Quantity_7: = ".
Number of Quantity_Total: = ".
Date of Date_History: = ".
Month_Year Varchar2 (15): = ".
Number of Quantity_8: = ");
Sorry I'm not familiar with PL/SQL tables...
Thank you
Help
I can't go through your entire code. From there, you no need to use this plsql don't table as an input parameter because you do not pass anything... You're just fill with your values hard-coded... Then you can try the below stated
DECLARE
-declare the plsql table
X_PWB_ORG_HIST_TBL APPS. XXINV_PWB_HIST_FCST_PUB. XXINV_PWB_ORG_HIST_TBL;
BEGIN
XXINV_PWB_HIST_FCST_PUB. GET_ORG_DETAILS (91, TO_DATE('02-FEB-2014','DD-MON-YYYY'), X_PWB_ORG_HIST_TBL);
-The legacy output:
BECAUSE me in X_PWB_ORG_HIST_TBL. FIRST... X_PWB_ORG_HIST_TBL. LAST
LOOP
-Add all columns to dbms_output print and test values
DBMS_OUTPUT. PUT_LINE ('X_PWB_ORG_HIST_TBL =' |) X_PWB_ORG_HIST_TBL (i). Org_Hist_Index_Id | «, » || X_PWB_ORG_HIST_TBL (i). Item_Number);
END LOOP;
END;
-
Performance issue Bulk Insert PL/SQL table type
Hi all
I put in work of a batch to fill a table with a large number of data records(>3,000,000). To reduce the execution time, I used PL/SQL tables to temporarily store data that must be written to the destination table. Once all documents are piling up in the PL/SQL table I use a FORALL operator for bulk insert the records in the physical table.
Currently, I follow two approaches to implement the process described above. (Please see the code segments below). I need to choose how to best wise performance between these two approaches. I really appreciate all the comments of experts about the runtime of the two approaches.
(I don't see much difference in consumption of time in my test environment that has limited the data series. This process involves building a complex set of structures of large product once deployed in the production environment).
Approach I:_
DECLARE
TYPE of test_type IS test_tab % ROWTYPE directory INDEX TABLE;
test_type_ test_type.
ins_idx_ NUMBER;
BEGIN
ins_idx_: = 1;
NESTED LOOPS
test_type_ (ins_idx_) .column1: = value1;
test_type_ (ins_idx_) .column2: = value2;
test_type_ (ins_idx_) .column3: = value3;
ins_idx_: = ins_idx_ + 1;
END LOOP;
I_ FORALL in 1.test_type_. COUNTY
INSERT INTO test_tab VALUES (i_) test_type_;
END;
/
Approach II:_
DECLARE
Column1 IS a TABLE OF TYPE test_tab.column1%TYPE INDEX DIRECTORY.
Column2 IS a TABLE OF TYPE test_tab.column2%TYPE INDEX DIRECTORY.
Column3 IS a TABLE OF TYPE test_tab.column3%TYPE INDEX DIRECTORY.
column1 column1_;
column2_ Column2;
column3_ Column3;
ins_idx_ NUMBER;
BEGIN
ins_idx_: = 1;
NESTED LOOPS
column1_ (ins_idx_): = value1;
column2_ (ins_idx_): = value2;
column3_ (ins_idx_): = value3;
ins_idx_: = ins_idx_ + 1;
END LOOP;
FORALL idx_ in 1.column1_. COUNTY
INSERT
IN n_part_cost_bucket_tab)
Column1,
Column2,
Column3)
VALUES)
column1_ (idx_),
column2_ (idx_),
column3_ (idx_));
END;
/
Best regards
Lorenzo
Published by: nipuna86 on January 3, 2013 22:23nipuna86 wrote:
I put in work of a batch to fill a table with a large number of data records(>3,000,000). To reduce the execution time, I used PL/SQL tables to temporarily store data that must be written to the destination table. Once all documents are piling up in the PL/SQL table I use a FORALL operator for bulk insert the records in the physical table.
Performance is more than just reducing the execution time.
Just as smashing a car stops more than a car in the fastest possible time.
If it was (breaking a car stopping all simply), then a brick with reinforced concrete wall construction, would have been the perfect way to stop all types of all sorts of speed motor vehicles.
Only problem (well more than one actually) is that stop a vehicle in this way is bad for the car, the engine, the driver, passengers and any other content inside.
And pushing 3 million records in a PL/SQL 'table' (btw, that is a WRONG terminology - there no PL/SQL table structure) in order to run a SQL cursor INSERT 3 million times, to reduce the execution times, is no different than using a brick wall to stop a car.
Both approaches are pretty well imperfect. Both places an unreasonable demand on the memory of the PGA. Both are still row-by-row (aka slow-by-slow) treatment.
-
Insert rows in the PL/SQl table
Hello
I have a PL/SQl table that I filled through bulk collect and now I'm trying to loop through the table (actually quite a few nested loops)... Now in one of my curls, I might need to insert a new row by splitting the field in the existing row in the table. Can I insert the line in the pl/sql table in the loop without affecting the "FOR i IN tab.first... Tab.Last' loop?
Also, what would be the index of such a line inserted into the table. Can I access it with tab.last + 1 (doesn't look like it can be done if I insert into various levels of loops).
OR
If I insert the lines insde loops nested, then I can access the new lines as soon as I close all the loops and open a new loop? The new lines will be at the last table.
Any help will be appreciated...The expression v_arr. LAST gives the index of the last entry, so you can refer to this element as
v_arr(v_arr.LAST)
Then the attributes of this element will be
v_arr(v_arr.LAST).attr
for example
DECLARE TYPE table_defs_tt IS TABLE OF user_tables%ROWTYPE INDEX BY PLS_INTEGER; v_mytables table_defs_tt; BEGIN SELECT * BULK COLLECT INTO v_mytables FROM user_tables WHERE ROWNUM <= 100; DBMS_OUTPUT.PUT_LINE(v_mytables(v_mytables.LAST).table_name); END;
-
How to call the PL/SQL of EntityImpl procedure
Hello
I have a page that can create/update visitors. When a new customer is created themselves, a line gets inserted into the database table. I use EO for this feature.
I need to create lines to two or three other table also when a new line is created in the main table. What is the best practice for this feature?
The 2 options that I know:
1 create a trigger on the main table and the appeal of trigger for inserting rows in other tables.
2. call a PL/SQL of EntityImpl procedure after the permanent data is committed to the table. (If this is the best approach, could you please let me know how to get there)
See you soon
AJ
In fact, Java Mail API is included in WLS and JDev, then you can simply add %MIDDLEWARE_HOME%\Oracle_Home\oracle_common\modules\javax.mail_2.0.0.0_1-4-4.jar to your project.
Dario
-
RESTful service cannot insert data using PL/SQL.
Hi all
Spin: stand-alone 2.01 AL on OEL 4.8 in box a. VM
Database Oracle 10.2.0.4 with Apex 4.2.0.00.27 on OEL4.8 in the VM B box.
Measure of oracle.example.hr performed without problem Restful services.
Cannot insert data using AL 2.0.1 but works on 1.1.4 AL.
who uses the following table (under scheme: scott):
and procedure (scott diagram) below:create table json_demo ( title varchar2(20), description varchar2(1000) ); grant all on json_demo to apex_public_user;
and execution in sqldeveloper 3.2.20.09 when it connects directly to box B as scott:CREATE OR REPLACE PROCEDURE post( p_url IN VARCHAR2, p_message IN VARCHAR2, p_response OUT VARCHAR2) IS l_end_loop BOOLEAN := false; l_http_req utl_http.req; l_http_resp utl_http.resp; l_buffer CLOB; l_data VARCHAR2(20000); C_USER_AGENT CONSTANT VARCHAR2(4000) := 'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)'; BEGIN -- source: http://awads.net/wp/2005/11/30/http-post-from-inside-oracle/ -- Ask UTL_HTTP not to raise an exception for 4xx and 5xx status codes, -- rather than just returning the text of the error page. utl_http.set_response_error_check(false); -- Begin the post request l_http_req := utl_http.begin_request (p_url, 'POST', utl_http.HTTP_VERSION_1_1); -- Set the HTTP request headers utl_http.set_header(l_http_req, 'User-Agent', C_USER_AGENT); utl_http.set_header(l_http_req, 'content-type', 'application/json;charset=UTF-8'); utl_http.set_header(l_http_req, 'content-length', LENGTH(p_message)); -- Write the data to the body of the HTTP request utl_http.write_text(l_http_req, p_message); -- Process the request and get the response. l_http_resp := utl_http.get_response (l_http_req); dbms_output.put_line ('status code: ' || l_http_resp.status_code); dbms_output.put_line ('reason phrase: ' || l_http_resp.reason_phrase); LOOP EXIT WHEN l_end_loop; BEGIN utl_http.read_line(l_http_resp, l_buffer, true); IF(l_buffer IS NOT NULL AND (LENGTH(l_buffer)>0)) THEN l_data := l_data||l_buffer; END IF; EXCEPTION WHEN utl_http.end_of_body THEN l_end_loop := true; END; END LOOP; dbms_output.put_line(l_data); p_response:= l_data; -- Look for client-side error and report it. IF (l_http_resp.status_code >= 400) AND (l_http_resp.status_code <= 499) THEN dbms_output.put_line('Check the URL.'); utl_http.end_response(l_http_resp); -- Look for server-side error and report it. elsif (l_http_resp.status_code >= 500) AND (l_http_resp.status_code <= 599) THEN dbms_output.put_line('Check if the Web site is up.'); utl_http.end_response(l_http_resp); RETURN; END IF; utl_http.end_response (l_http_resp); EXCEPTION WHEN OTHERS THEN dbms_output.put_line (sqlerrm); raise; END;
leading to:SET serveroutput ON DECLARE l_url VARCHAR2(200) :='http://MY_IP:8585/apex/demo'; l_json VARCHAR2(20000) := '{"title":"thetitle","description":"thedescription"}'; l_response VARCHAR2(30000); BEGIN post( p_url => l_url, p_message =>l_json, p_response => l_response); END;
Installation using 2.0.1anonymous block completed status code: 200 reason phrase: OK with data inserted.
and execution in sqldeveloper 3.2.20.09 when it connects directly to box B as scott:Workspace : wsdemo RESTful Service Module: demo/ URI Template: test Method: POST Source Type: PL/SQL
leading to:SET serveroutput ON DECLARE l_url VARCHAR2(200) :='http://MY_IP:8585//apex/wsdemo/demo/test'; l_json VARCHAR2(20000) := '{"title":"thetitle","description":"thedescription"}'; l_response VARCHAR2(30000); BEGIN post( p_url => l_url, p_message =>l_json, p_response => l_response); END;
Please notify.status code: 500 reason phrase: Internal Server Error Listener's log: Request Path passes syntax validation Mapping request to database pool: PoolMap [_poolName=apex, _regex=null, _workspaceIdentifier=WSDEMO, _failed=false, _lastUpdate=1364313600000, _template=/wsdemo/, _type=BASE_PATH] Applied database connection info Attempting to process with PL/SQL Gateway Not processed as PL/SQL Gateway request Attempting to process as a RESTful Service demo/test matches: demo/test score: 0 Choosing: oracle.dbtools.rt.resource.templates.jdbc.JDBCResourceTemplateDispatcher as current candidate with score: Score [handle=JDBCURITemplate [scopeId=null, templateId=2648625079503782|2797815111031405, uriTemplate=demo/test], score=0, scope=SecurityConfig [constraint=none, realm=NONE, logonConfig=LogonConfig [logonForm=null, logonFailed=null]], originsAllowed=[], corsEnabled=true] Determining if request can be dispatched as a Tenanted RESTful Service Request path has one path segment, continuing processing Tenant Principal already established, cannot dispatch Chose oracle.dbtools.rt.resource.templates.jdbc.JDBCResourceTemplateDispatcher as the final candidate with score: Score [handle=JDBCURITemplate [scopeId=null, templateId=2648625079503782|2797815111031405, uriTemplate=demo/test], score=0, scope=SecurityConfig [constraint=none, realm=NONE, logonConfig=LogonConfig [logonForm=null, logonFailed=null]], originsAllowed=[], corsEnabled=true] for: POST demo/test demo/test is a public resource Using generator: oracle.dbtools.rt.plsql.AnonymousBlockGenerator Performing JDBC request as: SCOTT Mar 28, 2013 1:29:28 PM oracle.dbtools.common.jdbc.JDBCCallImpl execute INFO: Error occurred during execution of: [CALL, begin insert into scott.json_demo values(/*in:title*/?,/*in:description*/?); end;, [title, in, class oracle.dbtools.common.stmt.UnknownParameterType], [description, in, class oracle.dbtools.common.stmt.UnknownParameterType]]with values: [thetitle, thedescription] Mar 28, 2013 1:29:28 PM oracle.dbtools.common.jdbc.JDBCCallImpl execute INFO: ORA-06550: line 1, column 6: PLS-00103: Encountered the symbol "" when expecting one of the following: begin case declare exit for goto if loop mod null pragma raise return select update while with <an identifier> <a double-quoted delimited-identifier> <a bind variable> << close current delete fetch lock insert open rollback savepoint set sql execute commit forall merge pipe The symbol "" was ignored. ORA-06550: line 2, column 74: PLS-00103: Encountered the symbol "" when expecting one of the following: begin case declare end exception exit for goto if loop mod null pragma raise return select update while with <an identifier> <a double-quoted delimited-id java.sql.SQLException: ORA-06550: line 1, column 6: PLS-00103: Encountered the symbol "" when expecting one of the following: begin case declare exit for goto if loop mod null pragma raise return select update while with <an identifier> <a double-quoted delimited-identifier> <a bind variable> << close current delete fetch lock insert open rollback savepoint set sql execute commit forall merge pipe The symbol "" was ignored. ORA-06550: line 2, column 74: PLS-00103: Encountered the symbol "" when expecting one of the following: begin case declare end exception exit for goto if loop mod null pragma raise return select update while with <an identifier> <a double-quoted delimited-id at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:447) at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396) at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:879) at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:505) at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:223) at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:531) at oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableStatement.java:205) at oracle.jdbc.driver.T4CCallableStatement.executeForRows(T4CCallableStatement.java:1043) at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1336) at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3612) at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3713) at oracle.jdbc.driver.OracleCallableStatement.execute(OracleCallableStatement.java:4755) at oracle.jdbc.driver.OraclePreparedStatementWrapper.execute(OraclePreparedStatementWrapper.java:1378) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at oracle.ucp.jdbc.proxy.StatementProxyFactory.invoke(StatementProxyFactory.java:242) at oracle.ucp.jdbc.proxy.PreparedStatementProxyFactory.invoke(PreparedStatementProxyFactory.java:124) at oracle.ucp.jdbc.proxy.CallableStatementProxyFactory.invoke(CallableStatementProxyFactory.java:101) at $Proxy46.execute(Unknown Source) at oracle.dbtools.common.jdbc.JDBCCallImpl.execute(JDBCCallImpl.java:44) at oracle.dbtools.rt.plsql.AnonymousBlockGenerator.generate(AnonymousBlockGenerator.java:176) at oracle.dbtools.rt.resource.templates.v2.ResourceTemplatesDispatcher$HttpResourceGenerator.response(ResourceTemplatesDispatcher.java:309) at oracle.dbtools.rt.web.RequestDispatchers.dispatch(RequestDispatchers.java:88) at oracle.dbtools.rt.web.HttpEndpointBase.restfulServices(HttpEndpointBase.java:412) at oracle.dbtools.rt.web.HttpEndpointBase.service(HttpEndpointBase.java:162) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at com.sun.grizzly.http.servlet.ServletAdapter$FilterChainImpl.doFilter(ServletAdapter.java:1059) at com.sun.grizzly.http.servlet.ServletAdapter$FilterChainImpl.invokeFilterChain(ServletAdapter.java:999) at com.sun.grizzly.http.servlet.ServletAdapter.doService(ServletAdapter.java:434) at oracle.dbtools.standalone.SecureServletAdapter.doService(SecureServletAdapter.java:65) at com.sun.grizzly.http.servlet.ServletAdapter.service(ServletAdapter.java:379) at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:179) at com.sun.grizzly.tcp.http11.GrizzlyAdapterChain.service(GrizzlyAdapterChain.java:196) at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:179) at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:849) at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:746) at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1045) at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:228) at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137) at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104) at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90) at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79) at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54) at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59) at com.sun.grizzly.ContextTask.run(ContextTask.java:71) at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532) at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513) at java.lang.Thread.run(Thread.java:662) Error during evaluation of resource template: ORA-06550: line 1, column 6: PLS-00103: Encountered the symbol "" when expecting one of the following: begin case declare exit for goto if loop mod null pragma raise return select update while with <an identifier> <a double-quoted delimited-identifier> <a bind variable> << close current delete fetch lock insert open rollback savepoint set sql execute commit forall merge pipe The symbol "" was ignored. ORA-06550: line 2, column 74: PLS-00103: Encountered the symbol "" when expecting one of the following: begin case declare end exception exit for goto if loop mod null pragma raise return select update while with <an identifier> <a double-quoted delimited-id
Concerning
ZackZack.L wrote:
Hi Andy,.Sorry, I forgot to post the Source that is used by the AL1.1.4 and the AL2.0.1.
Source
begin insert into scott.json_demo values(:title,:description); end;
It is a failure during insertion?
Yes, he failed in the insert using AL2.0.1.If the above statement produces the following error message:
The symbol "" was ignored. ORA-06550: line 2, column 74: PLS-00103: Encountered the symbol "" when expecting one of the following: begin case declare end exception exit for goto if loop mod null pragma raise return select update while with
That gives me to think that a character is not printable (notice how there is anything between the quotation marks - "") worked his way in your PL/SQL Manager. Note how the error is reported to correspond to a column 74 on line 2, line 2 of the block above has 58 characters, so a pure assumption somehow, there is extra space on line 2, which confuses the PL/SQL compiler, I suggest retype PL/SQL Manager manually and see if that solves the problem.
-
How to get data from a database table and insert into a file
Hello
I'm new to soa, I want to create an xml with the data from database tables, I'll have the xsd please suggest me how to get the data in the tables and insert in a file
concerningin your bpel process, you can use the db adapter to communicate with the database.
with this type of adapter, you can use stored procedures, selects, etc to get the data from your database into your bpel workflow.When did it call in your bpel to the db adapter process it will return an output_variable with the contents of your table data, represented in a style of xml form.
After that, you can use the second card (a file synchronization adapter) to write to the content of this variable in output to the file system
-
Using the name of the table to Insert variable
Hello
I'm trying to use a variable as the name of table to do an insert.
The name of the table where my datas have to be inserted is EVV_ + the Ref_var of data.
My code will be more explicit:
SELECT 'EVV_ ' | Ref_Equip
IN v_Ref_Equip
OF user.c_equip
WHERE clef_equip = v_clef_equip;
INSERT INTO 'user '. || v_Ref_Equip (Clef_var, Date1, value)
VALUES (v_clef_var, 18 May 01 ', 49, 156');
I can't find the proper syntax for inclusion in. I tried a lot of syntax, but not good.
So, how can I concatenate 'user.' + my v_Ref_Equip variable?
Thanks for the help
Have a look at this immediate execution method
SQL> set serveroutput on; SQL> declare 2 v_tab_name varchar2(20) := 'temp'; 3 begin 4 execute immediate 'create table temp(id number)'; 5 execute immediate 'insert into '||v_tab_name||' values (1)'; 6 commit; 7 end; 8 / PL/SQL procedure successfully completed. SQL> select * from temp; ID ---------- 1 SQL>
-
Nested PL/sql tables passing of ADF
Hi all
I'm moving a nested pl/sql table parameter of adf for the stored procedure.
I have the following code to bind the variable in my AMImpl
ArrayDescriptor desc = ArrayDescriptor.createDescriptor ("STATION_FEATURES_T", st.getConnection ());
TABLE array = new ARRAY (desc, st.getConnection (), stationFeatures);
For the first time, the code runs successfully. However, on the call to the AMImpl method even once, the ArrayDescriptor.createDescriptor get the following error:
java.lang.ClassCastException: oracle.jdbc.proxy.oracle$ $1jdbc $1replay $1driver $1NonTxnReplayableBase $2oracle $1jdbc $1OracleTypeMetaData Array$ $$Proxy cannot be cast to oracle.sql.ArrayDescriptor
I checked that the connection object is done correctly both times.
I also tried to set the setting force = true in ArrayDescriptor.createDescriptor to replace any descriptor be cached.
Pointers would be much appreciated.
You must mention jdev version because there are changes in the ojdbc7 driver (jdev 12 c +).
For example, this (old) approach with ArrayDescriptor.createDescriptor () is deprecated in favour of factory of conn.createOracleArray () or conn.createARRAY () methods.
Also, how do you get 'st' object?
Dario
-
Insert data from a field in another field in another table
I am trying to copy the records from the source tablein the dgpercentagedatachart table
the domain name is feederid
So that's what I came:
INSERT INTO dgpercentagedatachart (feederid)
Select source.feederid
Of the source;
This is the error I get
Error from the 1 in the command line:
INSERT INTO dgpercentagedatachart (feederid)
Select feederid
Source
Error report:
SQL error: ORA-01400: cannot insert NULL into ("GISELECTRIC". "" "" DGPERCENTAGEDATACHART '. "" OBJECTID')
01400 00000 - "impossible to insert a NULL value in (%s)."
I check that the two fields accept the NULL value, and they both said YES.
What can I do?
Excellent example. I get it.
But, how can I put the id of object with it?
Object_Id is the feeder_id # unique
You can question him in the same table:
INSERT INTO dgpercentagedatachart (feederid, objectid)
Select source.feederid, source.objectid
Of the source;
-
Button insert data to the table
Hello
I use APEX 4.2.3 with XE, I try to insert data into the table using code below but nothing happen when I press the button, create this button like 'create a button to point to page'-> 'dynamic action'-> 'run pl/sql '.
begin insert into dummy values('xx'); commit; end;
So to clarify, you have
(1) created a button that "action" is "defined by the dynamic action.
(2) created a dynamic action that executes pl/sql at the click on the button and you are pl/sql?
Maybe you are looking for
-
Satellite 2800-200 - what external enclosure that I can use for HARD drive
My daughter has a laptop of Toshiba S2800-200 eldely.It is broken where the mains cable between the machine and she has been quoted £100 for repair!She has already bought a new computer repair is not an option. Toshiba, however, contains some files (
-
I just made a few updates to Windows on my Lenovo IdeaPad Z580. I am running Windows 8.1. The list of updates consisted of a few definitions of spyware and the Realtek Audio update. I updated and installed updates and restarted my computer immediatel
-
We are worried about what will happen after 1.1.2017. When Mozilla needs to stop supporting the SHA-1 certificate. Our infrastructure is under the replacement, but we have still a few devices that will be with SHA - 1. What can we expect when the use
-
Tried to update and received the error 1722: Windows Print Spooler Service has not started. Checked the spooler that is set as automatic. Cannot find drivers that update the WIFi connection so that I can print from Windows 7. Am not able to print
-
How does feel to be a cheater?
This applies to anyone the andalousi bit is that lies waiting to cheat at Backgammon. You are such of a dick. Keep your little cheat program and stick up your * *! We BOTH know that I'm a better player than you... This is why you cheat with doubles t