Update multiple records with Update Command Dreamweaver 8.0.2 - ASP VBScript
Dreamweaver 8.0.2 - Language ASP – VBScript
I’m trying to update more than one record at a time
using checkboxes. I’ve successfully done this numerous times
prior to Dreamweaver 8.0.2.
Before Dreamweaver 8.0.2, I would create a page with a
recordset, form, checkbox and repeat region and pass the ID to
another page containing an ‘Update Command’. The code
on the Update page looked similar to the following:
<%
if(Request.QueryString("MemberID") <> "") then
spMemberApproving__MMColParam = Request.QueryString("MemberID")
%>
<%
set spMemberApproving = Server.CreateObject("ADODB.Command")
spMemberApproving.ActiveConnection =
MM_connIssuesManager_STRING
spMemberApproving.CommandText = "UPDATE tblMembers SET
MemberApproved = 1 WHERE MemberID IN (" +
Replace(spMemberApproving__MMColParam, "'", "''") + ")"
spMemberApproving.CommandType = 1
spMemberApproving.CommandTimeout = 0
spMemberApproving.Prepared = true
spMemberApproving.Execute()
Response.Redirect("default.asp")
%>
However, in Dreamweaver 8.0.2 when you fill out the Update
Command dialog box, Dreamweaver asks you to provide the
‘Type’ and ‘Size’ for the variables (see:
http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=4e6b330a
That being said and done, the code on the Update page looks
like the following:
<%
' IIf implementation
Function MM_IIf(condition, ifTrue, ifFalse)
If condition = "" Then
MM_IIf = ifFalse
Else
MM_IIf = ifTrue
End If
End Function
%>
<%
if(Request.QueryString("MemberID") <> "") then
spMemberApproving__MMColParam = Request.QueryString("MemberID")
%>
<%
Set spMemberApproving = Server.CreateObject ("ADODB.Command")
spMemberApproving.ActiveConnection =
MM_connIssuesManager_STRING
spMemberApproving.CommandText = "UPDATE tblMembers SET
MemberApproved = 1 WHERE MemberID IN (?) "
spMemberApproving.Parameters.Append
spMemberApproving.CreateParameter("MMColParam", 202, 1, 10,
MM_IIF(Request.QueryString("MemberID"),
Request.QueryString("MemberID"), spMemberApproving__MMColParam
spMemberApproving.CommandType = 1
spMemberApproving.CommandTimeout = 0
spMemberApproving.Prepared = true
spMemberApproving.Execute()
Response.Redirect("default.asp")
%>
The Update Command works perfectly when only 1 record is
being updated. However, when I try to update more than one record I
get the following error:
Error Type:
ADODB.Command (0x800A0D5D)
Application uses a value of the wrong type for the current
operation.
/issues_manager/admin/members_approving.asp, line 27
Can anyone help me out?
Yes, this is a bug in Dreamweaver 8.0.2. The only workaround
is to stay with
8.0.1 or to hand-code the query. Adobe removed most of the
useful ways to
use Commands and Recordsets in 8.0.2 and limited it to basic
queries.
Tom Muck
co-author Dreamweaver MX 2004: The Complete Reference
http://www.tom-muck.com/
Cartweaver Development Team
http://www.cartweaver.com
Extending Knowledge Daily
http://www.communitymx.com/
"Button1" <[email protected]> wrote in message
news:[email protected]...
> Dreamweaver 8.0.2 - Language ASP ? VBScript
>
> I?m trying to update more than one record at a time
using checkboxes.
> I?ve
> successfully done this numerous times prior to
Dreamweaver 8.0.2.
>
> Before Dreamweaver 8.0.2, I would create a page with a
recordset, form,
> checkbox and repeat region and pass the ID to another
page containing an
> ?Update Command?. The code on the Update page looked
similar to the
> following:
>
> <%
> if(Request.QueryString("MemberID") <> "") then
> spMemberApproving__MMColParam =
> Request.QueryString("MemberID")
> %>
>
> <%
>
> set spMemberApproving =
Server.CreateObject("ADODB.Command")
> spMemberApproving.ActiveConnection =
MM_connIssuesManager_STRING
> spMemberApproving.CommandText = "UPDATE tblMembers SET
MemberApproved = 1
> WHERE MemberID IN (" +
Replace(spMemberApproving__MMColParam, "'", "''") +
> ")"
> spMemberApproving.CommandType = 1
> spMemberApproving.CommandTimeout = 0
> spMemberApproving.Prepared = true
> spMemberApproving.Execute()
>
> Response.Redirect("default.asp")
> %>
>
> However, in Dreamweaver 8.0.2 when you fill out the
Update Command dialog
> box,
> Dreamweaver asks you to provide the ?Type? and ?Size?
for the variables
> (see:
>
http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=4e6b330a
>
>
>
> That being said and done, the code on the Update page
looks like the
> following:
>
> <%
> ' IIf implementation
> Function MM_IIf(condition, ifTrue, ifFalse)
> If condition = "" Then
> MM_IIf = ifFalse
> Else
> MM_IIf = ifTrue
> End If
> End Function
> %>
>
> <%
> if(Request.QueryString("MemberID") <> "") then
> spMemberApproving__MMColParam =
> Request.QueryString("MemberID")
> %>
> <%
>
> Set spMemberApproving = Server.CreateObject
("ADODB.Command")
> spMemberApproving.ActiveConnection =
MM_connIssuesManager_STRING
> spMemberApproving.CommandText = "UPDATE tblMembers SET
MemberApproved = 1
> WHERE MemberID IN (?) "
> spMemberApproving.Parameters.Append
> spMemberApproving.CreateParameter("MMColParam", 202, 1,
10,
> MM_IIF(Request.QueryString("MemberID"),
Request.QueryString("MemberID"),
> spMemberApproving__MMColParam & ""))
> spMemberApproving.CommandType = 1
> spMemberApproving.CommandTimeout = 0
> spMemberApproving.Prepared = true
> spMemberApproving.Execute()
>
> Response.Redirect("default.asp")
> %>
>
>
> The Update Command works perfectly when only 1 record is
being updated.
> However, when I try to update more than one record I get
the following
> error:
>
> Error Type:
> ADODB.Command (0x800A0D5D)
> Application uses a value of the wrong type for the
current operation.
> /issues_manager/admin/members_approving.asp, line 27
>
>
> Can anyone help me out?
>
>
Similar Messages
-
Update multiple records with update button???
I was wondering if someone could explain how I can use the developer tool box to update multiple records at once.
I have a repeat region with a title and a check box if the item is active. I would like to update all records of the table at once. I have see folks state the developer tool box can do this. However I am not sure how..
I am using php with mysql dreamweaver cs3Hi Chris,
that can be done with first creating an ADDT "dynamic list", means to apply ADDT´s "Dynamic List Wizard" to an empty page -- this list will provide checkboxes for all displayed records, and here´s where you can select the to-be-updated (or deleted) records.
Besides creating the list, this wizard will also be creating a blank "form" php page in the same directory, which is by default "tied" to the created list -- you´ll just need to open this blank document with DW and apply ADDT´s "Create Dynamic Form Wizard" to it. However, this form will contain all required routines for single and multiple updates, depending on how many records you select in the list.
Cheers,
Günter Schenk
Adobe Community Expert, Dreamweaver -
Update Multiple Column with Single Command with Join between Two tables.
This is our command where we are trying to update a table's two columns by pulling values from another table after joining. This query takes too much time to execute. Any suggestions ?
UPDATE raw_alc_rmfscombinednew
SET (BSC, CELL_NAME) =
SELECT distinct raw_alc_R110combinednew.BSC, raw_alc_R110combinednew.CELL_NAME
FROM raw_alc_R110Combinednew
WHERE
raw_alc_R110Combinednew.OMC_ID = raw_alc_rmfscombinednew.OMC_ID
AND raw_alc_R110Combinednew.CELL_CI = raw_alc_rmfscombinednew.CI
AND RAW_ALC_R110COMBINEDNEW.START_TIME = RAW_ALC_RMFSCOMBINEDNEW.START_TIME
Results of Last execution:
Elapsed Time (sec) 4,476.56
CPU Time (sec) 4,471.88
Wait Time (sec) 4.68
Executions that Fetched all Rows (%) 100.00
Average Persistent Mem (KB) 32.43
Average Runtime Mem (KB) 31.59
--------------------------------------------------------------Your update requires a full execution of the subquery for each row in the destination table (raw_alc_rmfscombinednew). Try rewriting as a MERGE. Tons faster.
MERGE INTO raw_alc_rmfscombinednew D
USING ( SELECT distinct
BSC,
CELL_NAME
START_TIME
FROM raw_alc_R110Combinednew ) S
ON ( S.OMC_ID = D.OMC_ID
AND S.CELL_CI = D.CI
AND S.START_TIME = D.START_TIME )
WHEN MATCHED THEN
UPDATE
SET D.BSC = S.BSC,
D.CELL_NAME = S.CELL_NAME -
Update multiple records with one submit?
I can't for the life of me figure out how to do this. I have checkboxes with primary key id's listed as the value in a repeat region. I want to perform an update on 2 columns for all id's checked.
SUDEO CODE
<form>
<cfoutput query ....
other textfields...
<input name="checkbox" type="checkbox" id="checkbox" value="#table.id#" />
</cfoutput>
SUBMIT BUTTON
</form>
My update statement:
UPDATE table
SET column1 = 1, column2 ='whatever'
WHERE id IN (<cfqueryparam cfsqltype="cf_sql_integer" value="#TRIM(FORM.checkbox)#">)
</cfquery>
It only updates if I check one box, does nothing when more than one is selected.
I also tried looping over the update statement but nothing seems to work.You were missing the list attribute to cfqueryparam (you can also
replace the cfif with a null attribute on the cfqueryparam but it has
the disadvantage of sending the query to the db: null="#Not
Len(Trim(form.checkbox))#").
<cfif Len(Trim(form.checkbox))>
<cfquery ...>
UPDATE table
SET column1 = 1, column2 = 'whatever'
WHERE id IN (<cfqueryparam cfsqltype="cf_sql_integer"
value="#form.checkbox#" list="true">)
</cfquery>
</cfif>
Mack -
Update multiple records from list box
The idea is to present a list box to allow for the selection
of multiple records. The records' primary key field having been set
up as the value parameter in the list box. Then use a single update
statement to update all selected records with a common value.
I have tried to do this using code similar to:
UPDATE MyTable SET MyTable.MyColumn = 1 WHERE (
MyTable.MyKeyField IN ( @ListOfIntegers ) )
Where the parameter is configured thus:
<Parameter Name="@ListOfIntegers" Value='<%#
((Request.Form["MyListBox"]' Type="Int" />
The idea is that the multiple selection listbox will return a
comma separated list, which should l work nicely with the WHERE
[column] IN ( .. ) syntax.
Unfortunatley if more than one record is selected the
Complier throws a type conversion error.
I want to do this using Dreamweaver and C# on .NET.
Any ideas how to proceed ?Are you wanting to update multiple records with the same
information or
different information for each record?
Paul Whitham
Certified Dreamweaver MX2004 Professional
Adobe Community Expert - Dreamweaver
Valleybiz Internet Design
www.valleybiz.net
"lyleja" <[email protected]> wrote in
message
news:f1cpe5$jj1$[email protected]..
> The idea is to present a list box to allow for the
selection of multiple
> records. The records' primary key field having been set
up as the value
> parameter in the list box. Then use a single update
statement to update
> all
> selected records with a common value.
>
> I have tried to do this using code similar to:
>
> UPDATE MyTable SET MyTable.MyColumn = 1 WHERE (
MyTable.MyKeyField IN (
> @ListOfIntegers ) )
>
> Where the parameter is configured thus:
> <Parameter Name="@ListOfIntegers" Value='<%#
((Request.Form["MyListBox"]'
> Type="Int" />
>
>
> The idea is that the multiple selection listbox will
return a comma
> separated
> list, which should l work nicely with the WHERE [column]
IN ( .. ) syntax.
>
> Unfortunatley if more than one record is selected the
Complier throws a
> type
> conversion error.
>
> I want to do this using Dreamweaver and C# on .NET.
>
>
> Any ideas how to proceed ?
>
>
> -
I want to update multiple record in database which is based on condition
hi all,
I am using Jdev 11.1.2.1.0
I have one table named(Pay_apply_det) in this table i want to update one column named(Hierarchy) every time and according to change i want to update or i want to maintain my log table named(pay_apply_appr).It based on level wise approval when the lowest person approve the record show on next level but if the second
level person back it will be show only previous level hierarchy.And when the final approval happen the Posting_tag column of pay_apply_det will be updated too with hierarchy column.
i have drag pay_apply_det's data control as a table in my .jsf page and add one column approve status in UI .in the approve status i used radio group which return A for approve B for back R for reject through value binding i make it get or set method in it baking bean.
in backing bean class i have written code
public void approveMethod(ActionEvent actionEvent) {
ViewObject v9=new UtilClass().getView("PayApplyDetView1Iterator");
int h5=0;
Row rw9= v9.getCurrentRow();
String x=(String) rw9.getAttribute("RemarkNew1");
System.out.println(x);
String z=getR2();
System.out.println(z);
if(( z.equals("R") || z.equals("B") )&& x==null)
FacesMessage fm1 = new FacesMessage("Plz Insert Remark Feild");
fm1.setSeverity(FacesMessage.SEVERITY_INFO);
FacesContext context1 = FacesContext.getCurrentInstance();
context1.addMessage(null, fm1);
else{
ADFContext.getCurrent().getSessionScope().put("Radio",getR2().toString());
String LogValue=(String)ADFContext.getCurrent().getSessionScope().get("logid");
ViewObject voH=new UtilClass().getView("PayEmpTaskDeptView1Iterator");
voH.setWhereClause("task_cd='449' and subtask_cd='01' and empcd='"+LogValue+"'");
voH.executeQuery();
Row row1= voH.first();
int h1=(Integer)row1.getAttribute("Hierarchy");
System.out.println("Login Person Hierarchy on save button press.."+h1);
ViewObject vo9=new UtilClass().getView("PayApplyDetView1Iterator");
Row row9= vo9.getCurrentRow();
if(getR2().equals("A")&& h1!=1)
row9.setAttribute ("ApprHier",h1);
row9.setAttribute("IsClaimed","N");
row9.setAttribute("ClaimedBy",null);
row9.setAttribute("ClaimedOn", null);
else if(getR2().equals("B") ) {
ViewObject voO=new UtilClass().getView("LoHierViewObj1Iterator");
voO.setNamedWhereClauseParam("QHVO", LogValue);
Row rowO = voO.first();
h5=(Integer)rowO.getAttribute("LPrehier");
System.out.println("Back lower hier..."+h5);
row9.setAttribute ("ApprHier",h5);
row9.setAttribute("IsClaimed","N");
row9.setAttribute("ClaimedBy",null);
row9.setAttribute("ClaimedOn", null);
else if((h1==1) &&(getR2().equals("A")) )
row9.setAttribute ("PostingTag","Y");
row9. setAttribute ("ApprHier", h1);
row9.setAttribute("IsClaimed","N");
row9.setAttribute("ClaimedBy",null);
row9.setAttribute("ClaimedOn", null);
else if(getR2().equals("R"))
row9.setAttribute ("ApprHier",-1);
row9.setAttribute("IsClaimed","N");
row9.setAttribute("ClaimedBy",null);
row9.setAttribute("ClaimedOn", null);
BindingContext BC=BindingContext.getCurrent();
BindingContainer ac=BC.getCurrentBindingsEntry();
OperationBinding ob=ac.getOperationBinding("Commit");
ob.execute();
vo9.executeQuery();
FacesMessage fm = new FacesMessage("Your Data Successfully Commited..");
fm.setSeverity(FacesMessage.SEVERITY_INFO);
FacesContext context = FacesContext.getCurrentInstance();
context.addMessage(null, fm);
}here i put my approve status radio value in session variable because i also want to update my pay_apply_appr table which code i written in pay_apply_det IMPL class.
Every thing is running well when i update single record but when i want to update multiple record then my current row only updated in pay_apply_det but log table( pay_apply_appr) created for all record.
so is there any solution plz help me.
thanks
RAFATHi Rafat,
If you are able to insert into, all you need to do is iterate through the rows. For this , before the first IF condition
if(getR2().equals("A")&& h1!=1)Get the row count using int numRows =vo9.getRowCount(); , and then write it before the IF condition
if (int i=0;i<numRows;i++} After
row9.setAttribute("ClaimedOn", null);
}write vo9.next(); to iterate to next row,
Hope this will work.
Nigel. -
How to update multiple records in Oracle ?
Hi Guys,
<b>I have to update multiple records from a file into Oracle Table...</b>
I can successfully insert the multiple records into the table but can't update the multiple records into the table.
when i am using UPDATE_INSERT only my first record of the file is getting updated in th e table..
Please share your views with me.
Regards,I solved it by making changes in the occurrence parameter of data type ...:-)
-
Update Multiple records using NW CE WebDyn Pro 7.2 interface ITEMDETAILS
We are trying to use SAP Netweaver CE 7.2 and NetWeaver Design Studio 7.2 with the Web Dynpro application interfaces configured to connect to our MDM 7.1 SP06 repositories to develop web screens that allow our end users the ability to maintain MDM repository data without the use of DataManager.
Our first application was to be a simple one to show the business the benefit of SAP Netweaver. Itu2019s very easy to use the interfaces for SEARCH, RESULTSET, ITEMDETAILS, MATCH and MERGE if you plan to maintain one record at a time. We would like to update many records at the same time.
Using the configuration described previously, I find that I am able to select multiple records at one time using the RESULTSET interface and the Context folder of u201CSelectedRecordsu201D but I am not able to pass multiple records at one time to the context u201CIODatau201D used by the ITEMDETAILS interface and allow my end users to see and update multiple records at one time.
If I can pass multiple records from RESULTSET to ITEMDETAILS for display and update would you please provide me with an example of how I would do this in NetWeaver Design Studio for NW CE 7.2..
If I can NOT pass multiple records from RESULTSET to ITEMDETAILS for display and update, Would I then have to write my own wrapper application to read multiple records selected using the RESULTSET interface and the develop my own UPDATE view to display and update more than one record at a time. This would be time consuming since I would also have to write my own back out procedures and validation of update procedures that already happen within ITEMDETAILS. Do you happen to have any CE application examples that show how this is done for a NW CE MDM repository that I can see? The current documentation u201CHow to Build Web Applications Using MDM Web Dynpro Components. pdfu201D falls short in the area of updating multiple records.
Thank you in AdvanceBugs aside, if it's VERY noisy, that might just be the out-of-sync problem (something I'm very familiar with now).
Search the forum for "aggregate sync" and you should get some clues, if this is indeed the problem.
Short of it is, you need to sync the two devices together. Easiest way seems to be to connect the two devices via S/PDIF and set Clock Source to S/PDIF for the "slave" device (set in Audio Midi).
You can also just set the Clock Source as the "master" device in the drop down, bypassing the need for the S/PDIF cable altogether, but I haven't tried this myself.
Macbook Pro CD / iMac C2D Mac OS X (10.4.8) -
Hi,
Im having issues with updating multiple records.
This query selects users in a specific unit that are inactive (ui.nf_statusid = 2) and compare it newsmail_recipient table
select *
from roleuser ru, unit u, userinfo ui
where u.ip_unitid = ru.nf_unitid
and u.ip_unitid = unit_id
and ui.ip_userid = ru.nf_userid
and ui.nf_statusid = 2
and n_internal = 0
and ui.ip_userid in (select user_id
from newsmail_recipient
where user_id = ui.ip_userid
and nf_listid = liste
and nf_statusid = 1;the second script will set the users to inactive in newsmail_recipient that are inactive in the userinfo table.
update newsmail_recipient
set nf_statusid = 2
, d_modified = sysdate
where user_id = ui.ip_userid;I would like to know if its possible to merge this query. I know its possible for insert but havent tried update before.
This is how i do it, but its not working.
case when (select *
from roleuser ru, unit u, userinfo ui
where u.ip_unitid = ru.nf_unitid
and u.ip_unitid = unit_id
and ui.ip_userid = ru.nf_userid
and ui.nf_statusid = 2
and n_internal = 0
and ui.ip_userid in (select user_id
from newsmail_recipient
where user_id = ui.ip_userid
and nf_listid = liste
and nf_statusid = 1)
then update newsmail_recipient
set nf_statusid = 2
, d_modified = sysdate
where user_id = ui.ip_userid;
end;thanks guys...
regards,
jTable structure:
newsmail_recipient:
IP_RECIPIENTID NUMBER(8,0)
NF_LISTID NUMBER(8,0)
NF_STATUSID NUMBER(8,0)
D_CREATED DATE
D_MODIFIED DATE
C_NAME VARCHAR2(100 CHAR)
C_EMAIL VARCHAR2(256 CHAR)
USER_ID NUMBER(10,0)
NEWSMAIL_ID NUMBER(10,0)userinfo:
IP_USERID NUMBER(10,0)
NF_STATUSID NUMBER(10,0)
N_INTERNAL NUMBER(1,0)@jeenesh:
I tried your query but i get this error:
Error(510,30): PL/SQL: ORA-00904: "UI"."IP_USERID": invalid identifierJust wondering why, but ui.ip_userid is declared.
Actually, this is a package script.
procedure edit_recipient_to_newsmaillist(unit_id IN NUMBER)
as
liste number;
--Finner alle toppfoldere til de lukkede brukergruppene som uniten har tilgang til
cursor closed_user_group is
select element_id
from admin_unit_content_access
where group_id = 97
and accesstype_classification_id in( select classification_id
from dynamic_field_value
where key = 'closed_user_group'
and dynamic_field_grouping_id = (select dynamic_field_grouping_id
from unit
where ip_unitid = unit_id))
and element_type = 'f';
begin
--Finner hvilken liste folderen tilh�rer
for u in closed_user_group loop
if (u.element_id = 39464) then
liste := 2017; --AMG
elsif (u.element_id = 36664) then
liste := 2018; --Das wird meiner
elsif (u.element_id = 34011) then
liste := 2019; --Junge sterne
elsif (u.element_id = 68359) then
liste := 2020; --Service vorteilskarte
elsif (u.element_id = 1030675) then
liste := 2021; --TGC
elsif (u.element_id = 41741) then
liste := 2022; --Truckworks
elsif (u.element_id = 118659) then
liste := 2481; --CRM
elsif (u.element_id = 122982) then
liste := 2479; --Vitoecell
else
liste := 2037; --Sneak Drive
end if;
--oppdater til brukerene i den uniten i listen
merge into newsmail_recipient nm
using
(select *
from roleuser ru, unit u, userinfo ui
where u.ip_unitid = ru.nf_unitid
and u.ip_unitid = unit_id
and ui.ip_userid = ru.nf_userid
and ui.nf_statusid = 2
and n_internal = 0)
on (nm.user_id = ui.ip_userid)
when matched then
update set nm.nf_statusid = 2,
nm.d_modified = sysdate;
liste := 0;
end loop;
end edit_recipient_to_newsmaillist;
-
Updating multiple records without having to use a cursor
I am trying to update multiple records in a table.
Eg
Table A -20 records
Table B -10 records.
Would like to update Table B with the updated records in Table A for those records which the primary key matches
and I dont want to use cursors. Is this possible??
Thanx in Advance.Please refer to the test below, it should give you the general idea,SQL> desc tableA;
Name Null? Type
SEQ NUMBER
INV VARCHAR2(20)
AMT NUMBER(12,2)
AMT2 NUMBER(12,2)
SQL> desc tableB;
Name Null? Type
SEQ NUMBER
INV VARCHAR2(20)
AMT NUMBER(12,2)
AMT2 NUMBER(12,2)
SQL> select count(*) from tableA;
COUNT(*)
6
SQL> select count(*) from tableB;
COUNT(*)
12
SQL> UPDATE tableB b
2 SET b.inv = NVL((SELECT a.inv from tableA a WHERE a.seq = b.seq), b.inv),
3 b.amt = NVL((SELECT a.amt from tableA a WHERE a.seq = b.seq), b.amt),
4 b.amt2 = NVL((SELECT a.amt2 from tableA a WHERE a.seq = b.seq), b.amt2)
5 /
12 rows updated.
*** Please note that this is DIFFERENT from what you asked, here tableB is having more rows, which is fine. We **may not be** able update tableA in this example by reversing the table names, because the join may bring more rows than UPDATE statement needs. ***Thx,
Sri -
How to update multiple records checked by check box
I have list of items in my jsp pages and that are being generated by the following code
and I want to be able to update multiple records that have a checkbox checked:
I have a method to update the status and employee name that uses hibernate that takes the taskID
as a paratmeter to update associated status and comments, but my issue is how to do it with multiple records:
private void updateTaskList(Long taskId, String status, String comments) {
TaskList taskList = (TaskList) HibernateUtil.getSessionFactory()
.getCurrentSession().load(TaskList.class, personId);
taskList.setStatus(status);
taskList.setComment(comments);
HibernateUtil.getSessionFactory().getCurrentSession().update(taskList);
HibernateUtil.getSessionFactory().getCurrentSession().save(taskList);
<table border="0" cellpadding="2" cellspacing="2" width="98%" class="border">
<tr align="left">
<th></th>
<th>Employee Name</th>
<th>Status</th>
<th>Comment</th>
</tr>
<%
List result = (List) request.getAttribute("result");
%>
<%
for (Iterator itr=searchresult.iterator(); itr.hasNext(); )
com.dao.hibernate.TaskList taskList = (com.dao.hibernate.TaskList)itr.next();
%>
<tr>
<td> <input type="checkbox" name="taskID" value=""> </td>
<td>
<%=taskList.empName()%> </td>
<td>
<select value="Status">
<option value="<%=taskList.getStatus()%>"><%=taskList.getStatus()%></option>
<option value="New">New</option>
<option value="Fixed">Fixed</option>
<option value="Closed">Closed</option>
</select>
</td>
<td>
<input type="text" name="Comments" MAXLENGTH="20" size="20"
value="<%=taskList.getComments()%>"></td>
</tr>
<%}%>
_________________________________________________________________I solved it by making changes in the occurrence parameter of data type ...:-)
-
Need to update multiple records using store procedure
Hi i am trying to update multiple records using store procedure but failed to achieve pls help me with this
for example my source is
emp_name sal
abhi 2000
arti 1500
priya 1700
i want to increase salary of emp whose salary is less than 2000 it means rest two salary should get update..using stored procedure only
i have tried following code
create or replace procedure upt_sal(p_sal out emp.sal%type, p_cursor out sys_refcursor)
is
begin
open p_cursor for
select sal into p_sal from emp;
if sal<2000 then
update emp set sal= sal+200;
end i;f
end;
and i have called the procedure using following codes
set serveroutput on
declare
p_sal emp.sal%type;
v_cursor sys_refcursor;
begin
upt_sal(p_sal,v_cursor);
fetch v_cursor into p_sal;
dbms_output.put_line(p_sal);
end;
the program is executing but i should get o/p like this after updating
1700
1900
but i am getting first row only
2000
and record is not upsating...please help me with this
thanksHi Alberto,
thanx for your valuable suggestion. but still i have doubt. the code which i have mentioned above might be simple but what if i have big requirement where i need update the data by using loops and conditional statement.
and i have similar kind of requirement where i need to deal with procedure which returns more than one row
my source is
empno ename salary
111,abhi,300
112,arti,200
111,naveen,600
here i need to write a store procedure which accepts the empno (111) as input para and display ename and salary
here i have written store procedure like this
create or replace procedure show_emp_det(p_empno in emp.empno%type, p_ename out emp.ename%type,p_salary out emp.salary%type, p_cursor out sys_refcursor)
is
begin
open p_cursor for
select ename,salary into p_ename,p_salary from emp where empno=p_empno;
end;
and i have called this by using
declare
p_salary emp.salary%type;
p_ename emp.ename%type
v_cursor sys_refcursor;
begin
show_emp_det(111,p_ename,p_salary,v_cursor);
fetch v_cursor into p_ename,p_salary;
dbms_output.put_line(p_ename);
dbms_output.put_line(p_salary);
end;
here i should get
abhi,300
naveen,600
but i am getting first row only
abhi,300
but i want to fetch both rows...pls help me to find the solution -
Update multiple records on one page
I have a page that displays records based on a varible that
is selected on
the previous page.
So on this page i have displaying 3 columns
Store # Allowance Total
They have asked now instead of clicking on each indivual
record to mark it
as completed, they would like to just place a check next to
each one and let
it update those records for that store....
Ex.
Store 20 has a total of 7 records and has an allowance of
$6000.00 then
they would place 1 check mark next to that store and hit
submit and it would
update all 7 records with a status of completed.
I have read thru some not all but some of the example links i
found for
updating multiple records. But they seem more complex than
what im trying to
do. Since this page is populated dynamically how can i code
it so it
understands when there is new stores listed and records.
Is there any links or tutorial that anyone would recommend
that will explain
the process for creating this functionality?My bad....
ASP and Access is what im using DWMX
"bregent" <[email protected]> wrote in
message
news:ei5srh$6uv$[email protected]..
> What scripting model are you using? You may be able to
find a datagrid for
> your model which will simplify this for you. -
Update multiple records from a list
Just trying to find some tutorials on how to update multiple
records from 1
page of checkboxes
easiest example is hotmail
i would like to be able to give my clients the ability to
delete or update
multiple records from 1 page... mind you that this type of
update woudl only
be for simple status changes, flags that need to be changed
and so on...
Delete... well if they made it to this page they are already
sure and have
been warned that they are going to delete the records..
where can i find such a tutorial on how to complete multiple
record updates
or deletes from 1 form...
thanksServer model and software below.
And hotmail has nothing to do with anything.. its an example
of what i would
like to be able to do...
If you log into hotmail. you have the option to check all the
emails you
want to delete.
well thats what i want to do with my clients sites...
Each record would have its own checkbox, they select the
records they want
to delete or update and they hit submit to process there
request.
Using ASP, SQL2005 and DW8
"bregent" <[email protected]> wrote in
message
news:f21upb$nop$[email protected]..
> >Just trying to find some tutorials on how to update
multiple records from
> >1
>>page of checkboxes
>
> What server model?
>
>>easiest example is hotmail
>
> What does hotmail have to do with this. -
Update multiple records on one page php/mysql
Hi folks,
I am trying to adapt a page to offer the option to update multiple records on one page.
The intention is to edit FAQ categories which are contained in a table with just two fields - the category and an id.
The page lists each categories in a form with a submit button which is then repeated for each record in the recordset.
Unfortunately my plan didn't work and only the first record updates as intended.
Can anyone suggest how I can make it work?
Here's the code I have so far.
************** The Update Code *****************
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
if (!isset($mm_abort_edit) || !$mm_abort_edit) {
if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) {
$updateSQL = sprintf("UPDATE faq_categories SET category=%s WHERE id=%s",
GetSQLValueString($_POST['category'], "text"),
GetSQLValueString($_POST['id'], "int"));
mysql_select_db($database_con_mysite, $con_mysite);
$Result1 = mysql_query($updateSQL, $con_mysite) or die(mysql_error());
$updateGoTo = "faq-category-edit.php
if (isset($_SERVER['QUERY_STRING'])) {
$updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?";
$updateGoTo .= $_SERVER['QUERY_STRING'];
header(sprintf("Location: %s", $updateGoTo));
************** Update Code Ends *****************
************** The Form *****************
<form name="frm_editcategory" id="frm_editcategory" method="POST" action="<?php echo $editFormAction; ?>">
<?php do { ?>
<fieldset>
<input name="id" type="hidden" value="<?php echo $row_rs_faqcategory['id']; ?>" />
<input name="category" type="text" class="formrightcolumn" value="<?php echo $row_rs_faqcategory['category']; ?>" />
<input name="save" type="submit" class="submitbutton" id="save" value="save" />
</fieldset>
<input type="hidden" name="MM_update" value="form1" />
<?php } while ($row_rs_faqcategory = mysql_fetch_assoc($rs_faqcategory)); ?>
</form>
************** The Form Ends *****************
Cheers
DaveWhat does debugging tell you? What's the value of each of the variables? Did you try using regular echo statements to monitor what's going on? That's what I always do whenever I am stuck in my PHP coding.
Maybe you are looking for
-
My text tool is not working.
When I try to add text using the text tool the screen turns pink and creates blurry text, or it says there was an error. How do I fix this?
-
Missing thumbnails in Elements 11 Organizer
I am endeavouring to instal Photoshop Elements11 on a new computer which is running Windows 8. It will not download completely, telling me that I need to turn off other Adobe installations - when there are none running. It also will not recognize m
-
Print directly on AS400 (iSeries)
Hello I am using Jasper Report as reporting tool in my web application (using websphere as server). I try to print directly to a printer that is linked with the server. It works without any problem if the server is a PC. But if the server is an AS400
-
Few question about installing Snow Leopard
Hi everyone I just bought Snow Leopard and I want to know before I installing. I have 2 iMacs and 1 MacBook so... Can I installing all 3 macs? Thanks
-
Can my computer handle HD?
Hello everyone! I have FCP 5.1 installed on my PowerMac and I was just curious if people think it can handle HD. I will be capturing HD 1080i footage with a Sony FX1 I have a PowerMac G4 dual 1.25Ghz 1.75GB DDR SDRAM 500/320GB FW800 external drives 3