SEARCH YOUR SOLUTION HERE  

Compare two string objects to display data

People, Iam accessing an oracle database to get a value from atable (varchar), this value is always astring of numbers separated by a coma EXAMPLE:12,39,10,14 each number representing an event category inthe database,once i get that value i have to compare it to a string valueinput by user in myweb application, (user input as string), finally i have to display only the events that match both strings values.
Example: event category: 10,15,16,101,39 user input: 09,10,25,16 result: only events which categories are 10 and 16 must be display.Matching categories Connection to database is perfectly working, i am able to extract the stringvalue from the database.

Posted On: Wednesday 21st of November 2012 02:36:40 AM Total Views:  315
View Complete with Replies




Related Messages:

DB compare utility   (128 Views)
Any recommendation of a free db utility for comparing objects and number of rows in the tables between 2 schema
compare schema   (82 Views)
Does Oracle provide any tool to compare database schema My migration from SQL Server to Oracle went OK, but I still need to make sure that everything that supposed to be there are there. It's a pain to check everything by hand, so I'd like to check if there is any tool available to help.
Script to compare two databases physical structure   (98 Views)
Anybody has a shell script or PERL script to compare physical structure of two databases (db1 and db2) The script should take two arguments (db1 and db2) and compare datafiles and their sizes and display the differences. I am assuming here the mount points are same on two servers and these databases are on two different servers (say for example, production database on one server and standby database on another). I need this script to check any differences between production and standby and email on call DBA to notify the differences, so that we keep both in sync as fast as possible and avoid any delay in applying transactions to standby. Oracle 8.1.7.x and 9.0.1.x/9.2.0.x on Compaq Tru64 Ver 5.1.
Problem with compare DateTime format in C# with Oracle Date datatype!   (131 Views)
, I try to search records in Oracle table that contain a ORDER_TIME with Oracle Data datatype. I have two DatePicker that having the value as following: DateTime dtStartDate, dtEndDate; dtStartDate = 8/1/2011 12:00:00 AM; dtEndDate = 10/30/2011 12:00:00 AM; I try to build the query to search for data between two dates as bellowed: =============================================================================================== SELECT * FROM tableA WHERE ORDER_TIME between to_date('8/1/2011 12:00:00 AM', 'mm/dd/yyyy') AND to_date('10/30/2011 12:00:00 AM, 'mm/dd/yyyy'); =============================================================================================== This above query have no returned results eventhough the data there. I got dtStartDate and dtEndDate values automatically but hard code for above values for easy seeing it's date format. If I ran the query directly from Oracle editor, it will display error due to mismatch datatype. If I modify above query as following, it will return the records SELECT * FROM tableA WHERE ORDER_TIME between to_date('8/1/2011', 'mm/dd/yyyy') AND to_date('10/30/2011', 'mm/dd/yyyy'); Is it anyway to convert datetime long string 1/8/2011 12:00:00 AM to short string such 1/8/2011 I am newbie to work on Oracle date format, so I really get stuck on it.Please show me the way either converting format date at front end or back end to get the query working.
How to compare a value to Mysql statement   (85 Views)
Hi all, I have a Myql stetment in in an ASP.NET 3 page which I'm trying to compare a value. This is the value and code that I need to compare (value is artist): Dim dv2 As New Data.DataView dv2 = CType(DS1.Select(DataSourceSelectArguments.Empty), Data.DataView) Dim dr2 As Data.DataRowView = dv2(0) Dim thetitle2 As String = CStr(dr2("artist")) This is the select statement in MySql: selectcommand="SELECT topic, artist FROM news WHERE artist like"what do I need to put here"order by id desc limit 15" My problem is that I don't know what to write after the LIKE in order to compare the value to the database I tried everything I could think of but nothing works.
how to compare two datatables and how to perform insert and delete operations according to the matched or unmatched values.   (208 Views)
hi i have 2 datatables one contains gridview datakey vlaues and other table contains database values of applicationid in dataset. my intention is to implement the logic like after comparing two table values if any value is present in gridview values and not present in database then it needs to insert one value in database, in reverse case it needs to delete value from database.like gridviewvalues databasevalues result if present not present insert values into database if not present present delete values from database. if present present nothing to do if not present not present nothing to do here is my coding logic is not working properly.and roleid, applicationid is composite key in database: OracleDataAdapter da3 = new OracleDataAdapter(); OracleCommand selectCommand4 = new OracleCommand("Select applicationid from roleprivileges where roleid=:roleid", newConnection); selectCommand4.Parameters.Add(new OracleParameter(":roleid", OracleType.Number, 5)); selectCommand4.Parameters[":roleid"].Value = rid; da3.SelectCommand = selectCommand4; DataSet ds2 = new DataSet(); da3.Fill(ds2); ArrayList appsArrayList = new ArrayList(); foreach (DataRow row in ds2.Tables[0].Rows) { appsArrayList.Add(row); } int dbcount = 0; for (int index = 0; index
query db1, compare with db2 then update db2 with new records found in/ from db1   (271 Views)
hello, there, i am new to .net/c# i was assigned to query a set from db1 and compare with db2 and update db2 on what it does not contain. ( the new records from db1) any ideas these are the steps i can think of . please let me know if i am missing a step dont know how to start this but i hope this is the place. thanks Again 1. Database1 2. Query current database 3. Compare with database2 (If database2 contains new data) 4. Update database2 Development tools C# Oracle VS 2005
MySQL Schema compare tool   (88 Views)
Im looking for a good tool that compares mysql schemas and allows you to generate a sql file that willwrite those updates to the target without the use of the tool itself.
Tool to compare databases   (193 Views)
We have 2 dbs, one is a dev db and another is a db at customer site. We have made some changes to some of the tables on dev db (like add columns, drop columns, add new tables and so on). Now we want to propagate those changes to the customer site. What is the best way of doing this Is there a tool available that I can use
How to compare myreader.getdate(3)=NULL ??   (110 Views)
How can I check a NULL date value in mysqldatabase in asp.net I am using datareader to fetch value from mysql database myreader.getdate(3)=NULL does'nt work. Theres no keyword like IsNull in asp.net that I can find. I also tried System.dbnull, but asp.net does'nt allow comparison operater like '=' to comapre date with boolean or other dayatype, so myreader.getdate(3)= Flase is also not working. Please help me. Bilal
OracleDataReader.HasRows - huge delays compared to running in SQL editor   (422 Views)
I havea stored procedure - which in SQL editor takes less than 1 second to run but when its in a c# application it can take up to 30 seconds. [code]Log.WriteToFile("INFO 1: | " + DateTime.Now.ToString() , System.Diagnostics.TraceLevel.Error); cmd = dbConnLocal.ExecuteProcedure2(); Log.WriteToFile("INFO 2: | " + DateTime.Now.ToString() , System.Diagnostics.TraceLevel.Error); rdr = (OracleDataReader)cmd.Parameters["p_cursorSMB"].Value; Log.WriteToFile("INFO 3: | " + DateTime.Now.ToString() , System.Diagnostics.TraceLevel.Error); if (rdr.HasRows) { Log.WriteToFile("INFO 4: | " + DateTime.Now.ToString() , System.Diagnostics.TraceLevel.Error); ... }[/code] When it hits rdr.HasRows it can take up to 30 seconds (according to my log) - What could possibly be going wrong Could it be something to do with the values I'm bringin back (all text - nothing bigger than 100 chars)
sql to compare two tables   (156 Views)
Can someone please help with a sql that will compare two tables having same column name for a missing row Tanks in advance
LINQ TO SQL string compare GOTCHA - "D" is equal to "d" with MSSQL collating sequence   (184 Views)
You wont believe this, but I accidently put in a D in my password test and my qry said it was equal to d ! I have been thinking my password was case sensitive. It was, when I typed in YopQ2 and tested it by typing YopQ2 it worked, what do you know. After finding this out, I went to my production environment and typed in yOPq2 and that worked too ! I know that the LINQ to SQL WHERE string==string gets translated down the tree to T-SQL. But I didnt know that at that point, the translated T-SQL statement uses the collating sequence to determine how to compare strings. My MSSQL default collating sequence is (CI=Case insensitive, CS=Case sensitive) "[coGroupCode] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL" When I changed this to [coGroupCode] [nvarchar](50) COLLATE SQL_Latin1_General_CP1257_CS_AS NOT NULL, Then my qry worked. I am wondering now . (Answers for any or all questions is helpful - just want to do the best thing) 1 - do I change all string fields 2 - just the ones that I need to be case sensitive 4 - all the ones I think I will use for sorting 5 - When I consider searches, how do I handle 6 - Which collation sequence is best CP1251, 1253, 1254, 1255, 1256 or 1257 7 In MSSQL, how do I set things so that the right one is the default 8 - Is there a best practice on this thing 9 - My app ismulti-lingual, what should i consider Guess for now, I will just start with my passwords.
Snapshot refresh two times in day?   (97 Views)
Hi all. Can anybody tell me how can I refresh snapshot(readonly) two or more times in every day For example every day on 9:00 AM and 2:00 PM and 6:00 PM. (By sql*plus or Enterprise manager) Best
Problems with Oracle on a IBM Storage area network (SAN)   (104 Views)
Hi I am trying to find out any information about Oracle database's on IBM's Storage area network (SAN). Oracle Metalink has very little information on the subject. My Story !! A month ago i migrated our Data warehouse from locally attached disks to the SAN, the disks are all RAW devices. The migration went well and inital tests looked good. The tests comprised of some sql query and building of BITMAP indexes. The query times were the same but there was a slight improvment on the index builds. looked good..... Until our data warehouse team started to load data into the warehouse. Jobs that took 10 minutes before migrating to the SAN are now taking 30 minutes. So it looks like Inserts and updates are taking longer. why I have looked at the obvious area's like stats and reorging the tables but nothing has helped. Has anyone else out there had any experience of SAN's and oracle running slow on data loads. I know this is all a bit general but any info would be good.
how to delete in two tables using foreign stored procedure   (88 Views)
i have 1 table resource columns are id,title,dimension,image,zoomimage,catogary other table resourcecolor columns are id,resourceid,color so i want to write delete stored procedure to delete all coloumns in resource table based on id at the same time the color associated with dat id in resoucecolor table shuold also be delete ,so how to use foreign key plz od help me below code i m using but its nt able to delete color row in resourcecolor USE [Harlequin] GO /****** Object: StoredProcedure [dbo].[DELETERESOURCES] Script Date: 02/14/2012 10:04:10 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER PROCEDURE [dbo].[DELETERESOURCES] ( @Id nvarchar (Max) ) AS BEGIN SET NOCOUNT ON DELETE Resources WHERE Id=@Id END
Connect to an Oracle Network Server   (88 Views)
I have a Windows 7 dev machine used to create .Net applications with VS 2010. I want to connect to a remote server (on the same network running Windows 2003 Server) that is running an Oracle 10g database. I also need to mention (just in case) that the remote server is also hosting an MS SQL 2005 application as well. I am using the code below (with the first connection string) to connect directly to a version of 10g that is running on the same machine with no problems, however when I try to connect to the network machine, it actually crashes Windows 7. What concerns me is that I have dual try/catch statements in the application and I do not understand why it simply does not refuse the connection and report the error. I have tried several variations of connection strings as I feel that I must be making a sytax error somewhere. I suppose the real question is 'what is the correct syntax for the connection string'....or WHATEVER the hell I am doing wrong. This is my first go around with Oracle (and I am not liking it at all), but it is not a matter of choice for me. SO.........any help or suggestions are greatly appreciated. Thank you in advance...Best
Trying to join two queries, getting undesirable results.   (89 Views)
, I have two queries that I need joined. Below are the two separate queries and then my attempt which returns incorrect results. Can you help It appears the results for the fields are all quadrupled.
How can I compare date between current date and six months backwards   (142 Views)
people, I want to be checking if the date given is within six(6) months from the current date going backwards. Forexample, if the given date is 24-04-2008. How can I check that the date given is within six (6) from todays date (Current date) going backwards I have this sql below but it is not working as expected. How can I do it sql="SELECT name1,name2,dateperiod FROM students WHERE dateperiod is between "+ Curdate.ToString("dd-MMM-yyyy") +" and "+ DateTime.Parse(Datestudent).AddMonths(-6) +"";
Define two field to be unique   (115 Views)
Hi all, I had a simple sql statement that need your help. I had a table named "Info" and hadfour field : ProductID SubProductID CreationDate Description I need both ProductID and SubProductID to be unique. May I know how to define my table schema Should I put ProductID and SubProductID as primary key Please help.