|
As this is a concurrency problem it's kinda hard pointing out the problem without seeing the whole scenario. However to demonstrate the problem, do the following:
1. Create a test table and insert data into it
CREATE TABLE Test (
a NUMBER PRIMARY KEY NOT NULL
);
INSERT INTO Test VALUES (1);
COMMIT;
2. Now in this session start a transaction and delete the rows. Leave the transaction open
ALTER SESSION SET ISOLATION_LEVEL=SERIALIZABLE;
DELETE FROM Test;
3. Start another session and select data from the test table in serializable mode
ALTER SESSION SET ISOLATION_LEVEL=SERIALIZABLE;
SELECT a FROM Test FOR UPDATE OF a; 4. The session 2 hangs and waits for the result from session 1. Now go back to session 1 and commit the transaction:
COMMIT;
The result in session 2 is:
SELECT a FROM Test FOR UPDATE OF a
*
ERROR at line 1:
ORA-08177: can't serialize access for this transaction
Hopefully this clarifies the problem.
Best regards,
mika
|
|
|
|
|
Let's say I have five sheets in excel workbook,and each sheet contains one table.Is there any way to Import only active sheet to my C#,What should I do to recognize only active sheet.??any help,ideas??
One more thing,How can I get a dato to C# from Excel VBA control(let's say textbox),
So i have vba control textbox in sheet and i want to get that textBox.value in my c# project??
|
|
|
|
|
You've posted in the wrong forum so are unlikely to get an answer: try moving to the C# forum.
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair.
nils illegitimus carborundum
me, me, me
|
|
|
|
|
I've moved,thank you,But I cant delete this message here cuz you replied.
|
|
|
|
|
I wouldn't worry about it: the fact that you've done it is enough.
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair.
nils illegitimus carborundum
me, me, me
|
|
|
|
|
hi..
this is my SP
USE [TASKDB]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[GetCmtRpt]
-- Add the parameters for the stored procedure here
@logid int
AS
BEGIN
SET NOCOUNT ON;
-- Insert statements for procedure here
SELECT Date ,From_Name ,To_Name ,Todays_Task ,Tommorrows_Task ,Status,Comments,Date as months
from TaskSheet inner join
login on TaskSheet .loginID = login.loginID
where login.loginID = @logid
order by Date desc
END
i want to display the months field as jan feb mar based on date how to do...?
|
|
|
|
|
Here it is:
SELECT substring(DATENAME(month, getdate()),1,3) AS MonthName
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
www.aktualiteti.com
|
|
|
|
|
Dear All,
I have a report with a listbox of 5 coloumns, this report is loaded with a lot of records (600 rec). when the report is loads (in print priview) records beyond the length of the listbox are not shown.
how to make the report pages increase (multipage) and the listbox espand automaticaly as much as the number of records ??
Any Report control i can use so i can show all records returned from the query ??
Thanks
0 will always beats the 1.
modified on Wednesday, February 23, 2011 1:23 AM
|
|
|
|
|
hi..
The following is my Sp
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[GettomoTaskSheet]
-- Add the parameters for the stored procedure here
@fname nvarchar(50)
AS
BEGIN
SET NOCOUNT ON;
SELECT date,To_Name ,Todays_Task,Status ,Tommorrows_Task,REPLACE(Comments, 'vinni','<font color="red">raki</font>') as comment
from TaskSheet where From_Name = @fname;
END
The above SP is used for displaying the data in SSRS reports ..
but when i run the SP in comment field where vinni occurs
i want raki in red color but it is displaying <font color="red">raki</font> this value.
i want to display the word raki in red color in ssrs2008 reports
please help me..
|
|
|
|
|
You are putting UI processing in the database query, wrong tool for the job. The data is interpreted as a string literal.
Move your UI code to RSS, there is a function area where you can put in the code to do that.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I am having problems with executing a command object in ADO. The specific problem I have revolves around the proper type for the SQL string. Following examples on the internet, I established it with a _bstr_t. This though is not working with the * VARIANT type that is required in the Execute method. Can someone help me with the proper establishment of the SQL string? Listed below is the complete program:
Here is my error message coming out of the try block:
error C2664: 'ADODB::Command15::Execute' : cannot convert parameter 1 from '_bstr_t' to 'VARIANT *'
1> No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
#include <stdio.h>
#include <string>
using std::string;
int cyc = 0;
#import "c:\program files\common files\system\ado\msado15.dll" rename ("EOF","EOFile")
using namespace std;
struct StartOLEProcess{
StartOLEProcess( ) {
::CoInitialize(NULL);
}
~StartOLEProcess( ) {
::CoUninitialize( );
}
} _start_StartOLEProcess;
void main(void)
{
ADODB::_ConnectionPtr con = NULL;
ADODB::_RecordsetPtr rec = NULL;
ADODB::_CommandPtr com = NULL;
ADODB::_ParameterPtr par = NULL;
bstr_t sConString;
bstr_t sSQLString;
HRESULT hr = S_OK;
VARIANT *vRecordsAffected = NULL;
hr = con.CreateInstance(__uuidof(ADODB::Connection));
hr = com.CreateInstance(__uuidof(ADODB::Command));
hr = par.CreateInstance(__uuidof(ADODB::Parameter));
hr = rec.CreateInstance(__uuidof(ADODB::Record));
printf("Connection object created.\n");
sConString = L"Provider=Microsoft.Jet.OLEDB.4.0;"
L"Data Source=C:\\Users\\Mike Certini\\Documents\\Trading\\Databases\\TradingAnalysis#2.mdb";
hr = con->Open(sConString, L"", L"", -1);
printf("Connection has been opened.\n");
_bstr_t strSQL("INSERT INTO mytable(id,desc)");
com->ActiveConnection = con;
com->CommandText = strSQL;
com->CommandType = ADODB::adCmdStoredProc;
VARIANT vtInt;
int intNum = 1;
vtInt.vt = VT_I2;
vtInt.iVal = intNum;
VARIANT vText;
vText.vt = VT_BSTR;
vText.bstrVal = _bstr_t("This is text");
hr = com->Parameters->Append(com->CreateParameter(_bstr_t("id"),ADODB::adInteger,ADODB::adParamInput,4,intNum));
hr = com->Parameters->Append(com->CreateParameter(_bstr_t("desc"),ADODB::adChar,ADODB::adParamInput,15,vText));
try
{
rec = com->Execute(strSQL, NULL, ADODB::adCmdStoredProc);
}
catch(_com_error &e)
{
_bstr_t bstrSource(e.Source());
_bstr_t bstrDescription(e.Description());
printf("Error\n");
printf("\tCode = %08lx\n", e.Error());
printf("\tCode meaning = %s\n", e.ErrorMessage());
printf("\tSource = %s\n", (LPCSTR) bstrSource);
printf("\tDescription = %s\n", (LPCSTR) bstrDescription);
}
rec->Close( );
rec = NULL;
printf("Closed an removed the "
"Recordset object from memory.\n");
con->Close( );
con = NULL;
printf("Closed and removed the "
"Connection object from memory.\n");
}
|
|
|
|
|
Hi,
Few observations:
- your command type shouldn't be adCmdStoredProc since you're executing a normal DML statement. Use adCmdText instead.
- the SQL statement for insert should contain the VALUES section and the parameters to use, like:
_bstr_t strSQL("INSERT INTO mytable(id,desc) VALUES (?, ?)");
- the execute contains the SQL statement as a parameter. I'm not sure if there's such overload, normally the first parameter is the number of records affected, see: http://msdn.microsoft.com/en-us/library/ms681559(VS.85).aspx[^]
|
|
|
|
|
Mika,
Thank you for your response. After making the changes you suggested I get the following error. Instead of the "Records Affected" parameter, I have input "NULL". As a result, I am getting this error:
Connection object created.
Connection has been opened.
Error
Code = 80040e14
Code meaning = I
Source = Microsoft JET Database Engine
Description = Expected query name after EXECUTE.
|
|
|
|
|
Hi,
Could be some kind of syntax issue in the SQL statement itself. Also if I rememeber correctly the parameter usage in the sql statement may be provider specific so if the SQL statement is otherwise fine could it be because of the question mark. You could try literals as a test n order to see if that's the case.
Also perhaps the following link would help you: http://msdn.microsoft.com/en-us/library/ms677554(v=VS.85).aspx[^]
|
|
|
|
|
Hi Guys!
I am trying to retrieve middle records. The below query is working perfectly.
The problem is my table is too huge (more then 10 lak reocrd) it is taking more time. Is there any other solution?
[This is sample query]
select *
from (select t.*, rownum rn
from (SELECT *
FROM (select * from Productlist)) t
Where rownum <= 10000)
Where rn > 9990
Regards,
Nanda
|
|
|
|
|
Assuming you are using SQL Server, have some Google Foo[^]
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hey Thanks,
Thanks for your valuable reply. I am using Oracle.
The rownum is dynamical assign to each row. so SQL server method is not working.
and I tried view it is working but when order by used the result is coming wrong.
Thanks and regards,
Nanda
|
|
|
|
|
Nanda_MR wrote: I am using Oracle
That would have been useful info, also what is a lak , presumably lots.
So you know how to get the paged set, you real question is how to optimise the query (using rownum) or if there is a better method to use in orable.
And I'm afraid there I cannot help you.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Mycroft Holmes wrote: what is a lak, presumably lots
Indians have a different style of counting big numbers. A lak is one hundred thousand (Indian style: 1,00,000), a crore is ten million (Indian style: 1,00,00,000).
But that's still easy. Stay a few days in India to get confused with more puzzling Indian style information....
|
|
|
|
|
Hi RAH,
I am trying execute my query but it is taking much time(4 to 10 min) to avoid that problem and searching efficient query or solution.
The your last post provide some ideas. it reduce execution time.
Regards,
Nanda
|
|
|
|
|
Mycroft Holmes wrote: also what is a lak
Google would happily have told you ...
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
I naturally did the google thing, the response was nowhere as succinct as the answer I got here
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Unfortunately conciseness isn't Google's primary strength.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
Try...
select * from (
select top 10000 *, row_number() over (order by rownum) as rn
from productlist
) t
where rn between 9990 and 10000
modified on Monday, February 21, 2011 1:26 AM
|
|
|
|
|
Hi
Thanks for Query. It is reduce execution time. but when I try to access above 500000 (Top 500000) records then its taking 2 to 3 min exeuting any other solution.
For if 900000 it is taking 4 to 5 min.
Regards,
Nanda
|
|
|
|