Count of updated rows after an UPDATE command
Hi, is there any way to know how many rows have been updated after an UPDATE statement in a PL/SQL program (i know it is possible in Pro*C. Thanks.
Hi,
it will be stored in sql%rowcount
after your update statement try to assign this to a variable
Update table set ....
v_count := sql%rowcount;
check the value of the variable v_count
Thanks
Ravi
Similar Messages
-
How to count updated rows after an UPDATE?
Is there a way to count updated rows after an update?
Let's say I have an update like
UPDATE table_a
set field_1 = 'new_field'
WHERE field_2 ='some_value' ;
And now I would like to insert an info record into logging table like
INSERT INTO logging_tbl (step, description, changed_rows) VALUES('UPDATE', 'update of table_a', ?);
update is in sqlplus script.
Thanks.
Message was edited by:
br00klynZ00Use SQL%ROWCOUNT.
DECLARE
v_num NUMBER := 0;
BEGIN
UPDATE table_a
set field_1 = 'new_field'
WHERE field_2 ='some_value' ;
v_num := SQL%ROWCOUNT;
INSERT INTO logging_tbl (step, description, changed_rows)
VALUES('UPDATE', 'update of table_a', v_num);
END; -
Count not updating when counting table rows (after adding one)
following this code from this link:
https://social.msdn.microsoft.com/Forums/vstudio/en-US/479cbc96-6ec2-4d9f-b2f8-a2b43a09111e/html-client-dynamically-count-records-in-a-collection-on-browse-screen?forum=lightswitch
I have got my screen to count how many rows are present when the screen first loads. In my scenario I have a add button located on the bottom navigation bar. this opens up a dialog window where the user can add the relevant information. However when the
user hits save, and is navigated back to the browse screen, the count still displays the previous value. If i was to refresh the page it updates but this is not what i am after, when i navigate back i want the value to add by one, am i missing something in
this code?
screen.ExpanderLines.addChangeListener("state", function() {
screen.countExp = screen.ExpanderLines.data.length;
thanks for any helpTry this:
screen.ExpanderLines.addChangeListener("count", function () {
screen.countExp = screen.ExpanderLines.count;
Dave
Dave Baker | AIDE for LightSwitch | Xpert360 blog | twitter : @xpert360 | Xpert360 website | Opinions are my own. For better forums, remember to mark posts as helpful/answer. -
Hi there,
I would like to be able to count updated rows after submitting a page. I'm aware that #MRU_COUNT# does that in success messages, but I don't know how to (or is it even possible) assign that value to a page item, for instance.
(The number of updated rows isn't all that important, I would just like to know if there was a change made or not).
Any help is much appreciated!
Edited by: 893204 on Oct 25, 2011 2:40 PMHi, Chris, thank you for your reply.
I have a report on Employees (Automated Row Fetch).
Editing a row brings up a modal window where I can change employee name, address and so on. I want to be able to know was there any change made to the row when the user clicks Submit.
I hope I made things clearer this time. -
Unable to execute update commands after improper shutdown
Hi!
It sounds a little strange.
I am unable to execute update commands from my application. My machine was shutdown improperly. Then I loaded the datastores again. I was able to execute select commands but unable to execute update commands. It was working fine before shutdown.
Regards
/AhmadHi Chris!
SQLExecute method of ODBC is returning -1.
I have checked the syntax of the query its also correct. I am also very confused on it why is this happening. If I execute the update command from ttisql it works ok.
The code is the same that we discussed in our previous conversation.
The steps I did after improper shutdown:
1. Started TimeTen daemon >ttdaemonadmin -start
2. Loaded the Data store >ttAdmin -ramLoad spiderM
3. Executed the code
The output of ttstatus is as follows:
TimesTen status report as of Fri Jun 29 21:45:41 2007
Daemon pid 8273 port 17001 instance tt70
TimesTen server pid 8284 started on port 17003
TimesTen webserver pid 8280 started on port 17005
Data store /tmp/spiderM
There are 6 connections to the data store
Data store is in shared mode
Shared Memory KEY 0x08004f3c ID 557070
Type PID Context Connection Name ConnID
Subdaemon 8278 0x0000000000570520 Worker 2042
Subdaemon 8278 0x00000000005dc4d0 Flusher 2043
Subdaemon 8278 0x000000000060d5d0 Checkpoint 2044
Subdaemon 8278 0x000000000063e5a0 Aging 2045
Subdaemon 8278 0x000000000066f570 HistGC 2046
Subdaemon 8278 0x00000000006a0430 Monitor 2047
RAM residence policy: Manual
Data store is manually loaded into RAM
Replication policy : Manual
Cache agent policy : Manual
Data store /usr/users/spider/TimesTen/tt70/info/TT_tt70
There are no connections to the data store
Replication policy : Manual
Cache agent policy : Manual
Access control enabled.
End of report
Regards
/Ahmad -
Update command in Shell script
Hi friends
sqlplus -s / <<END
set feedback on;
update tran2 set sno=1;
exit;
END
when i am using update command in shell script like above
it is updating the database well...but i just want to know how many rows it is updating and i dont want to commit
for that
sqlplus -s / <<END
set feedback on;
update tran2 set sno=1;
set feedback off;
rollback;
exit;
END
It's working fine
is there any other method to do the sameWell what's exactly your requirement? The current requirement doesn't make a lot of sense.
How many row is going to be updated depends on where clause, if you have no where clause that essentially updating whole table, the number of row updated is count of your rows. -
Update command in When-button-pressed.
Hello OTN members,
I have the following situation :
Take an eg.
There are two forms, the first form takes the fiedls such as EMP
NAME, ADDRESS AND DEPT. This record generates a Empid from the
sequence.
The second form selects the empid from the LOV, and other fields
such as Emp Salary, Commission and Bonus Rate(from the same
table) are entered. When a Button is pressed, it should update
the record with the above values where empid in the table is
equal to the empid in this forms first field.
I tried as below in when_button_pressed trigger::
UPDATE EMP SET SALARY = :EMP_BLOCK.SALARY,
COMMISSION = :EMP_BLOCK.COMMISSION etc
where
EMPID = :EMP_BLOCK.EMPID;
The above statement does not update the record in the table.
If there is any other approach for the above please suggest.
Thanks in advance.
Sailesh.
nullHallo,
you can check the number of updated row with the system variable
SQL%ROWCOUNT. So if your where condition doesnt match any rows,
no rows will be updated and also no error message will be
generated. In this case SQL%ROWCOUNT contains 0 after the update
command.
other idea: make surte to commit your changes before querying
the record from another sessuion!
Sailesh (guest) wrote:
: Hello OTN members,
: I have the following situation :
: Take an eg.
: There are two forms, the first form takes the fiedls such as
EMP
: NAME, ADDRESS AND DEPT. This record generates a Empid from the
: sequence.
: The second form selects the empid from the LOV, and other
fields
: such as Emp Salary, Commission and Bonus Rate(from the same
: table) are entered. When a Button is pressed, it should update
: the record with the above values where empid in the table is
: equal to the empid in this forms first field.
: I tried as below in when_button_pressed trigger::
: UPDATE EMP SET SALARY = :EMP_BLOCK.SALARY,
: COMMISSION = :EMP_BLOCK.COMMISSION etc
: where
: EMPID = :EMP_BLOCK.EMPID;
: The above statement does not update the record in the table.
: If there is any other approach for the above please suggest.
: Thanks in advance.
: Sailesh.
null -
Hi all
I am going migration from 2003 server(10gR2) to 2008 server(11gR2) with goldengate 11.1.1.1.2
while i am trying to update a row it is not replicating on the target. At first it gave me an error but later when i tried by giving alter replicat begin now command it worked, but again when i give the update command it is not even giving me an error and replicat is not abended , no replication
My discard file looks like this:
Oracle GoldenGate Delivery for Oracle process started, group REP1 discard file opened: 2012-05-23 11:34:49
Current time: 2012-05-23 11:36:53
Operation failed at seqno 0 rba 2614
Discarding record on action DISCARD on error 1403
Problem replicating SAM.SAMPLE to SAM.SAMPLE
Record not found
Mapping problem with compressed key update record (target format)...
ID = 1
NAME = NULL
ID = 2
NAME = NULL
my replicat file:
REPLICAT REP1
USERID ggt_sys PASSWORD ggt_sys
DISCARDFILE c:/goldengate/dirdat/rep1.dsc, append, megabytes 10
REPERROR default, discard
ASSUMETARGETDEFS
DDL INCLUDE ALL
DDLERROR DEFAULT IGNORE RETRYOP
MAP SAM.*, TARGET SAM.*;
I tried by cleaning the tables and by recreating the parameters. Source and table structure is same. Insert,create, delete are working fine..
thanks in advance..Hi amardeep!!
GGSCI (pdkbgisordev2k3) 252> stats ext1
Sending STATS request to EXTRACT EXT1 ...
Start of Statistics at 2012-05-23 14:08:37.
DDL replication statistics (for all trails):
*** Total statistics since extract started ***
Operations 30.00
Mapped operations 2.00
Unmapped operations 28.00
Other operations 0.00
Excluded operations 28.00
Output to /goldengate/dirdat/lt:
Extracting from GGS_SYS.GGS_MARKER to GGS_SYS.GGS_MARKER:
*** Total statistics since 2012-05-23 11:35:40 ***
No database operations have been performed.
*** Daily statistics since 2012-05-23 11:35:40 ***
No database operations have been performed.
*** Hourly statistics since 2012-05-23 14:00:00 ***
No database operations have been performed.
*** Latest statistics since 2012-05-23 11:35:40 ***
No database operations have been performed.
Extracting from SAM.SAMPLE to SAM.SAMPLE:
*** Total statistics since 2012-05-23 11:35:40 ***
Total inserts 3.00
Total updates 2.00
Total deletes 1.00
Total discards 0.00
Total operations 6.00
*** Daily statistics since 2012-05-23 11:35:40 ***
Total inserts 3.00
Total updates 2.00
Total deletes 1.00
Total discards 0.00
Total operations 6.00
*** Hourly statistics since 2012-05-23 14:00:00 ***
Total inserts 0.00
Total updates 1.00
Total deletes 0.00
Total discards 0.00
Total operations 1.00
*** Latest statistics since 2012-05-23 11:35:40 ***
Total inserts 3.00
Total updates 2.00
Total deletes 1.00
Total discards 0.00
Total operations 6.00
Extracting from SAM.SAMPLE1 to SAM.SAMPLE1:
*** Total statistics since 2012-05-23 11:35:40 ***
Total inserts 1.00
Total updates 1.00
Total deletes 0.00
Total discards 0.00
Total operations 2.00
*** Daily statistics since 2012-05-23 11:35:40 ***
Total inserts 1.00
Total updates 1.00
Total deletes 0.00
Total discards 0.00
Total operations 2.00
*** Hourly statistics since 2012-05-23 14:00:00 ***
Total inserts 1.00
Total updates 1.00
Total deletes 0.00
Total discards 0.00
Total operations 2.00
*** Latest statistics since 2012-05-23 11:35:40 ***
Total inserts 1.00
Total updates 1.00
Total deletes 0.00
Total discards 0.00
Total operations 2.00
I don`t think it is capturing, because when I issue insert statement I see message in the capture and also on delivery in target, but when I issue update statement I don`t see anything in the capture..
thanks -
"Some updateing commands could not be generated ....." error
Hi all,
I am accessing an Oracle server on which I have READ ONLY rights. I am trying to create a DataSet. When I do so, I get an error:
Some updating commands could not be generated automatically. The database returned the following error:
This object has been deleted.
1) Is this just because my access is readonly?
2) A different message might be preferred ("code to submit updates was not created due to limited user rights" or some such.
3) Can I use this even with the error or will I have other problems because the process did not complete correctly?
Thanks,
JustMeCan't remember how I solved this, but it is solved.
-
Update Command is not working.
Hi,
There are 15 fields in the database table. The first 5 fields are set as primary keys. In the table, only the first field has got unique values. In the next 4 primary keys the values are getting repeated.
Now, i am trying to modify the 10th field using Update Command.
I have written the below command.
Updated ZOMT_PROCESS using WL_INITIAL_VALUES.
The record is not getting modified in the database table with the values of the work area WL_INITIAL_VALUES.
What could be the problem?Hi,
Move all the modifiable work area fields to an Internal table and modify the ztable.
Use the following syntax
LOOP AT i_selected_rows INTO w_selected_rows.
READ TABLE itab INTO wa INDEX w_selected_rows-index.
IF sy-subrc EQ 0.
MOVE-CORRESPONDING wa TO w_modified.
APPEND w_modified TO i_modified.
ENDIF.
ENDLOOP.
MODIFY zzzmaterial FROM TABLE i_modified.
Regards
Bala Krishna -
Is there any Update command in MDX query
My situation is follows:<BR><BR><BR> Jan-2005 Brands Products Sales <BR>Bill:20001-ABC 100<BR>Bill:20001-XYZ 20<BR> Customers<BR><BR>Is there any way where i can delete the member "Bill:20001-XYZ" and add the value 20 into<BR>"Bill:20001-ABC" so that it becomes<BR><BR><BR> Jan-2005 Brands Products Sales <BR>Bill:20001-ABC 120<BR> Customers<BR><BR><BR>Is there any update command introduced in MDX query which would resolve the above issue?.
In it's current incarnation, Essbase MDX can't do this, I believe it is coming in a future release, but I wouldn't expect it too soon, maybe within a year. There are others that can provide more insight if and when it will be available.<BR><BR>By the way, I'm assuming this is an Aggregate Storage Database. If it were a Block Storage database, there would be a couple of different ways to do this (Calc script, lock & send via spreadsheet)<BR><BR>
-
UPDATE command syntax for mulitple checkbox update
Hi,
I intend update the checkboxes by id in bulk.
My table is below. I want to update the selected form_id
checkboxe and their
values accordingly. That, I click the checkboxes (containin
form_id
information) of 1, 3, and 6; and I check their respective
fields for column
check01 and check02.
form_id check01 check02
1 1 0
2 0 1
3 0 0
4 1 1
5 1 1
6 1 0
I am using below code for deleting. I can do insert into. But
I could not
figure out the correct syntax for UPDATE command similar to
below example.
Sample for deleting:
DELETE FROM ADS
WHERE AD_ID IN (varCheckBox)
Thank you
HakanCheck here for SQL UPDATE syntax..
http://www.w3schools.com/sql/sql_update.asp
Regards,
..Trent Pastrana
www.fourlevel.com
"Hakan834" <[email protected]> wrote in message
news:e9tdd8$ppk$[email protected]..
> Hi,
>
> I intend update the checkboxes by id in bulk.
>
> My table is below. I want to update the selected form_id
checkboxe and
> their values accordingly. That, I click the checkboxes
(containin form_id
> information) of 1, 3, and 6; and I check their
respective fields for
> column check01 and check02.
>
> form_id check01 check02
> 1 1 0
> 2 0 1
> 3 0 0
> 4 1 1
> 5 1 1
> 6 1 0
>
> I am using below code for deleting. I can do insert
into. But I could not
> figure out the correct syntax for UPDATE command similar
to below example.
>
> Sample for deleting:
> DELETE FROM ADS
> WHERE AD_ID IN (varCheckBox)
>
>
> Thank you
>
> Hakan
> -
Delete Command button doesn't take more than one parameter while update command does
Hi,
Does anybody have an idea WHY sharepoint does not send the parameter information to a delete command while the exact same parameter is being sent to the Update command?, the data is being pulled from an asp:TextBox bound to the 'comments' field in
the data source which happens to be the field I need to update, the code works for Update commands but not for Delete commands. Unfortunately I have to use sharepoint designer because SP is restricted at work, so I can't write code behind the scenes. I would
appreciate any help, here's my code
<%@ Page Language="C#" masterpagefile="../_catalogs/masterpage/v4.master" title="Test" inherits="Microsoft.SharePoint.WebPartPages.WebPartPage, Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" meta:progid="SharePoint.WebPartPage.Document" meta:webpartpageexpansion="full" %>
<%@ Register tagprefix="SPSWC" namespace="Microsoft.SharePoint.Portal.WebControls" assembly="Microsoft.SharePoint.Portal, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register tagprefix="cc2" namespace="Microsoft.SharePoint.WebControls" assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register tagprefix="WebUI" namespace="Microsoft.Office.InfoPath.Server.Controls.WebUI" assembly="Microsoft.Office.InfoPath.Server, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register tagprefix="WebPartPages" namespace="Microsoft.SharePoint.WebPartPages" assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<asp:Content id="Content1" runat="server" contentplaceholderid="PlaceHolderMain">
<asp:SqlDataSource runat="server" ProviderName="System.Data.SqlClient" UpdateCommand="sp_updateStartedApprovals" ID="SqlDataSource2" ConnectionString="Data Source=MCARLOSJ2;User ID=sa;Password=****;Initial Catalog=MyDB;" SelectCommand="SELECT * FROM mainView " __designer:customcommand="true" UpdateCommandType="StoredProcedure" DeleteCommand="sp_rejectApprovals" DeleteCommandType="StoredProcedure">
<UpdateParameters>
<asp:Parameter Name="comments" Type="String"/>
<asp:parameter Name="id" Type="Int32" />
</UpdateParameters>
<DeleteParameters>
<asp:Parameter Name="comments" Type="String"/>
<asp:parameter Name="id" Type="Int32"/>
</DeleteParameters>
</asp:SqlDataSource>
<asp:GridView runat="server" id="GridView1" AutoGenerateColumns="False" DataSourceID="SqlDataSource2" DataKeyNames="id" GridLines="None" ForeColor="#333333" CellPadding="4">
<RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
<Columns>
<asp:boundfield DataField="description" HeaderText="Status" ReadOnly="True" SortExpression="description">
</asp:boundfield>
<asp:boundfield DataField="Employee Last Name" HeaderText="Employee Last Name" ReadOnly="True" SortExpression="Employee Last Name">
</asp:boundfield>
<asp:boundfield DataField="Employee First Name" HeaderText="Employee First Name" ReadOnly="True" SortExpression="Employee First Name">
</asp:boundfield>
<asp:boundfield DataField="Pending approval" HeaderText="Pending approval" ReadOnly="True" SortExpression="Pending approval">
</asp:boundfield>
<asp:boundfield DataField="Atnmt %" HeaderText="Atnmt %" ReadOnly="True" SortExpression="Atnmt %">
</asp:boundfield>
<asp:boundfield DataField="Country" HeaderText="Country" ReadOnly="True" SortExpression="Country">
</asp:boundfield>
<asp:boundfield DataField="comments" HeaderText="comments" ReadOnly="True" SortExpression="Comments">
</asp:boundfield>
<asp:boundfield DataField="processStartedDate" DataFormatString="{0:MM/dd/yyyy}" HeaderText="Date Opened" ReadOnly="True" SortExpression="processStartedDate">
</asp:boundfield>
<asp:boundfield DataField="Due Date" DataFormatString="{0:MM/dd/yyyy}" HeaderText="Due Date" ReadOnly="True" SortExpression="Due Date">
</asp:boundfield>
<asp:templatefield>
<ItemTemplate>
<asp:TextBox runat="server" id="comments" Text='<%# Bind("comments") %>'/>
<asp:LinkButton runat="server" Text="Approve" id="Button1" CommandName="Update" CausesValidation="False" />
<asp:LinkButton runat="server" Text="Reject" id="Button2" CommandName="Delete" CausesValidation="false"/>
</ItemTemplate>
</asp:templatefield>
</Columns>
<FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<PagerStyle HorizontalAlign="Center" BackColor="#284775" ForeColor="White" />
<SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
<HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<EditRowStyle BackColor="#999999" />
<AlternatingRowStyle BackColor="White" ForeColor="#284775" />
</asp:GridView>
</asp:Content>Hi,
you have multiple options here:
1) upload as a script:
a) save the statements in a file
b) go to sql workshop > sql scripts
c) upload script and run the script
2) run the script line by line in the sql commands window directly:
a) go to sql workshop > sql commands
b) copy all statements there
c) highlight the first statement with the mouse
d) click "run" or press <ctrl>+enter
3) use sql developer
a) go to http://www.oracle.com/technology/products/database/sql_developer/index.html
b) download and install
c) connect to XE
d) run the statements there
Regards,
~Dietmar. -
Command Builder Update Command Algorithm
Dear Sirs,
When setting the update command of a sqldataadapter control, I use the following syntax :
Dim cbsql As SqlCommandBuilder
cbsql = New SqlCommandBuilder(dataadapter)
The generated update command is a syntax of parametric variables.
I would like to know what algorithm does the command builder use to generate the updatecommand.Why do you want to know?
It's been a while since I've seen a better and more detailed explanation than msdn
https://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlcommandbuilder(v=vs.110).aspx
https://msdn.microsoft.com/en-us/library/tf579hcz(v=vs.110).aspx
Loosely speaking you can think of it as taking each of the records that have changes and allocating the right command ready (to be applied later) for each of them.
It looks at each record and decides if it's changed. Whether a record has been updated, added or deleted.
If no command is provided, reflection is used (once) to build the sql for each of these.
It allocates the update sql to the updates, insert to the additions and update sql to the updates.
The specific record to apply the change to is identified by primary key. No primary key is a problem !
If you wanted to take a look at the sql a command generated there are the various get... command methods.
connection.Open();
SqlCommandBuilder builder = new SqlCommandBuilder(adapter);
DataSet dataSet = new DataSet();
adapter.Fill(dataSet, tableName);
SqlCommand cmd = builder.GetUpdateCommand();
string aSQLstring = cmd.CommandText;
Hope that helps.
Recent Technet articles:
Property List Editing ;
Dynamic XAML -
I got the message to update Command-C but every time I get the message: "Er heeft zich een fout voorgedaan tijdens het kopen".
I have the App already for a long time.
What is the problem and how can I reset it.
ThanksAt the top of your script add the following:
set echo on -
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?
>
>
Maybe you are looking for
-
Backing up and restoring to another computer
Before upgrading to 10.5.7, I was able to back up iCal on one computer, then restore it on another computer so I would have a duplicate just in case. Now it won't do it at all. Both iCal versions 3.0.7 are the same on both computers. I'm starting to
-
Gurus, How do I get the cost center active/inactive status? I am currently creating an interface of SAP to another system. The status of the cost center is required. I check t-code: OKENN but can not trace which table the status is maintained. Thanks
-
Dynamic re-scoping of default logic
Hi all, I'm hoping someone can help on this logic problem -- BPC 5.1 SP5 on SQL 2005. My sales planning application has a dimension SKU with 20,000 members, in a very well structured hierarchy. Each SKU is at level 6, and the profit centers are at le
-
Oracle forms 6i hangs while connection to database
Hi, We are runing oracle forms 6i with patch 17 on windows xp and windows 7 with oracle database 10g(10.2.0.4) 64bits on window 2003 64bits every thing is fine but sometime all of the sudden connection get stuck and unable to get access to database b
-
Photoshop elements 11 shared technologies error
I am trying to download my photoshop elements 11, but shared technologies error continues to pop up and does not allow the installation? Are there any solutions to this issue?