How to handle the BOLB column Using JDBC adapter
Hi,
I want to sending of a BOLB column from a DB2 database table to another DB2 database, and the sender and receiver both by using JDBC adapter. The two tables in each other database have the same columns.
Here is the table's structure:
<ID>string type</ID>
<PDF>blob type</PDF>
Also, i haved create two DataTypes in PI system.
Sender DataType:
ns:DT_PDF_Req xmlns:ns="http://XXXXX.com/sap/xi">
<row>
<ID>1</ID>
<PDF></PDF>
</row>
</ns:DT_PDF_Req>
Receiver DataType:
<ns0:DT_PDF_Res xmlns:ns0="http://XXXX.com/sap/xi">
<STMT>
<dbtable action="INSERT">
<table>tablename</table>
<access>
<ID></ID>
<PDF></PDF>
</access>
</dbtable>
</STMT>
</ns0:DT_PDF_Res>
When test this interface, i found the that we can get the data, but when execute the insert stms the follow errors occured in RWB :
<ERROR>
Could not execute statement for table/stored proc. "DBDPUSER.pdf" (structure "STMT") due to com.ibm.db2.jcc.b.nm: DB2 SQL Error: SQLCODE=-103, SQLSTATE=42604, SQLERRMC=255044462d312e330a25c7ec8fa20a352030206f626a0a3c3c2f4c656e677468203620, DRIVER=3.50.153
JDBC Message processing failed, due to Error processing request in sax parser: Error when executing statement for table/stored proc. 'DBDPUSER.pdf' (structure 'STMT'): com.ibm.db2.jcc.b.nm: DB2 SQL Error: SQLCODE=-103, SQLSTATE=42604, SQLERRMC=255044462d312e330a25c7ec8fa20a352030206f626a0a3c3c2f4c656e677468203620, DRIVER=3.50.153
</ERROR>
Can anybody tell me how to resolve the problems?
And tell me about how to deal BOLB column using PI.
Best Regards
Terry
Hi Terry Qin,
I understand, you are getting below XML from sender JDBC channel. But when you getting SAX parser error, in receiver JDBC.
<ns:DT_PDF_Req xmlns:ns="http://XXXXX.com/sap/xi">
<row>
<ID>1</ID>
<PDF></PDF>
</row>
</ns:DT_PDF_Req>
I think it is because the XML which is going to receiver JDBC channel is not well formed (because pdf can containg < & characters).
You can achive this sceanrio, by selecting receiver JDBC channel as Message Protocol "Native SQL Format" [Link1|http://help.sap.com/saphelp_nwpi711/helpdata/en/44/7c24a75cf83672e10000000a114a6b/frameset.htm] you can send non XML to receiver channel.
Before that, you have convert above input XML into SQL statement, using Java Mapping.
Regards,
Raghu_Vamsee
Similar Messages
-
How to increase the thread count for JDBC adapter
Hi ALL,
Could someone advice me on how to increase the thread count for JDBC Adapter in Visual Admin:
JDBC_http://sap.com/xi/XI/System.Call.maxConsumers 5
JDBC_http://sap.com/xi/XI/System.Recv.maxConsumers 5
JDBC_http://sap.com/xi/XI/System.Rqst.maxConsumers 5
JDBC_http://sap.com/xi/XI/System.Send.maxConsumers 5
I need to increase them to 10.
Regards,
Xierhi check the below links:
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/806e75a0-0e01-0010-2587-fc518de8ac1a
admin manual:
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/fdb09490-0201-0010-e09e-a76388646ad0
note:reward points if solution found helpfull.....
regards
chandrakanth.k -
How to update the COST column using another table's column
Dear All,
I have table:
table parts: pno, pname, qoh, price, olevel
table orders: ono, cno, eno, received, shipped
table odetails: ono, pno, qty
view:orders_view: ono, cno, eno, received, shipped,sum(qty*price)order_costview:odetails_view: ono, pno, qty, (qty*price)cost
after I update the price in parts, I need to update COST and ORDER_COST too. The orders_view does not have pno, qty, and price, the odetails_view does not have price, how can I update the COST and ORDER_COST. Please help and Thanks in advance!!!
I wrote the update the price in parts:
create or replace procedure change_price(ppno in parts.pno%type, pprice in parts.price%type) as
begin
update parts
set price = pprice
where pno = ppno;
end;
show errorsthis procedure works fine.
I wrote the trigger:
create or replace trigger update_orders_v
after update of price on parts
for each row
begin
update orders_view
set order_cost = sum(parts.(:new.price)*parts.qty)
where parts.pno = :new.pno;
end;
show errorsIt gives me:Errors for TRIGGER UPDATE_ORDERS_V:
LINE/COL ERROR
3/5 PL/SQL SQL Statement ignored
4/22 PL/SQL ORA-00934: group function is not allowed hereplease help!You could add the columns to the tables and then you would need a trigger to update those columns. However, you could just as easily select the price * qty to get the cost, without creating an additional column or trigger. I have no idea what you might want to do with a global temporary table. I think you need to explain what your purpose is, before any of us can suggest the best method. Since I have already demonstrated an update with a view, I will demonstrate an update with the cost column added to the odetails table and a trigger as you asked about. Notice that you will need triggers on both tables, the one that has qty and the one that has price.
scott@ORA92> create table parts
2 (pno number(5) not null primary key,
3 pname varchar2(30),
4 qoh integer check(qoh >= 0),
5 price number(6,2) check(price >= 0.0),
6 olevel integer)
7 /
Table created.
scott@ORA92> create table odetails
2 (ono number(5),
3 pno number(5) references parts,
4 qty integer check(qty > 0),
5 cost number,
6 primary key (ono,pno))
7 /
Table created.
scott@ORA92> create or replace procedure change_price
2 (ppno in parts.pno%type,
3 pprice in parts.price%type)
4 as
5 begin
6 update parts
7 set price = pprice
8 where pno = ppno;
9 end;
10 /
Procedure created.
scott@ORA92> create or replace trigger update_cost1
2 after insert or update of price on parts
3 for each row
4 begin
5 update odetails
6 set cost = qty * :new.price
7 where pno = :new.pno;
8 end update_cost1;
9 /
Trigger created.
scott@ORA92> show errors
No errors.
scott@ORA92> create or replace trigger update_cost2
2 before insert or update of qty on odetails
3 for each row
4 declare
5 v_price parts.price%type;
6 begin
7 select price
8 into v_price
9 from parts
10 where pno = :new.pno;
11 --
12 :new.cost := :new.qty * v_price;
13 end update_cost2;
14 /
Trigger created.
scott@ORA92> show errors
No errors.
scott@ORA92> insert into parts values (1, 'name1', 1, 10, 1)
2 /
1 row created.
scott@ORA92> insert into odetails values (1, 1, 22, null)
2 /
1 row created.
scott@ORA92> -- starting data:
scott@ORA92> select * from parts
2 /
PNO PNAME QOH PRICE OLEVEL
1 name1 1 10 1
scott@ORA92> select * from odetails
2 /
ONO PNO QTY COST
1 1 22 220
scott@ORA92> -- update:
scott@ORA92> execute change_price (1, 11)
PL/SQL procedure successfully completed.
scott@ORA92> -- results:
scott@ORA92> select * from parts
2 /
PNO PNAME QOH PRICE OLEVEL
1 name1 1 11 1
scott@ORA92> select * from odetails
2 /
ONO PNO QTY COST
1 1 22 242
scott@ORA92> -- select works without extra cost column or trigger:
scott@ORA92> select o.ono, o.pno, o.qty, (o.qty * p.price) as cost
2 from odetails o, parts p
3 where o.pno = p.pno
4 /
ONO PNO QTY COST
1 1 22 242
scott@ORA92> -
How to handle BLOB field in receiver JDBC adapter into ABAP table
Dear Experts,
I am working in a synchronous scenario with Sender ABAP Proxy to Oracle Database as receiver via SAP PO 7.4.I will be calling a stored procedure view with fields ID, NAME,Age,*** and BLOB (Image binary).
1. The response from Oracle Database field BLOB is to be stored in ABAP table.Would I have to write any JAVA program to read the BLOB or the receiver JDBC adapter will handle it and store in a table by using ABAP proxy once it reaches ECC.
2. If yes, would the JAVA program have to deal with other 4 fields.
3. Can I use a UDF mapping to this BLOB field.
Regards
Rebecca...Dear Praveen,
Thanks for your response...
Please correct me if I am wrong.
1. For 1-1 response mapping for BLOB field, I will use just use the below UDF code.
public static byte[] hexStringToByteArray(String s) {
int len = s.length();
byte[] data = new byte[len / 2];
for (int i = 0; i < len; i += 2) {
data[i / 2] = (byte) ((Character.digit(s.charAt(i), 16) << 4)
+ Character.digit(s.charAt(i+1), 16));
return data;
2. ===Using the byte data, create binary attachment in mapping for abap proxy response===
Could you please share how to create the binary attachment.. I am not clear
Regards... -
How to handle the error when using Connection.setAutoCommit()
I use Jboss's datapool to realize the connection to Sybase
Database.And after connected to the database I wrote "con.setAutoCommit(false)" then the error occured.
The error is "java.sql.SQLException: JZ0SJ: Metadata accessor information was not found on this database. Please install the required tables as mention ed in the jConnect documentation."
I think it is because there is something wrong with the
configuration of the database but can not handle it .So please
help me,thank you!I use Jboss's datapool to realize the connection to
o Sybase
Database.And after connected to the database I wrote
"con.setAutoCommit(false)" then the error occured.
The error is "java.sql.SQLException: JZ0SJ: Metadata
a accessor information was not found on this database.
Please install the required tables as mention ed in
the jConnect documentation."
I think it is because there is something wrong with
th the
configuration of the database but can not handle it
.So please
help me,thank you!Most likely it means that your either DB or JDBC driver doesn't
support transactional approach, I mean: commit(), rollback() functions, so it reports setAutoCommit(false) as errorneous situation.
Paul -
How to get the primarykey columns of the table in SAP BI Java SDK
Hi, I'm new to sap BI Java SDK. I'm not getting how to get the primarykey columns, using BI JDBC Connector (for relational data sources). If anybody knows, please let me know. its very very urgent task to be done in my project. In the below following code.... I have written a code to connect to the database through resource bundle, reading table names, once user select table name, i need to show the primary key columns of that table to the user. here i'm not getting how to get the primary key columns . Please send me the code if there is any method to find out the primarykey columns or a logic to get them. I will be greatful to you.... if you can do this favour.
Please check out the following code ........
ManagedConnectionFactory mcf;
IConnectionFactory cf;
IConnectionSpec cs;
mcf = new JdbcManagedConnectionFactory();
cf = (IConnectionFactory) mcf.createConnectionFactory();
cs = cf.getConnectionSpec();
ResourceBundle rbLocal = ResourceBundle.getBundle( "xxxx");
Enumeration propnames = rbLocal.getKeys();
while (propnames.hasMoreElements())
String key = (String) propnames.nextElement(); //out.print(key); //out.println("="rbLocal.getString(key)"");
cs.setPropertyValue(key, rbLocal.getString(key));
// Establishing the connection. // The IBIRelational interface provides an entrypoint to access // metadata and execute queries.
IBIConnection connection = (IBIConnection) cf.getConnectionEx(cs); I
BIRelational rel = connection.getRelational();
IBIQuery query = rel.createQuery();
String sqlStatement = "SELECT * FROM " + "BICQPERSON where type='pk'"; ResultSet rs = IBIDataSet dataset = query.execute();
Thanks SreeKanthHi,
looks like you are on Infomation Builders, correct? If yes through which adapter and to what DB are you connecting?? in an R3/BW system you can do the folowing:
"(ABAP)
SELECT DISTINCT FIELDNAME
FROM DD03L
WHERE TABNAME = '/BIC/QPERSON'
AND AS4LOCAL = 'A'
AND KEYFLAG = 'X'
ORDER BY 1
Another option is goto directly to the RDBMS; in this case let me which one are you using
hope this helps...
Olivier.
Message was edited by:
Olivier Cora -
How to Handle Huge record count in JDBC
Hi,
Can we process 20 lakhs records which would size near to 136 MB using JDBC sender channel in a single call and the same need to deliver to Target system which is JDBC too.
Kindly mention which way this can be achieved.
RegardsHi Venkata,
Kindly go through this below link to processing the huge amount of data from the sender JDBC.
http://scn.sap.com/people/peng.shen2/blog/2009/12/23/pi-how-to-handle-high-volume-data-per-jdbc-adapter
https://scn.sap.com/thread/2005124
http://scn.sap.com/community/pi-and-soa-middleware/blog/2012/09/24/jdbc-receiver-scenarios-best-practices--how-to-handle-high-volume-load-stored-procedure-design-part6
Best Regards,
Monikandan. -
How to Handle DFF Attrbute_category Column
Hi All,
I want to made DFF Attribute category column as mandatory in standard page,normally to handle normal DFF attributes like attribute1 we will handle as follows
OAMessageLovInputBean cycle = (OAMessageLovInputBean)page.findChildRecursive("OrgProfileQuickFlex0"); ///"OrgProfileQuickFlex" is the DFF Name
cycle.setRequired("yes");
But How to handle the Attribute_category column.
Thanks
AjayYou could try setting the desctiptive felx field to required.
import oracle.apps.fnd.framework.webui.beans.OADescriptiveFlexBean
OADescriptiveFlexBean dff = (OADescriptiveFlexBean) page.findChildRecursive("OrgProfileQuickFlex");
dff.setReqired = true;
Mark -
How to handle the errors using RSRV tcode
Hi all,
Could any one give tell me how to handle the errors,(if possible give me some example errors)and correct the errors using RSRV tcode.
Thanks & Regards,
Aswini.Hello Aswini,
For further details on RSRV go through the link:
http://help.sap.com/saphelp_nw04/helpdata/en/92/1d733b73a8f706e10000000a11402f/frameset.htm
Hope it helps
Cheers
SRS -
How to handle the bad record while using bulk collect with limit.
Hi
How to handle the Bad record as part of the insertion/updation to avoid the transaction.
Example:
I am inserting into table with LIMIT of 1000 records and i've got error at 588th record.
i want to commit the transaction with 588 inserted record in table and log the error into
error logging table then i've to continue with transaction with 560th record.
Can anyone suggest me in this case.
Regards,
yuva>
How to handle the Bad record as part of the insertion/updation to avoid the transaction.
>
Use the SAVE EXCEPTIONS clause of the FORALL if you are doing bulk inserts.
See SAVE EXCEPTIONS in the PL/SQL Language doc
http://docs.oracle.com/cd/B28359_01/appdev.111/b28370/tuning.htm
And then see Example 12-9 Bulk Operation that continues despite exceptions
>
Example 12-9 Bulk Operation that Continues Despite Exceptions
-- Temporary table for this example:
CREATE TABLE emp_temp AS SELECT * FROM employees;
DECLARE
TYPE empid_tab IS TABLE OF employees.employee_id%TYPE;
emp_sr empid_tab;
-- Exception handler for ORA-24381:
errors NUMBER;
dml_errors EXCEPTION;
PRAGMA EXCEPTION_INIT(dml_errors, -24381);
BEGIN
SELECT employee_id
BULK COLLECT INTO emp_sr FROM emp_temp
WHERE hire_date < '30-DEC-94';
-- Add '_SR' to job_id of most senior employees:
FORALL i IN emp_sr.FIRST..emp_sr.LAST SAVE EXCEPTIONS
UPDATE emp_temp SET job_id = job_id || '_SR'
WHERE emp_sr(i) = emp_temp.employee_id;
-- If errors occurred during FORALL SAVE EXCEPTIONS,
-- a single exception is raised when the statement completes.
EXCEPTION
-- Figure out what failed and why
WHEN dml_errors THEN
errors := SQL%BULK_EXCEPTIONS.COUNT;
DBMS_OUTPUT.PUT_LINE
('Number of statements that failed: ' || errors);
FOR i IN 1..errors LOOP
DBMS_OUTPUT.PUT_LINE('Error #' || i || ' occurred during '||
'iteration #' || SQL%BULK_EXCEPTIONS(i).ERROR_INDEX);
DBMS_OUTPUT.PUT_LINE('Error message is ' ||
SQLERRM(-SQL%BULK_EXCEPTIONS(i).ERROR_CODE));
END LOOP;
END;
DROP TABLE emp_temp; -
How to update the ztable by using table handling function
how to update the ztable by using table handling function
It is very urgent ...............................
thanks in advancesee the below code for the direct ztable update
Report ZUPDATE_PRPS.
tables: zprps.
parameter: p_wbs like zprps-pspnr,
p_value like zprps-fakkz default 'X'.
data: wa_fakkz type zprps-fakkz.
*START-OF_SELECTION
start-of-selection.
call function 'CONVERSION_EXIT_ABPSP_INPUT'
exporting
input = p_wbs
importing
output = p_wbs
exceptions
not_found = 1
others = 2.
select single fakkz
into wa_fakkz
from zprps
where pspnr eq p_wbs.
if sy-subrc eq 0.
update zprps set fakkz = p_value where PSPNR eq p_wbs.
if p_value is initial.
message i999(za) with 'Billing element field has been unchecked'.
else.
message i999(za) with 'Billing element field has been checked'.
endif.
else.
message i999(za) with 'WBS element not found'.
endif.
reward points if it is usefull .....
Girish -
How to handle the #error in ssrs expression
hi
Please any one help me to resolve this #error ,
I have a calculated filed in that expression i given a if condition like below
data of column is coming like this 0 , 0.0
=IIF(Fields!Column1.Value=0,0,((Fields!Column2.Value - Fields!Column1.Value)/( Fields!Column1.Value)))
how to handle the #error
Please let me know any oneHi deepuk23,
According to your description, when you use the IIF() function in the report you got some error,right?
The issue can be caused by the column1 and column2 have different datatype, I assumed that one is integer and another is float, when the Column1 is 0 or null, because IIF() function always evaluates both the true part and the false part, even
though it returns only one of them, it will throw out the error.
To resolve the issue, you should use a nested IIF() function to avoid the zero-divisor in any rate like below:
=IIF(Fields!Column1.Value=0,0,((Fields!Column2.Value - Fields!Column1.Value)/(IIF(Fields!Column1.Value=0,1,Fields!Column1.Value))))
For more information, please refer to this article:
FAQ: Why does the “Attempted to divide by zero” error still happen?
If you still have any problem, please feel free to ask.
Regards,
Vicky Liu
Vicky Liu
TechNet Community Support -
How to handle fieldnames ending with # in JDBC receiver?
Hello Experts,
I am developing a scenario JDBC to IDOC. I have 2 tables for header & line item. I have to retrieve a header record first using sender JDBC & then for that header need to fetch the corresponding lineitems from second table.
We cannot have data types defined in XI with fieldnames containing # or any other special charecter. Both DB tables contain fieldnames ending with #.
For Sender JDBC, I managed it in SQL query using :
Select abc, xyz# as xyz .... from tbname
But for receiver JDBC we need to define a data type with the typical format ( Doccument format required for JDBC receiver).
Please let me know how to handle this for JDBC receiver.
Thanks in Advance & hope for a quick replies.
Abhijeet.Hi Abhijeet,
If you can write a query with join( you can call join query using JDBC adapter), i think this would be a fastest way and good approch rather than having 2 JDBC call.
Another approch would be writing SP( stored procedure and then you can have your complete logic here). You can call SP using JDBC adapter.
Eventhough query would be complex...it will be one time job.:)...I am not sure about data type for handling field names with special characters.
Let me know if you need more details.
Nilesh -
How to edit the JTable columns
Hi all,
please help me on this..
I created one Jtable with 0-9 columns(10 columns)and
I put only the 9th(last column) column is editable.
the problem is if I enter any text message in 9th column
and press another column then immediatly dissapears the
9th column text...
please tell me how to solve this problem .. because I want to take the
9th column text to another Object....
please send the solution anyone knows..
public boolean isCellEditable(int row, int col){
if(col == 9){
return true;
}else{
return false;
}If things go wrong while trying to edit table cells there is a good chance that you hit one of the many well known or even a new bug. These bugs are highly version dependent. So in any question please include the jdk version you are using and a very exact description of what you are seeing.
Here I assume that by "press another column" you mean "click the mouse in the header region"?
If so that's one of the well known, long-standing and not yet solved problems: jTable does cancel any edit on any notification from the columnModel - and due to suboptimal implementation of the tableHeaderUI even a single click does fire such a notification.
There is some debate about how to handle the situation but no easy or totally satisfying approach - your best bet is to search the bug parade (and google) for partial solutions and their pros and cons.
Greetings
Jeanette -
How to Change the Visible names in JDBC IView ?
While Creating a JDBC View, in one of the steps we select the column names from a schema which we want to view in a IView.While doing so in the next step there is a text field called <b>visible names</b> which is editable to change the column names.How to change the Column aliases or visibles names as is it not getting saved when we move onto the next screen ?.How to Configure the Visible Column names while configuring a JDBC IView ?.
Can anybody please help me !.Hi Abhilash
If I'm not wrong I saw something about this here (SDN), in a technical article about how to create a JDBC iView . I tried to get the link to the article but it seems there's a problem with the site, sorry...
By the way, I had the same problem, and according to the article this was not possible in the version EP6 SP2 but there was a plan to implement this in newer versions. I tried also to use a SQL command with the column names I wish to display but it didn't work either.
Try to find this article in the EP Technical Article to confirm this info, ok ?
Rgds,
Fernando
Maybe you are looking for
-
I am having issues with installing a Ricoh MP C2500 printer on Lion in my MBPro Ci7
I am having issues with installing a Ricoh MP C2500 printer on Lion in my MBPro Ci7 Where is appletalk or the replacement? My it guy has set all the Ricoh (The only brand of printers we use.) to enable Appletalk. I am unable to see how to enable ap
-
Windows Server 2008 driver for LaserJet 4100 with envelope printer
I have a new Windows 2008 Server 32 and a handful of HP printers. I need a driver for the LaserJet 4100 with an envelope feeder. The universal driver doesn't appear to recognize (or give an option to find) the envelope feeder. The old drivers I us
-
Is more ram for OS X always better?
I have an iMac Intel Core Duo and I have open or use the following programs constantly: Eye TV iTunes Skype Mail iChat in menu bar Front Row 1st Question: How much memory recommended for my situation? 2nd Question: I have heard that the more memory t
-
Logistics intergration in marketing && service Scenario .
HI, expert I want to creates a purchase request , purchase order, reservation, when set the status of the marketing project to Released. and I can not find more documents for marketing . But I get the message from the webclient :"your erp system do n
-
In both simulation and synthesis the logical operators on std_logic_vector bit-reverse the operands in the result, at least in the case where the result of the expression is passed to a function. I suspect this issue applies to other operators as wel