Multiple rows insert and update form example
I just want to share with you an example of a multiple rows insert and update form. You can access it HERE (http://tryapexnow.com/apex/f?p=12090:21)
You will find on the same page the complete description of all elements used to buid it.
I'm waiting for opinions, suggestions, and questions here in this thread.
Thanks
Hello Valentin,
I got an error message when I clicked on the weblink. Here is the message
Error ERR-7620 Could not determine workspace for application. Could you please take a look at this.
Thanks,
Karol
Similar Messages
-
How can I use multiple row insert or update into DB in JSP?
Hi all,
pls help for my question.
"How can I use multiple rows insert or update into DB in JSP?"
I mean I will insert or update the multiple records like grid component. All the data I enter will go into the DB.
With thanks,That isn't true. Different SQL databases have
different capabilities and use different syntax, That's true - every database has its own quirks and extensions. No disagreement there. But they all follow ANSI SQL for CRUD operations. Since the OP said they wanted to do INSERTs and UPDATEs in batches, I assumed that ANSI SQL was sufficient.
I'd argue that it's best to use ANSI SQL as much as possible, especially if you want your JDBC code to be portable between databases.
and there are also a lot of different ways of talking to
SQL databases that are possible in JSP, from using
plain old java.sql.* in scriptlets to using the
jstlsql taglib. I've done maintenance on both, and
they are as different as night and day.Right, because you don't maintain JSP and Java classes the same way. No news there. Both java.sql and JSTL sql taglib are both based on SQL and JDBC. Same difference, except that one uses tags and the other doesn't. Both are Java JDBC code in the end.
Well, sure. As long as you only want to update rows
with the same value in column 2. I had the impression
he wanted to update a whole table. If he only meant
update all rows with the same value in a given column
with the same value, that's trivial. All updates do
that. But as far as I know there's know way to update
more than one row where the values are different.I used this as an example to demonstrate that it's possible to UPDATE more than one row at a time. If I have 1,000 rows, and each one is a separate UPDATE statement that's unique from all the others, I guess I'd have to write 1,000 UPDATE statements. It's possible to have them all either succeed or fail as a single unit of work. I'm pointing out transaction, because they weren't coming up in the discussion.
Unless you're using MySQL, for instance. I only have
experience with MySQL and M$ SQL Server, so I don't
know what PostgreSQL, Oracle, Sybase, DB2 and all the
rest are capable of, but I know for sure that MySQL
can insert multiple rows while SQL Server can't (or at
least I've never seen the syntax for doing it if it
does).Right, but this syntax seems to be specific to MySQL The moment you use it, you're locked into MySQL. There are other ways to accomplish the same thing with ANSI SQL.
Don't assume that all SQL databases are the same.
They're not, and it can really screw you up badly if
you assume you can deploy a project you've developed
with one database in an environment where you have to
use a different one. Even different versions of the
same database can have huge differences. I recommend
you get a copy of the O'Reilly book, SQL in a
Nutshell. It covers the most common DBMSes and does a
good job of pointing out the differences.Yes, I understand that.
It's funny that you're telling me not to assume that all SQL databases are the same. You're the one who's proposing that the OP use a MySQL-specific extension.
I haven't looked at the MySQL docs to find out how the syntax you're suggesting works. What if one value set INSERT succeeds and the next one fails? Does MySQL roll back the successful INSERT? Is the unit of work under the JDBC driver's control with autoCommit?
The OP is free to follow your suggestion. I'm pointing out that there are transactions for units of work and ANSI SQL ways to accomplish the same thing. -
Errors when inserting and updating form using VIEW.
Here's my view:
CREATE OR REPLACE FORCE
VIEW "SH_ADD_EMPLOYEES_VW" ("EMP_ID", "DEPT_ID", "JOB_DESC_ID", "EMPNO", "EMP_FIRST", "EMP_LAST", "USER_NAME", "USER_INI", "DEPTNO", "DEPT_DESC", "ROLES_ID", "ADMIN", "CREATES", "APPROVES", "QUALITY", "CUST_SVC", "SH_LOCAL",
"SH_OFFICE", "SYSTEM")
AS
select
"SH_EMPLOYEES"."EMP_ID" as "EMP_ID",
"SH_EMPLOYEES"."DEPT_ID" as "DEPT_ID",
"SH_EMPLOYEES"."JOB_DESC_ID" as "JOB_DESC_ID",
"SH_EMPLOYEES"."EMPNO" as "EMPNO",
"SH_EMPLOYEES"."EMP_FIRST" as "EMP_FIRST",
"SH_EMPLOYEES"."EMP_LAST" as "EMP_LAST",
"SH_EMPLOYEES"."USER_NAME" as "USER_NAME",
"SH_EMPLOYEES"."USER_INI" as "USER_INI",
"SH_EMPLOYEES"."DEPTNO" as "DEPTNO",
"SH_EMPLOYEES"."DEPT_DESC" as "DEPT_DESC",
"DOC_ROLES"."ROLES_ID" as "ROLES_ID",
"DOC_ROLES"."ADMIN" as "ADMIN",
"DOC_ROLES"."CREATES" as "CREATES",
"DOC_ROLES"."APPROVES" as "APPROVES",
"DOC_ROLES"."QUALITY" as "QUALITY",
"DOC_ROLES"."CUST_SVC" as "CUST_SVC",
"DOC_ROLES"."SH_LOCAL" as "SH_LOCAL",
"DOC_ROLES"."SH_OFFICE" as "SH_OFFICE",
"DOC_ROLES"."SYSTEM" as "SYSTEM"
FROM "SH_EMPLOYEES" "SH_EMPLOYEES", "DOC_ROLES" "DOC_ROLES"
where "SH_EMPLOYEES"."EMP_ID" = "DOC_ROLES"."EMP_ID"
Here's my trigger (note - I am not using the EXCEPTION clause or (declaration of it) because it throws an error on msg=>: 'This is my message.' Any help here would be great as well.)
CREATE OR REPLACE TRIGGER bi_ADD_EMPLOYEES_VW
INSTEAD OF insert ON SH_ADD_EMPLOYEES_vw
for each row
declare
duplicate_info EXCEPTION;
PRAGMA EXCEPTION_INIT(duplicate_info, -00001);
begin
insert into SH_EMPLOYEES
(EMP_ID, DEPT_ID, JOB_DESC_ID, EMPNO, EMP_FIRST, EMP_LAST, USER_NAME, USER_INI, DEPTNO, DEPT_DESC)
values
(:new.EMP_ID, :new.DEPT_ID, :new.JOB_DESC_ID, :new.EMPNO, :new.EMP_FIRST, :new.EMP_LAST, :new.USER_NAME, :new.USER_INI, :new.DEPTNO, :new.DEPT_DESC);
insert into DOC_ROLES
(ROLES_ID, ADMIN, CREATES, APPROVES, QUALITY, CUST_SVC, SH_LOCAL, SH_OFFICE, SYSTEM)
VALUES (
:new.ROLES_ID, :new.ADMIN, :new.CREATES, :new.APPROVES, :new.QUALITY, :new.CUST_SVC, :new.SH_LOCAL, :new.SH_OFFICE, :new.SYSTEM);
EXCEPTION
WHEN duplicate_info THEN
RAISE_APPLICATION_ERROR (
num=> -20107
msg=> 'Duplicate employee');
END bi_ADD_EMPLOYEES_VW;
ERROR ON UPDATE:
ORA-20505: Error in DML: p_rowid=1001,
p_alt_rowid=EMP_ID, p_rowid2=2, p_alt_rowid2=ROLES_ID. ORA-01779: cannot modify
a column which maps to a non key-preserved table
ERROR ON INSERT:
ORA-01400: cannot insert NULL into
("SPICE_HUNTER1"."SH_EMPLOYEES"."EMP_ID") ORA-06512: at
"SPICE_HUNTER1.BI_SH_ADD_EMPLOYEES_VW", line 3 ORA-04088: error during execution
of trigger 'SPICE_HUNTER1.BI_SH_ADD_EMPLOYEES_VW' ORA-06512: at
"SYS.WWV_DBMS_SQL", line 549 ORA-06512: at "APEX_040000.WWV_FLOW_DML", line 1121
ORA-22816: unsupported feature with RETURNING clause
Error Unable to process row on table SH_ADD_EMPLOYEES_VWFrom what I see you are not handling emp_id when it is null.. you need to assign it a value when null from sequence.. that column cannot be null, hence the error, and in order to "modify" a column in that table the DML needs that id to have a value.
-
Oracle forms 10g,multiple insert and update problem
Hi,
I have tabular form(4 records displayed) with one datablock(based on a view).
After querying the form could not update all the records but only first record value can select from LOV.
I called a procedure in in-insert and on-update
The query is lik this
PACKAGE BODY MAPPING IS
PROCEDURE INSERT_ROW(EVENT_NAME IN VARCHAR2)
IS
BEGIN
IF (EVENT_NAME = 'ON-INSERT') THEN
INSERT INTO XX_REC_MAPPING
(BRANCH_CODE,COLLECTION_ID,PAY_MODE_ID,RECEIPT_METHOD,CREATED_BY,
CREATION_DATE,LAST_UPDATED_BY,LAST_UPDATE_DATE,LAST_UPDATE_LOGIN)
VALUES
( :XX_REC_MAPPING.OFFICE_CODE,
:XX_REC_MAPPING.COLLECTION_ID,
:XX_REC_MAPPING.PAY_MODE_ID,
:XX_REC_MAPPING.RECEIPT_METHOD,
:XX_REC_MAPPING.CREATED_BY,
:XX_REC_MAPPING.CREATION_DATE,
:XX_REC_MAPPING.LAST_UPDATED_BY,
:XX_REC_MAPPING.LAST_UPDATE_DATE,
:XX_REC_MAPPING.LAST_UPDATE_LOGIN);
ELSIF (EVENT_NAME = 'ON-UPDATE') THEN
UPDATE XX_REC_MAPPING
SET BRANCH_CODE=:XX_REC_MAPPING.OFFICE_CODE,
COLLECTION_ID=:XX_REC_MAPPING.COLLECTION_ID,
PAY_MODE_ID=:XX_REC_MAPPING.PAY_MODE_ID,
RECEIPT_METHOD=:XX_REC_MAPPING.RECEIPT_METHOD,
LAST_UPDATED_BY=:XX_REC_MAPPING.LAST_UPDATED_BY,
LAST_UPDATE_DATE=:XX_REC_MAPPING.LAST_UPDATE_DATE,
LAST_UPDATE_LOGIN=:XX_REC_MAPPING.LAST_UPDATE_LOGIN
WHERE ROWID=:XX_REC_MAPPING.ROW_ID;
END IF;
END INSERT_ROW;
END MAPPING;
Whether the table gets looked or sholud i use some other trigger or loops ?
someone suggest me how to edit this query for multiple update.
Thanks
sat33I called a procedure in in-insert and on-updateWhy are you writing this code in the first place? If you have a block based on an updatable view, just let Forms do the inserts and updates.
If it's not an updatable view, use instead of triggers on the view.
See this current thread too:
INSTEAD of Trigger View for an Oracle EBS New form development -
How do I insert multiple rows from a single form ...
How do I insert multiple rows from a single form?
This form is organised by a table. (just as in an excel format)
I have 20 items on a form each row item has five field
+++++++++++ FORM AREA+++++++++++++++++++++++++++++++++++++++++++++++++++++
+Product| qty In | Qty Out | Balance | Date +
+------------------------------------------------------------------------+
+Item1 | textbox1 | textbox2 | textbox3 | date +
+ |value = $qty_in1|value= &qty_out1|value=$balance1|value=$date1 +
+------------------------------------------------------------------------+
+Item 2 | textbox1 | textbox2 | textbox4 | date +
+ |value = $qty_in2|value= $qty_out1|value=$balance2|value=$date2 +
+------------------------------------------------------------------------+
+ Item3 | textbox1 | textbox2 | textbox3 | date +
+------------------------------------------------------------------------+
+ contd | | | +
+------------------------------------------------------------------------+
+ item20| | | | +
+------------------------------------------------------------------------+
+ + + SUBMIT + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Database Structure
+++++++++++++++++
+ Stock_tabe +
+---------------+
+ refid +
+---------------+
+ item +
+---------------+
+ Qty In +
+---------------+
+ Qty Out +
+---------------+
+ Balance +
+---------------+
+ Date +
+++++++++++++++++
Let's say for example user have to the use the form to enter all 10 items or few like 5 on their stock form into 4 different textbox field each lines of your form, however these items go into a "Stock_table" under Single insert transaction query when submit button is pressed.
Please anyone help me out, on how to get this concept started.Hello,
I have a way to do this, but it would take some hand coding on your part. If you feel comfortable hand writing php code and doing manual database calls, specificaly database INSERT calls you should be fine.
Create a custom form using the ADDT Custom Form Wizard that has all the rows and fields you need. This may take a bit if you are adding the ability for up to 20 rows, as per your diagram of the form area. The nice thing about using ADDT to create the form is that you can setup the form validation at the same time. Leave the last step in the Custom Form Wizard blank. You can add a custom database call here, but I would leave it blank.
Next, under ADDT's Forms Server Behaviors, select Custom Trigger. At the Basic tab, you enter your custom php code that will be executed. Here you are going to want to put your code that will check if a value has been entered in the form and then do a database INSERT operation on the Stock_table with that row. The advanced tab lets you set the order of operations and the name of the Custom Trigger. By default, it is set to AFTER. This means that the Custom Trigger will get executed AFTER the form data is processed by the Custom Form Transaction.
I usually just enter TEST into the "Basic" tab of the Custom Trigger. Then set my order of operations in the "Advanced" tab and close the Custom Trigger. Then I go to the code view for that page in Dreamweaver and find the Custom Trigger function and edit the code manually. It's much easier this way because the Custom Trigger wizard does not show you formatting on the code, and you don't have to keep opening the Wizard to edit and test your code.
Your going to have to have the Custom Trigger fuction do a test on the submitted form data. If data is present, then INSERT into database. Here's a basic example of what you need to do:
In your code view, the Custom Trigger will look something like this:
function Trigger_Custom(&$tNG) {
if($tNG->getColumnValue("Item_1")) {
$item1 = $tNG->getColumnValue("Item_1");
$textbox1_1 = $tNG->getColumnValue("Textbox_1");
$textbox1_2 = $tNG->getColumnValue("Textbox_2");
$textbox1_3 = $tNG->getColumnValue("Textbox_3");
$date1 = $tNG->getColumnValue("Textbox_3");
$queryAdd = "INSERT INTO Stock_table
(item, Qty_In, Qty_Out, Balance, Date) VALUES($item1, $textbox1_1, $textbox1_2, $textbox1_3, $date1)"
$result = mysql_query($queryAdd) or die(mysql_error());
This code checks to see if the form input field named Item_1 is set. If so, then get the rest of the values for the first item and insert them into the database. You would need to do this for each row in your form. So the if you let the customer add 20 rows, you would need to check 20 times to see if the data is there or write the code so that it stops once it encounters an empty Item field. To exit a Custom Trigger, you can return NULL; and it will jump out of the function. You can also throw custom error message out of triggers, but this post is already way to long to get into that.
$tNG->getColumnValue("Item_1") is used to retrieve the value that was set by the form input field named Item_1. This field is named by the Custom Form Wizard when you create your form. You can see what all the input filed names are by looking in the code view for something like:
// Add columns
$customTransaction->addColumn("Item_1", "STRING_TYPE", "POST", "Item_1");
There will be one for each field you created with the Custom Form Wizard.
Unfortunately, I don't have an easy way to do what you need. Maybe there is a way, but since none of the experts have responded, I thought I would point you in a direction. You should read all you can about Custom Triggers in the ADDT documentation/help pdf to give you more detailed information about how Custom Triggers work.
Hope this helps.
Shane -
How can i use multiple row subquery in update statement
Hai All
I using group function in my update statement.. and i need to update more rows so i need to use multiple row
subquery pls tell me how to use multiple row subquery in update statement
For example
while i am using this like this i got an error
update dail_att set outtime in (select max(r2.ptime) from temp_att where empcode=r2.enpno and
barcode=r2.cardn and attend_date=r2.pdate group by enpno,pdate,cardn);
Pls tell me how to use with example
Thanks & regards
Srikkanth.MHai Man
Thanks for ur response Let me clear what i need
First step Fetch the records as text file and stores into table T1
and the next step is i have seperated the text using substring and stores in different columns of a table
There are two shifts 0815 to 1645 and 1200 and 2000
Here I rep IN and O rep OUT
Empno date time inout
001 01-01-10 0815 I
002 01-01-10 0815 I
003 01-01-10 0818 I
001 01-01-10 1100 0
001 01-01-10 1130 I
002 01-01-10 1145 0
002 01-01-10 1215 I
004 01-01-10 1200 I
005 01-01-10 1215 I
004 01-01-10 1315 O
004 01-01-10 1345 I
001 01-01-10 1645 0
002 01-01-10 1715 0
003 01-01-10 1718 0
004 01-01-10 2010 0
005 01-01-10 2015 0
This is my T1 table i have taken data from text file and stored in this table from this table i need to move data to another table T2
T2 contains like this
Empno Intime Intrin Introut Outtime Date
001 0815 1100 1130 1645 01-01-10
002 0815 1145 1215 1715 01-01-10
003 0818 1718 01-01-10
004 1200 1315 1345 2010 01-01-10
005 1215 2015 01-01-10
This what i am trying to do man but i have little bit problems Pls give some solution with good example
And my coding is
declare
emp_code varchar2(25);
in_time varchar2(25);
out_time varchar2(25);
Cursor P1 is
Select REASON,ECODE,READMODE,EMPD,ENPNO,FILL,PDATE,PTIME,INOUT,CARDN,READERN
From temp_att
group by REASON,ECODE,READMODE,EMPD,ENPNO,FILL,PDATE,PTIME,INOUT,CARDN,READERN
ORDER BY enpno,pdate,ptime;
begin
for r2 in p1 loop
declare
bar_code varchar2(25);
begin
select barcode into bar_code from dail_att where empcode=r2.enpno and attend_date=r2.pdate;
For r3 in (select empcode,empname,barcode,intime,intrin,introut,addin,addout,outtime,attend_date from dail_att)loop
if r2.inout ='O' then
update dail_att set outtime =(select max(r2.ptime) from temp_att where empcode=r2.enpno and barcode=r2.cardn and attend_date=r2.pdate group by r2.cardn,r2.enpno,r2.pdate );
end if;
end loop;
exception
when no_data_found then
if r2.inout ='I' then
insert into dail_att(barcode,empcode,intime,attend_date)(select r2.cardn,r2.enpno,min(r2.ptime),r2.pdate from temp_att group by r2.cardn,r2.enpno,r2.pdate );
end if;
end;
end loop;
commit;
end;
Pls tell me what correction i need to do i the update statement i have used a subquery with group function but when i used it will return only one row but my need is to return many rows and i need to use multiple row subquery
and how can i use it in the update statement
Thanks In Advance
Srikkanth.M -
Multiple row insert not working as before after applying hotfix apsb13-13
Coldfusion 9.01
Windows Server 2003
Microsoft Access database (yeah, we know)
Before the hotfix was applied, we could add multiple rows (anywhere from 1-100 or more) and now we're limited to 15 rows at a time after applying the hotfix. We've narrowed it down to the hotfix being the culprit as we had to rebuild the server not to long after this hotfix was applied (~ 1 month) and the multiple row inserts were once again working fine until we got to the point of applying this hot fix again.
Anyone heard of this happening? Any ideas how to correct?
Thanks in advance,
fmHelp
Below is code of how we're doing the multiple row insert (it's performed over 3 pages):
Page 1
<cfform name="form1" method="post" action="handler.cfm?page=update_2">
<input type="hidden" name="sProductID" value="<cfoutput>#qProducts.sProductID#</cfoutput>">
<table width="100%" border="0" cellspacing="3" cellpadding="3">
<tr>
<th scope="row" colspan="2" align="center">Update an Inventory Product</th>
</tr>
<tr>
<th width="42%" scope="row">Product ID</th>
<td width="58%"><cfoutput>#qProducts.sProductID#</cfoutput></td>
</tr>
<tr>
<th width="42%" scope="row">Friendly Name</th>
<td width="58%"><cfoutput>#qProducts.sFriendly_Name#</cfoutput></td>
</tr>
<tr>
<th width="42%" scope="row">Description</th>
<td width="58%"><cfoutput>#qProducts.sDescription#</cfoutput></td>
</tr>
<tr>
<th width="42%" scope="row">Vendor</th>
<td><select name="sVendor">
<cfoutput><option value="#qProducts.sVendor#">#qProducts.sVendor#</option></cfoutput>
<option value=""></option>
<cfoutput query="qVendor">
<option value="#sVendor#">#sVendor#</option>
</cfoutput>
</select></td>
</tr>
<tr>
<th scope="row">Order No.</th>
<td><cfinput name="sOrder_No" type="text" value="" required="yes" message="Order number is a required field."></td>
</tr>
<tr>
<th scope="row">Lot No.</th>
<td><input name="sLot" type="text" value=""/></td>
</tr>
<tr>
<th scope="row">Date Expires</th>
<td><input name="dtExpire" type="text" value=""/></td>
</tr>
<tr>
<th scope="row">Boxes received</th>
<td><input name="iBoxes" type="text" value="" /></td>
</tr>
<tr>
<th scope="row">Doses/Units</th>
<td><input name="pcount" type="text" value="" /></td>
</tr>
<tr>
<th scope="row">Note</th>
<td><cfoutput>#qProducts.sNote#</cfoutput></td>
</tr>
<tr>
<th scope="row"> </th>
<td> </td>
</tr>
<tr>
<th scope="row" colspan="2" align="center"><input type="submit" value="Submit" /></th>
</tr>
</table>
</cfform>
</table>
Page 2
<form name="form1" method="post" action="handler.cfm?page=update_3">
<cfoutput><input type="hidden" name="pcount" value="#FORM.pcount#"></cfoutput>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="6" align="left">Record count (Doses/Units)= <cfoutput>#FORM.pcount#</cfoutput></td>
</tr>
<tr>
<td>Product ID</td>
<td>Vendor</td>
<td>Order No.</td>
<td>Lot No.</td>
<td>Expiration Date</td>
<td>Num. of Boxes</td>
</tr>
<cfset Peoplecount = 0>
<cfloop index="Add" from="1" to="#form.pcount#" step="1">
<tr>
<cfset Peoplecount = PeopleCount + 1>
<td><input <cfoutput> value="#FORM.sProductID#" </cfoutput> name="sProductID_<cfoutput>#Peoplecount#</cfoutput>" type="text" id="sProductID_"></td>
<td><input <cfoutput>value="#FORM.sVendor#"</cfoutput> name="sVendor_<cfoutput>#Peoplecount#</cfoutput>" type="text" id="sVendor_"></td>
<td><input <cfoutput> value="#FORM.sOrder_No#" </cfoutput> name="sOrder_No_<cfoutput>#Peoplecount#</cfoutput>" type="text" id="sOrder_No_"></td>
<td><input <cfoutput>value="#FORM.sLot#"</cfoutput> name="sLot_<cfoutput>#Peoplecount#</cfoutput>" type="text" id="sLot_"></td>
<td><input <cfoutput> value="#DateFormat(FORM.dtExpire, 'MM/DD/YY')#" </cfoutput> name="dtExpire_<cfoutput>#Peoplecount#</cfoutput>" type="text" id="dtExpire_"></td>
<td><input <cfoutput>value="#FORM.iBoxes#"</cfoutput> name="iBoxes_<cfoutput>#Peoplecount#</cfoutput>" type="text" id="iBoxes_"></td>
</tr>
</cfloop>
<tr>
<td> </td>
<td>
<input type="submit" name="Submit" value="Submit">
<input name="HowMany" type="hidden" id="HowMany" value="<cfoutput>#Form.pcount#</cfoutput>">
</td>
</tr>
</table>
</form>
</table>
Page 3
<cfquery name="qGetOnHand" datasource="#variables.DSNCI#">
SELECT *
FROM Products
WHERE sProductID = '#session.sProductID#'
</cfquery>
<cfquery datasource="#variables.DSNCI#">
UPDATE Products
SET iOnHandQty = (#FORM.pcount# + #qGetOnHand.iOnHandQty#)
WHERE sProductID = '#session.sProductID#'
</cfquery>
<cfset quantity = #FORM.pcount#>
<cfset Pcount = 0>
<!-- Start Loop -->
<cfloop index="Add" from="1" to="#form.howmany#" step="1">
<cfset Pcount = Pcount + 1>
<cfset Product = "Form.sProductID_#Pcount#">
<cfset Product = Evaluate(Product)>
<cfset Vendor = "Form.sVendor_#Pcount#">
<cfset Vendor = Evaluate(Vendor)>
<cfset Order = "Form.sOrder_No_#Pcount#">
<cfset Order = Evaluate(Order)>
<cfset Lot = "Form.sLot_#Pcount#">
<cfset Lot = Evaluate(Lot)>
<cfset Expires = "Form.dtExpire_#Pcount#">
<cfset Expires = Evaluate(Expires)>
<cfset Boxes = "Form.iBoxes_#Pcount#">
<cfset Boxes = Evaluate(Boxes)>
<cfquery datasource="#variables.DSNCI#" name="InsertData">
Insert into Received_History (sProductID, sVendor, sOrder_No, sLot, dtExpire, iBoxes, dtReceived)
values ('#Product#', '#Vendor#', '#Order#', '#Lot#', <cfif Expires IS "">NULL<cfelse>#CreateOdbcDate(Expires)#</cfif>, #Boxes#, #CreateOdbcDate(Now())#)
</cfquery>
</cfloop>Rasi wrote:show your complete default.pa (also make sure that you dont override pulse settings in ~/.config/pulse) this setting should allow sound for ANY user - i just tried it and it works
also: of course you restarted pulseaudio?
I restarted pulseaudio and my computer.
My default.pa is displayed in the first post.
My files in /etc/pulse:
> ls -la /etc/pulse
total 28
drwxr-xr-x 1 root root 116 May 16 10:22 .
drwxr-xr-x 1 root root 3740 May 16 10:47 ..
-rw-r--r-- 1 root root 1269 Mar 3 21:31 client.conf
-rw-r--r-- 1 root root 2348 Oct 8 2013 daemon.conf
-rw-r--r-- 1 root root 5756 May 16 10:24 default.pa
-rw-r--r-- 1 root root 5718 Oct 8 2013 default.pa.pacnew
-rw-r--r-- 1 root root 2112 Oct 8 2013 system.pa
-la
My files in ~/.config/pulse:
> ls -la ~/.config/pulse
total 1048
drwx------ 1 homeuser homeuser 660 Sep 12 2013 .
drwx------ 1 homeuser homeuser 1054 Apr 24 14:06 ..
-rw-r--r-- 1 homeuser homeuser 40960 Oct 17 2013 1a8726d55f9140ae9d95dc512eacea67-card-database.tdb
-rw-r--r-- 1 homeuser homeuser 43 May 16 10:37 1a8726d55f9140ae9d95dc512eacea67-default-sink
-rw-r--r-- 1 homeuser homeuser 42 May 16 10:37 1a8726d55f9140ae9d95dc512eacea67-default-source
-rw-r--r-- 1 homeuser homeuser 12288 May 16 10:49 1a8726d55f9140ae9d95dc512eacea67-device-volumes.tdb
lrwxrwxrwx 1 homeuser homeuser 23 Sep 12 2013 1a8726d55f9140ae9d95dc512eacea67-runtime -> /tmp/pulse-cDmMRoO9oFBz
-rw-r--r-- 1 homeuser homeuser 12288 May 15 22:43 1a8726d55f9140ae9d95dc512eacea67-stream-volumes.tdb
-rw------- 1 homeuser homeuser 256 Jun 15 2013 cookie
-rw-r--r-- 1 homeuser homeuser 331776 Jun 21 2013 equalizer-presets.tdb
-rw-r--r-- 1 homeuser homeuser 659456 Sep 20 2013 equalizer-state.tdb
Thanks for your efforts. -
Can we use both INSERT and UPDATE at the same time in JDBC Receiver
Hi All,
I would like to know is it possible to use both INSERT and UPDATE at the same time in one interface because I have a requirement in which I have to perform both the task.
user send the file which contains both new and old record and I need to save those in MS SQL database.
If the record exist then use UPDATE otherwise use INSERT.
I looked on sdn but didn't find any blog which perform both the things at the same time.
Interface Requirement
FILE -
> PI -
> JDBC(INSERT & UPDATE)
I am thinking to use JDBC Lookup but not sure if it good to use for bulk record.
Can somebody please suggest me something or send me the link of any blog or anything to solve this problem.
Thanks,Hi ,
If I have understood properly the scenario properly,you are not performing insert and update together. As you posted
"If the record exist then use UPDATE otherwise use INSERT."
Thus you are performing either an insert or an update which depends on outcome of a search if the records already exist in database or not. Obviously to search the tables you need " select * from ... where ...." query. If your query returns some results you proceed with update since this means there are some old records already in database. If your query returns no rows you proceed with "insert into tablename....." since there are no old records present in database.
Now perhaps the best method to do the searching, taking a decision to insert or update, and finally insert or update operation is to be done by a stored procedure in MS SQL database. A stored procedure is a subroutine available to applications accessing a relational database system. Here the application is PI server. If you need further help on how to write and call stored procedure in MS SQL you can look into these links
http://www.daniweb.com/web-development/databases/ms-sql/threads/146829
http://www.sqlteam.com/article/stored-procedures-parameters-inserts-and-updates
[ This part you can ignore, Since its not sure that you will face this situation
Still you might face some problems while your scenario runs. Lets consider this scenario, after the stored procedure searches the database it found no rows. Thus you proceed with an insert operation. If your database table is being accessed by multiple applications (or users) other than yours then it is very well possible that after the search operation completed with a null result, an insert/update operation has been performed by some other application with the same primary key. Now when you are trying to insert another row with same primary key you get an error message like "duplicate entry not possible for same primary key value". Thus you need to be careful in this respect. MS SQL has a feature called "exclusive locks ". Look into these links for more details on the subject
http://msdn.microsoft.com/en-us/library/aa213039(v=sql.80).aspx
http://www.mssqlcity.com/Articles/Adm/SQL70Locks.htm
http://www.faqs.org/docs/ppbook/r27479.htm
http://msdn.microsoft.com/en-US/library/ms187373.aspx
http://msdn.microsoft.com/en-US/library/ms173763.aspx
http://msdn.microsoft.com/en-us/library/e7z8d5hf(v=vs.80).aspx
http://mssqlserver.wordpress.com/2006/11/08/locks-in-sql/
http://www.mollerus.net/tom/blog/2008/03/using_mssqls_nolock_for_faster_queries.html
There must be other methods to avoid this problem. But the point is you need to be sure that all access to database for insert/update operations are isolated.
regards
Anupam -
MULTIPLE-ROW drag and drop between 2 ALV grids
Hi,
Can anybody help me with acheiving MULTIPLE-ROW drag and drop functionality between 2 ALV grids.hi Prakash,
Actually I'm trying to develop multiple drag and drop between 2 ALV's. To understand the events properly, I started working on this sample program where it uses 1 ALV and splits it into 2 and uses single row drag and drop between them. Now I'm making it to work for multiple drag and drop, so that I can use it on my application. This is the code which I'm working on..
*& Report Z_ALV_GRID_CONTROLS_DRAG_DROP *
REPORT z_alv_grid_controls_drag_drop.
DATA : i_ztransactions TYPE TABLE OF ztransactions
WITH HEADER LINE.
DATA : i_ztransactions2 TYPE TABLE OF ztransactions
WITH HEADER LINE.
DATA : ok_code LIKE sy-ucomm .
DATA : mcontainer TYPE REF TO cl_gui_custom_container .
DATA : mcontleft TYPE REF TO cl_gui_container .
DATA : mcontright TYPE REF TO cl_gui_container .
DATA : msplitcont TYPE REF TO
cl_gui_easy_splitter_container .
DATA : malv_left TYPE REF TO cl_gui_alv_grid .
DATA : malv_right TYPE REF TO cl_gui_alv_grid .
DATA : mrow TYPE lvc_s_row .
DATA : gt_outtab_source TYPE ztransactions.
DATA : gt_outtab_target TYPE ztransactions.
DATA : g_repid LIKE sy-repid.
DATA: gs_layout TYPE lvc_s_layo ,
g_behaviour_alv TYPE REF TO cl_dragdrop .
DATA : mlines TYPE i .
CLASS lcl_dragdropobj DEFINITION
This is the Class of Drag Drop Object .
This Object is used as a temporary storage means
of the information extracted with drag
CLASS lcl_dragdropobj DEFINITION.
PUBLIC SECTION.
DATA: i_ztransactions TYPE ztransactions ,
index TYPE i ,
original_table(5) TYPE c ,
proceed_trans(1) TYPE c .
ENDCLASS. "lcl_dragdropobj DEFINITION
DATA : mdata TYPE REF TO lcl_dragdropobj .
CLASS DND_TOOLS DEFINITION
This class contains the methods responding to the
events ONDRAG , ONDROP , ONDROPCOMPLETE
of the ALV Grid Controls
CLASS dnd_tools DEFINITION .
PUBLIC SECTION .
METHODS:handle_user_command
FOR EVENT user_command OF
cl_gui_alv_grid
IMPORTING
e_ucomm.
METHODS : handle_drag_from_left
FOR EVENT ondrag OF
cl_gui_alv_grid
IMPORTING
e_row
e_dragdropobj .
METHODS : handle_dropcomplete_from_left
FOR EVENT ondropcomplete OF
cl_gui_alv_grid
IMPORTING
e_row
e_dragdropobj .
METHODS : handle_drag_from_right
FOR EVENT ondrag OF
cl_gui_alv_grid
IMPORTING
e_row
e_dragdropobj .
METHODS : handle_dropcomplete_from_right
FOR EVENT ondropcomplete OF
cl_gui_alv_grid
IMPORTING
e_row
e_dragdropobj .
METHODS : handle_drop_to_left
FOR EVENT ondrop OF
cl_gui_alv_grid
IMPORTING
e_dragdropobj .
METHODS : handle_drop_to_right
FOR EVENT ondrop OF
cl_gui_alv_grid
IMPORTING
e_dragdropobj .
ENDCLASS . "DND_TOOLS DEFINITION
CLASS DND_TOOLS IMPLEMENTATION
CLASS dnd_tools IMPLEMENTATION .
METHOD handle_drag_from_left .
METHOD handle_user_command.
DATA: lt_rows TYPE lvc_t_row.
DATA: lt_rows TYPE lvc_t_roid.
DATA: lt_row TYPE lvc_s_roid.
DATA: mdata TYPE REF TO lcl_dragdropobj .
DATA: dragdropobj TYPE REF TO lcl_dragdropobj .
get selected row
CALL METHOD malv_left->get_selected_rows
IMPORTING
et_row_no = lt_rows.
CALL METHOD cl_gui_cfw=>flush.
IF sy-subrc NE 0.
add your handling, for example
CALL FUNCTION 'POPUP_TO_INFORM'
EXPORTING
titel = g_repid
txt2 = sy-subrc
txt1 = 'Error in Flush'(500).
ENDIF.
CREATE OBJECT mdata.
LOOP AT lt_rows INTO lt_row.
mrow = lt_row .
READ TABLE i_ztransactions INDEX lt_row-row_id INTO
i_ztransactions.
MOVE i_ztransactions TO mdata->i_ztransactions .
MOVE lt_row-row_id TO mdata->index.
MOVE 'LEFT' TO mdata->original_table .
e_dragdropobj->object = mdata .
ENDLOOP.
ENDMETHOD. "handle_user_command
METHOD handle_dropcomplete_from_left .
NB : the following data object MDATA is local to
the method and contains the information from the
import parameter of the method E_DRAGDROPOBJ
DATA : mdata TYPE REF TO lcl_dragdropobj .
DATA: lt_rows TYPE lvc_t_roid.
DATA: lt_row TYPE lvc_s_roid.
CALL METHOD malv_left->get_selected_rows
IMPORTING
et_row_no = lt_rows.
CALL METHOD cl_gui_cfw=>flush.
IF sy-subrc NE 0.
add your handling, for example
CALL FUNCTION 'POPUP_TO_INFORM'
EXPORTING
titel = g_repid
txt2 = sy-subrc
txt1 = 'Error in Flush'(500).
ENDIF.
LOOP AT lt_rows INTO lt_row.
mdata ?= e_dragdropobj->object .
CHECK mdata->proceed_trans = 'X' .
mrow = mdata->index.
DELETE i_ztransactions INDEX mrow .
APPEND mdata->i_ztransactions TO i_ztransactions2 .
SORT i_ztransactions2 BY kunnr belnr .
DELETE i_ztransactions2 WHERE kunnr IS INITIAL .
DESCRIBE TABLE i_ztransactions LINES mlines .
IF mlines EQ 0 .
CLEAR i_ztransactions .
APPEND i_ztransactions TO i_ztransactions .
ENDIF .
ENDLOOP.
CALL METHOD malv_left->refresh_table_display.
CALL METHOD malv_right->refresh_table_display.
ENDMETHOD . "HANDLE_DROPCOMPLETE_FROM_LEFT
METHOD handle_drag_from_right.
mrow = e_row-index .
READ TABLE i_ztransactions2 INDEX mrow INTO
i_ztransactions2 .
CREATE OBJECT mdata .
MOVE i_ztransactions2 TO mdata->i_ztransactions .
MOVE mrow TO mdata->index .
MOVE 'RIGHT' TO mdata->original_table .
e_dragdropobj->object = mdata .
ENDMETHOD . "HANDLE_DRAG_FROM_RIGHT
METHOD handle_dropcomplete_from_right .
DATA : mdata TYPE REF TO lcl_dragdropobj .
mdata ?= e_dragdropobj->object .
CHECK mdata->proceed_trans = 'X' .
mrow = mdata->index .
DELETE i_ztransactions2 INDEX mrow .
APPEND mdata->i_ztransactions TO i_ztransactions .
SORT i_ztransactions BY kunnr belnr .
DELETE i_ztransactions WHERE kunnr IS INITIAL .
DESCRIBE TABLE i_ztransactions2 LINES mlines .
IF mlines EQ 0 .
CLEAR i_ztransactions2 .
APPEND i_ztransactions2 TO i_ztransactions2 .
ENDIF .
CALL METHOD malv_left->refresh_table_display.
CALL METHOD malv_right->refresh_table_display.
ENDMETHOD . "HANDLE_DROPCOMPLETE_FROM_RIGHT
METHOD handle_drop_to_left .
DATA : mdata TYPE REF TO lcl_dragdropobj .
mdata ?= e_dragdropobj->object .
IF mdata->original_table = 'RIGHT' .
mdata->proceed_trans = 'X' .
ELSE .
mdata->proceed_trans = ' ' .
ENDIF .
e_dragdropobj->object = mdata .
ENDMETHOD . "HANDLE_DROP_TO_LEFT
METHOD handle_drop_to_right .
DATA : mdata TYPE REF TO lcl_dragdropobj .
DATA: lt_rows TYPE lvc_t_roid.
DATA: lt_row TYPE lvc_s_roid.
CALL METHOD malv_left->get_selected_rows
IMPORTING
et_row_no = lt_rows.
CALL METHOD cl_gui_cfw=>flush.
IF sy-subrc NE 0.
add your handling, for example
CALL FUNCTION 'POPUP_TO_INFORM'
EXPORTING
titel = g_repid
txt2 = sy-subrc
txt1 = 'Error in Flush'(500).
ENDIF.
LOOP AT lt_rows INTO lt_row.
mdata ?= e_dragdropobj->object .
IF mdata->original_table = 'LEFT' .
mdata->proceed_trans = 'X' .
ELSE .
mdata->proceed_trans = ' ' .
ENDIF .
e_dragdropobj->object = mdata .
ENDLOOP.
ENDMETHOD . "HANDLE_DROP_TO_RIGHT
ENDCLASS . "DND_TOOLS IMPLEMENTATION
DATA : mlistener TYPE REF TO dnd_tools .
======================================================
START OF SELECTION
======================================================
START-OF-SELECTION .
PERFORM get_data .
CALL SCREEN 100 .
The screen 100 has the custom control MCONTAINER and
on the flow logic has the following modules :
PROCESS BEFORE OUTPUT.
MODULE STATUS_0100.
MODULE PREPARE_SCREEN .
PROCESS AFTER INPUT.
MODULE USER_COMMAND_0100.
(Off course not commented out in the real flow logic)
FORM GET_DATA *
FOR THIS EXAMPLE THE DATA SELECTION IS HARD CODED
FORM get_data .
CLEAR : i_ztransactions , i_ztransactions[] .
i_ztransactions-mandt = sy-mandt .
i_ztransactions-waers = 'EUR ' .
i_ztransactions-kunnr = '0000000001' .
i_ztransactions-belnr = '0000000001' .
i_ztransactions-bldat = '20030101' .
i_ztransactions-dmbtr = '1000' .
APPEND i_ztransactions .
i_ztransactions-belnr = '0000000002' .
i_ztransactions-bldat = '20030202' .
i_ztransactions-dmbtr = '1010' .
APPEND i_ztransactions .
i_ztransactions-belnr = '0000000003' .
i_ztransactions-bldat = '20030323' .
i_ztransactions-dmbtr = '1020' .
APPEND i_ztransactions .
i_ztransactions-belnr = '0000000004' .
i_ztransactions-bldat = '20030404' .
i_ztransactions-dmbtr = '1030' .
APPEND i_ztransactions .
i_ztransactions-belnr = '0000000005' .
i_ztransactions-bldat = '20030505' .
i_ztransactions-dmbtr = '1040' .
APPEND i_ztransactions .
i_ztransactions-belnr = '0000000006' .
i_ztransactions-bldat = '20030606' .
i_ztransactions-dmbtr = '1050' .
APPEND i_ztransactions .
i_ztransactions-belnr = '0000000007' .
i_ztransactions-bldat = '20030707' .
i_ztransactions-dmbtr = '1060' .
APPEND i_ztransactions .
i_ztransactions-belnr = '0000000008' .
i_ztransactions-bldat = '20030808' .
i_ztransactions-dmbtr = '1070' .
APPEND i_ztransactions .
i_ztransactions-belnr = '0000000009' .
i_ztransactions-bldat = '20030909' .
i_ztransactions-dmbtr = '1080' .
APPEND i_ztransactions .
i_ztransactions-belnr = '0000000010' .
i_ztransactions-bldat = '20031010' .
i_ztransactions-dmbtr = '1090' .
APPEND i_ztransactions .
CLEAR : i_ztransactions2 , i_ztransactions2[] .
APPEND i_ztransactions2 .
ENDFORM . "GET_DATA
*& Module STATUS_0100 OUTPUT
The PF STATUS STATUS100 called from the module below,
has on the Standard toolbar the buttons
BACK , EXIT and CANCEL .
These buttons are provided with function code = 'EXIT'
MODULE status_0100 OUTPUT.
SET TITLEBAR 'TITLEDRAGDROP' .
SET PF-STATUS 'STATUS100'.
ENDMODULE. " STATUS_0100 OUTPUT
Module USER_COMMAND_0100 INPUT
The following module checks the User Command and ends
the program
MODULE user_command_0100 INPUT.
IF ok_code = 'EXIT' .
CLEAR : mcontainer ,
mcontleft ,
mcontright ,
msplitcont ,
malv_left ,
malv_right .
LEAVE TO SCREEN 0 .
ENDIF .
ENDMODULE. " USER_COMMAND_0100 INPUT
*& Module PREPARE_SCREEN OUTPUT
MODULE prepare_screen OUTPUT.
IF mcontainer IS INITIAL .
CREATE OBJECT mcontainer
EXPORTING
container_name = 'MCONTAINER' .
CREATE OBJECT msplitcont
EXPORTING
parent = mcontainer
orientation = 1 .
mcontleft = msplitcont->top_left_container .
mcontright = msplitcont->bottom_right_container .
CREATE OBJECT malv_left
EXPORTING i_parent = mcontleft .
gs_layout-sel_mode = 'D'.
CREATE OBJECT malv_right
EXPORTING i_parent = mcontright .
gs_layout-sel_mode = 'D'.
PERFORM set_layout_capable_of_drag_dro
USING 'X' 'X' .
CALL METHOD malv_left->set_table_for_first_display
EXPORTING
i_structure_name = 'ZTRANSACTIONS'
is_layout = gs_layout
CHANGING
it_outtab = i_ztransactions[].
CALL METHOD malv_right->set_table_for_first_display
EXPORTING
i_structure_name = 'ZTRANSACTIONS'
is_layout = gs_layout
CHANGING
it_outtab = i_ztransactions2[].
CREATE OBJECT mlistener .
CALL METHOD malv_left->set_toolbar_interactive.
SET HANDLER mlistener->handle_drag_from_left
FOR malv_left .
SET HANDLER mlistener->handle_dropcomplete_from_left
FOR malv_left .
SET HANDLER mlistener->handle_drag_from_right
FOR malv_right.
SET HANDLER mlistener->handle_dropcomplete_from_right
FOR malv_right .
SET HANDLER mlistener->handle_drop_to_right
FOR malv_right .
SET HANDLER mlistener->handle_drop_to_left
FOR malv_left .
ENDIF .
ENDMODULE. " PREPARE_SCREEN OUTPUT
Form SET_LAYOUT_CAPABLE_OF_DRAG_DRO
Definition of a Drag & Drop behaviour for the ALV
grid
FORM set_layout_capable_of_drag_dro USING drag drop.
DATA : effect TYPE i ,
handle_alv TYPE i .
CREATE OBJECT g_behaviour_alv.
effect = cl_dragdrop=>move + cl_dragdrop=>copy .
CALL METHOD g_behaviour_alv->add
EXPORTING
flavor = 'Line'
dragsrc = drag
droptarget = drop
effect = effect.
CALL METHOD g_behaviour_alv->get_handle
IMPORTING
handle = handle_alv.
gs_layout-s_dragdrop-row_ddid = handle_alv.
ENDFORM. " SET_LAYOUT_CAPABLE_OF_DRAG_DRO -
Hi,
I know this question has been asked and there was an answer:
http://stackoverflow.com/questions/1609637/is-it-possible-to-insert-multiple-rows-at-a-tim e-in-an-sqlite-database
But now things has changed, from version 3.7.11 SQLite does work normally with multiple insert:
http://stackoverflow.com/questions/1609637/is-it-possible-to-insert-multiple-rows-at-a-tim e-in-an-sqlite-database
http://www.sqlite.org/lang_insert.html
Now the problem is that I use SQLite Expert to perform a multiple row insert with normal sql method:
INSERT INTO table (col1, col2) VALUES
('row1col1', 'row1col2'), ('row2col1', 'row2col2'), ...
And this works. However when I try to use this insert within Flash Builder it gives me an error - syntax error near ",".
Is there a way I can check or update SQLite within Flex so I could use multiple row insert?
Thanks in advance for answers:)Unlike in php (values(product1),(product2),(product3))
you cannot insert records like that in a sqlite db.
What i did is the following
public function insertMonthRecords():void
var sqlText:String = "INSERT INTO month( monthname)
" +
"VALUES('Januari')";
insertStatement = new SQLStatement();
insertStatement.sqlConnection = conn;
insertStatement.addEventListener(SQLEvent.RESULT,
insertResult);
insertStatement.addEventListener(SQLErrorEvent.ERROR,
errorHandler);
insertStatement.text = sqlText;
insertStatement.execute();
insertStatement.text = "INSERT INTO month(monthname)
VALUES('Februari')";
insertStatement.execute();
insertStatement.text = "INSERT INTO month(monthname)
VALUES('March')";
insertStatement.execute();
insertStatement.text = "INSERT INTO month(monthname)
VALUES('April')";
insertStatement.execute();
And so on.. To bad i didn't found a solution to execute all
the inserts at once. Inserting this way takes time :-(
If you have a better solution, just let me know.
Greetz, Jacob -
How to retrieve the multiple rows data on PDF form in a web service method using WSDL DataConnection
How to retrieve the multiple rows data on PDF form in a web service method using WSDL DataConnection.
I have a multiple rows on PDF form. All rows have 4 textfields. I want to submit the multiple rows data to a method defiened in webservice.
Unable to retrieve the data in multiple rows within webservice method.Hi Paul,
I'm now able to save the retrieved xml in a hidden text field and create dynamic table, and I'm able to fill this table from the XML, but the problem is that I could not find the correct way to loop on the xml, what I'm trying to say, the table will have number of rows with the data of the first row only, so can you tell me the right way to loop on the xml!
this is my code
TextField1.rawValue=xmlData.document.rawValue;
xfa.datasets.data.loadXML(TextField1.rawValue, true, false);
for(var i=0; i<count; i++)
xfa.form.resolveNode("form1.P1.Table1.Row1["+i+"].Num").rawValue = xfa.datasets.data.record.num.value;
xfa.form.resolveNode("form1.P1.Table1.Row1["+i+"].Name").rawValue = xfa.datasets.data.record.name.value;
Table1.Row1.instanceManager.addInstance(true);
Thanks
Hussam -
Not Properly Insert and Update in ODI interfaces
Dear Brothers,
The records are not inserting and updating even the CDC captured in the journal in one of my package. But, stopped and execute again then there is inserts and updates. I am not able to understand where the problem is. Can u suggest regarding the issue.Dear Bro,
I am capturing CDC using consistent set. I am using (LKM SQL to DB2 UDB). While executing the package, the records are locked and extend window, but there is no inserts and updates into the database. It is throwing error as row index out of range while running the query. The query is running in Source Stage for ex. RTO_STAGE.JV$NUMGEN. query is triggering but records are not properly inserted and updated in the target.
First time i saw in the CDC table, there was some 10 records available while executing no insert and update. Then, i stopped it and execute it again at that time i checked in the CDC table ie., the same table, but there was only 2 records available in CDC the old records were disappeared.
I dont know the exact issue? My colleague is telling may be SNP tables not refreshing. Kindly suggest any solution. -
Execution results (Merged instead of inserted and updated)
I am doing UPDATE/INSERT on the target table. But in the execution results it just gives the rows inserted or updated combined in the merged column.
Is there a way to get inserted and updated in appropriate columns.I have not tried this recently - but I know the MERGE statement wasn't introduced until Oracle 9i. If you CONFIGURE the oracle module the map is in, and change the PL/SQL generation mode from "Default" to "Oracle 8i", I think it'll change the SQL to use INSERTS and UPDATES instead of the MERGE, which should give you what you want.
Warning though - this will change EVERY map in that module, and recompile using less efficient SQL. You might create a module just for the one map and set the generation mode for it, so that all the maps won't become less efficient.
Then again, the easier way is probably to simply have both an UPDATE_DATE and CREATE_DATE on your target table...if they are the same it was an INSERT, if different it was an UPDATE.
Hope this helps,
Scott -
In jdbc adapter what is the difference between insert and update insert
in jdbc adapter what is the difference between insert and update insert
Edited by: katru vijay on Mar 22, 2010 7:43 AMPlease refer to this Link [Document Formats for the Receiver JDBC Adapter|http://help.sap.com/saphelp_nw04/Helpdata/EN/22/b4d13b633f7748b4d34f3191529946/frameset.htm]
Hope this helps.
Regards,
Chandravadan -
Inserting and Updating records in ORACLE using WebDynpro Java
Hi All
I got connected to oracle backend (using my previous thread), but now i want to insert and update the records
i have created views for insert and update,
Thanks in advance
SushmaHi shusma..
chk this link..
<b><u>Creating Connection</u></b>
package com.sap.xirig;
import javax.naming.*;
import javax.sql.*;
import java.sql.*;
public class DBLookup {
String Conn_Status = "Not Connected";
String Language_Desc = "Empty";
String Language_Cd = "Empty";
Connection conn;
Context ctx;
DataSource ds;
//Constructor for the DBLookup object
public DBLookup {
try {
ctx = new InitialContext();
if (ctx == null) {
throw new Exception("Boom - No Context");
// If JDBC 2.0 connection is used please create the DataSource object as below
// ds = (DataSource) ctx.lookup("jdbc/ORACLEDATASOURCE");
// If JDBC 1.0 connection is used please create the DataSource object as below
// ds = (DataSource) ctx.lookup("jdbc/notx/ORACLEDATASOURCE");
if (ds == null) {
throw new Exception("Boom - No dataSource");
catch (Exception e) {
e.printStackTrace();
public String getLanguageDesc(String v_str) {
Statement stmt = null;
ResultSet rst = null;
try {
if (ds != null) {
conn = ds.getConnection();
Conn_Status = "Could not get connection to
datasource";
if (conn != null) {
Conn_Status = "Got Connection " +
conn.toString();
stmt = conn.createStatement();
rst = stmt.executeQuery("SELECT
LANGUAGE_DESC FROM LANGUAGETRANSLATION WHERE LANGUAGE_CD='" + v_str +
if (rst.next()) {
Language_Desc = rst.getString(1);
conn.close();
catch (Exception e) {
e.printStackTrace();
finally {
if (rst != null) {
try {
rst.close();
catch (Exception e) {
e.printStackTrace();
if (stmt != null) {
try {
stmt.close();
catch (Exception e) {
e.printStackTrace();
if (conn != null) {
try {
conn.close();
catch (Exception e) {
e.printStackTrace();
return Language_Desc;
http://e-docs.bea.com/wls/docs81/oracle/API_joci.html
Hope this will help u..
URs GS
Maybe you are looking for
-
NEW Macbook user - problems with Flashdrive USB file transfer
Hi, I hope someone can help me. I am a new Mac user, I have just started with a macbook and the latest Leopard software. I have a problem in that I save my Word docs (created or worked on with Office for Mac) on a flashdrive/USB pen and then take the
-
Runtime errors for Branched in SXMB_MONI
Hi, After PI 7.0 has been upgraded to SPS16, every time I try to display a message in status "Branched" from SXMB_MONI I get a runtime error. Also I got an error when trying to display it from RWB Monitor. Messages in other statuses donu2019t have pr
-
Items on my Navigation Bar on iStore
How can I enable other items on my navigation bar on iStore? I only have the AppStore, Podcast, and iTunes U. Help, anyone?
-
How do I read a character and advance the scanner to the next one?
Hi, I'm writing a lexical and grammar analyzer and I don't usually program in Java. I have a method that reads one character and then parses it. The problem is that it keeps reading the same character over and over again, so my program gets stuck in
-
Finder is no longer showing iPhoto in the sidebar....how do I get it to show again