|
The solution is to use the decimal separator as a decimal separator, and not as a separator for arguments.
select * from table where col in ('1,2,3,4')
Now, if you want to use four decimals in that place, you'd use the English notation;
select * from table where col in ('1.2,2.9,3.83,4.0')
It's a good idea to keep the database culture-agnostic, and to format the decimal just before displaying. That means that each number is treated internally like we're in England, and that everything that gets displayed is formatted from that generic English form into the current culture.
I are Troll
|
|
|
|
|
Thanks Eddy
But my problem is some thing different
the col field is nvarchar and now i want to use it in IN query. There is no floating point here. then what will be the query it all values in the column are in integers. How can i put them in IN query.
Any idea about that.
Thanks
Syed Shahid Hussain
|
|
|
|
|
Syed Shahid Hussain wrote: How can i put them in IN query.
My apologies, there was another error that I missed. The arguments after the IN operator are summed within a varchar (a string), and SQL expects a list of items, not a string. It tries to convert the entire string to the datatype of "col".
This code should run fine, even when the locale is Norsk;
SET LANGUAGE 'Norwegian'
DECLARE @myTable AS TABLE ( id INT)
INSERT INTO @myTable VALUES(1)
INSERT INTO @myTable VALUES(2)
INSERT INTO @myTable VALUES(3)
INSERT INTO @myTable VALUES(4)
SELECT * FROM @myTable WHERE id IN (1,3) As you can see, the arguments in the select -list are separated by comma's (allowed, since they're not decimals) and there are no quotes (indicating multiple values to check against, as opposed to a single varchar value)
That would translate to your query like this;
select * from table where col in (1, 2, 3, 4)
Or for decimals;
select * from table where col in (1.2, 3.89)
Make sure that the datatype of col matches the datatype of the values that you put after the IN operator
I are Troll
|
|
|
|
|
Thanks a lot
its for you
Syed Shahid Hussain
|
|
|
|
|
Thanks
|
|
|
|
|
Bah...at first glance I thought this was unanswered....in any case, drop the '' inside your IN and give it a list of separate values - sounds like that's already fixed ya right up...
-Dave
|
|
|
|
|
Hi All,
I have developed an application using C# WinApp VS 2005 and MYSQL 5.0.1. My Query is it
possible by any means that I can create a setup application that can identify and install MySQL
Server on the deployment machine if its not installed on it. Also it will run the script file to create
database and user into MySQL Server. I have done some googleing but was unable to find
appropriate answer. Can it be done using InstallShield? If so, How to do it?
Its very urgent.
Please Help me.
Thanx in Advance,
Regards,
Paramhans Dubey
|
|
|
|
|
Hi Paramhans,
I'm also facing the same problem.
If you get the solution pleaseeeeeeee let me know.
agarwal.vineeta@yahoo.com
Thanks
Vineeta
|
|
|
|
|
When you are deploying any project then you can specify the prerequisites for that project. Here Mysql 5.1 is the prerequisite of your application. VS provides some default prerequisites. If you don't find the required one there then you can create custom prerequisite and include it there.
|
|
|
|
|
HI Nisha,
Thanx for your reply. Can you please tell me how to create custom Prerequisite and How to include it with the setup.
Please guide me.
Thanks again.
|
|
|
|
|
|
Thanks Nisha my problem is solved now.
|
|
|
|
|
I am facing the same problem plz send me the solution on my mail address
abdullah555@yahoo.com
|
|
|
|
|
Hi,
I am having two table which are related with primary and foreign key constraints. I want to delete records from both the tables using innerjoin.
I applied like this,
delete sports,studentregtable
from studentregtable as sr
INNER JOIN sports sp ON sr.registerNo = sp.RegisterNumber
where RegisterNumber = '123'
but it is giving an error like incorrect syntax near ",".
can you please help me if you know the solution.
|
|
|
|
|
You have to delete from each table separately. Try the following
delete from studentregtable where registerNo = '123';
delete from sports where RegisterNumber = '123';
Chris Meech
I am Canadian. [heard in a local bar]
In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]
|
|
|
|
|
If one of the tables has a foreign refencing the other table, start with the table with the foreign key.
|
|
|
|
|
If this is SQL Server, you can specify to cascade deletes when you create the foreign key constraint. Then, you can delete from the parent table and the database will automatically delete the corresponding rows from the child table.
Personally, I don't like this because it makes me feel as if I'm not in control and I get nervous when the DBMS does things behind my back like that. But some people swear by it, so YMMV.
Sybase and DB2 both have this same cascade ability on a foreign key; not sure about Oracle but I guess it probably does.
|
|
|
|
|
Yes, it does.
|
|
|
|
|
I'm in the process of starting a new application, mainly for the Desktop, but multi-user ready, about 10 users, using VB.NET and Winforms. What do you thing is the DB engine to choose ? Msaccess, SQL Server Express, MySQL, or other ? Your opinion is welcome.
|
|
|
|
|
Member 3108667 wrote: but multi-user ready, about 10 users
I would go for SQL Server (Express). This gives you the chance to extend your application to n folds in future with no effort in programming and by just changing the express version to the proper SQL Server.
Hope this helps.
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
I used TDE Certificate for my database.... Later I disabled the encryption.. But, anyhow, I cannot able to restore the database to another server.... Problem is still the log file is using the certificate... How to remove the certificate completely...
Plz Anybody Help me!!!!!!!!!!
|
|
|
|
|
In SSRS using Local Processing Mode .
I Have A situation Like This.
I need to Select a value from ddl depending on the selection i need to display the report
I have Done This Using Datasource and without using any parameters in Report
The Below Link Is Only For Demo Purpose
http://220.227.91.180:81/ReportsDemo/ReportWithParameters.aspx[^]
I used Datasource but not parameters .
How to Use It By Using Parameters?
If It Helps Click It as Answer
|
|
|
|
|
Hello,
I'm doing a program in C # and i need to extract an rtf field of firebird database .Na fact the field is a string, but I think the field is a document rtf that was encoded and inserted through language delfi.
Under a piece of the field:
{\rtf1\ansi\deff0\deftab254{\fonttbl{\f0\fnil\fcharset0 Times New Roman;}{\f1\fnil\fcharset0 Arial;}{\f2\fnil\fcharset0 Arial Unicode MS;}{\f3\fnil\fcharset0 Tahoma;}{\f4\fnil\fcharset1 Cambria Math;}{\f5\fnil\fcharset238 Times New Roman CE;}{\f6\fnil\fcharset204 Times New Roman Cyr;}{\f7\fnil\fcharset161 Times New Roman Greek;}{\f8\fnil\fcharset162 Times New Roman Tur;}{\f9\fnil\fcharset177 Times New Roman (Hebrew);}{\f10\fnil\fcharset178 Times New Roman (Arabic);}{\f11\fnil\fcharset186 Times New Roman Baltic;}{\f12\fnil\fcharset163 Times New Roman (Vietnamese);}{\f13\fnil\fcharset238 Arial CE;}{\f14\fnil\fcharset204 Arial Cyr;}{\f15\fnil\fcharset161 Arial Greek;}{\f16\fnil\fcharset162 Arial Tur;}{\f17\fnil\fcharset177 Arial (Hebrew);}{\f18\fnil\fcharset178 Arial (Arabic);}{\f19\fnil\fcharset186 Arial Baltic;}{\f20\fnil\fcharset163 Arial (Vietnamese);}{\f21\fnil\fcharset0 Lucida Sans Unicode;}}{\colortbl\red0\green0\blue0;\red255\green0\blue0;\red0\green128\blue0;\red0\green0\blue255;\red255\green255\blue0;\red255\green0\blue255;\red128\green0\blue128;\red128\green0\blue0;\red0\green255\blue0;\red0\green255\blue255;\red0\green128\blue128;\red0\green0\blue128;\red255\green255\blue255;\red192\green192\blue192;\red128\green128\blue128;\red0\green0\blue0;}\wpprheadfoot1\paperw11906\paperh16838\margl0\margr0\margt10\margb0\margh720\margf720{\*\pnseclvl1\pnucrm\pnstart1\pnhang\pnindent720{\pntxtb}{\pntxta{.}}}
{\*\pnseclvl2\pnucltr\pnstart1\pnhang\pnindent720{\pntxtb}{\pntxta{.}}}
{\*\pnseclvl3\pndec\pnstart1\pnhang\pnindent720{\pntxtb}{\pntxta{.}}}
{\*\pnseclvl4\pnlcltr\pnstart1\pnhang\pnindent720{\pntxtb}{\pntxta{)}}}
{\*\pnseclvl5\pndec\pnstart1\pnhang\pnindent720{\pntxtb{(}}{\pntxta{)}}}
{\*\pnseclvl6\pnlcltr\pnstart1\pnhang\pnindent720{\pntxtb{(}}{\pntxta{)}}}
{\*\pnseclvl7\pnlcrm\pnstart1\pnhang\pnindent720{\pntxtb{(}}{\pntxta{)}}}
{\*\pnseclvl8\pnlcltr\pnstart1\pnhang\pnindent720{\pntxtb{(}}{\pntxta{)}}}
{\*\pnseclvl9\pndec\pnstart1\pnhang\pnindent720{\pntxtb{(}}{\pntxta{)}}}
\endnhere\sectdefaultcl{\header \pard{\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs24\cf0 \par
}{\*\wptable\tblleft2000 Tab1}{\pard\trowd\trgaph0\trleft2000\cellx5302\cellx8604\cellx11906\intbl{\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs24\cf0 \cell}
\intbl{\qc\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs24\cf0 \line \line \line \line \cell}
\intbl{\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs24\cf0 \cell}\row
}\pard{\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs24\cf0 }}
{\footer \pard{\ql\li1000\fi0\ri0\sb0\sl\sa0 \plain\f0\fs24\cf0 }}...
So if anyone knows any way to extract this data in C # would much grateful.I would more much grateful if you do the conversion of this field to a word document.
|
|
|
|
|
It looks, feels and smells like a string containing RTF codes; why wouldn't you just get it like any other string field and either assign it to a RichTextBox.Rtf, or write it to a file (preferably with extension .rtf)?
Luc Pattyn
Have a look at my entry for the lean-and-mean competition; please provide comments, feedback, discussion, and don’t forget to vote for it! Thank you.
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
Hi,
I have to shift my database from Sql Server Management Studio 2008 to MsAccess 2007 database.
SSMS is not supporting .accdb extention (asking for .mdb extention) whereas my Access has .accdb extention.
How can i export the database?
Any procedure to convert from .mdb to .accdb in SSMS or .accdb to .mdb in Access.
After googling a lot i tried creating DNS (i don't know its purpose), but is not working.
Thanks in advance.
modified on Monday, September 21, 2009 1:27 PM
|
|
|
|