case

Add a test method to existing test case by highlighting the method name in Eclipse

Hi there, Not sure if this is possible, but it'll save me a lot of time if it is. When I create a Junit4 test case in Eclise, I don't usually included all the methods that I'd like to test first, and later on, I'd like to add the untested methods or new methods to the test case. Currently, I'm doing this by typing new test methods in th...

git mv and only change case of directory

While I found similar question I didn't find an answer to my problem When I try to rename the directory from FOO to foo via git mv FOO foo I get fatal: renaming 'FOO' failed: Invalid argument OK. So I try git mv FOO foo2 && git mv foo2 foo But when I try to commit via git commit . I get # On branch master # Untracked files: # (...

Multiple conditions with CASE statements

I need to query some data. here is the query that i have constructed but which isn't workig fine for me. For this example I am using AdventureWorks database. SELECT * FROM [Purchasing].[Vendor] WHERE PurchasingWebServiceURL LIKE case // In this case I need all rows to be returned if @url is '' or 'ALL' or NULL when (@url IS null OR @u...

Why do case class companion objects extend FunctionN?

When you create a case class, the compiler creates a corresponding companion object with a few of the case class goodies: an apply factory method matching the primary constructor, equals, hashCode, and copy. Somewhat oddly, this generated object extends FunctionN. scala> case class A(a: Int) defined cla...

CASE + IF MysQL query

Problem is as follows. I have a product that can be in one of three categories (defined by category_id). Each category table has category_id field related to category_id in product table. So I have 3 cases. I'm checking If my product.category_id is in table one. If yes, I take some values. If not I check in tables that are left. What can...

SWITCH with LIKE inside SELECT query in MySQL-Resolved

I have this Tags table CREATE TABLE IF NOT EXISTS `Tags` ( `id_tag` int(10) unsigned NOT NULL auto_increment, `tag` varchar(255) default NULL, PRIMARY KEY (`id_tag`), UNIQUE KEY `tag` (`tag`), KEY `id_tag` (`id_tag`), KEY `tag_2` (`tag`), KEY `tag_3` (`tag`), KEY `tag_4` (`tag`) ) ENGINE=InnoDB DEFAULT CHARSET=l...

Postgresql case and testing boolean fields

Hello to all. First: I'm running postgresql 8.2 and testing my queries on pgAdmin. I have a table with some fields, say: mytable( id integer, mycheck boolean, someText varchar(200)); Now, I want a query similary to this: select id, case when mycheck then (select name from tableA) else (select name from tableB) end ...

clear case trigger

Hello, Does someone knows how to create a trigger in Clear case, that will never allow checking out a file named x or y or j, in case this file is already checked out by someone else. I want to not allow unreserved checkout for few of my files. Thanks ...

Case In Lambda Expression

I wrote a method which calls a method that returns a linq query. Inside this method, I need to apply a case expression to the linq query I'm receiving from the method I call. I thought that maybe with a lambda expression it would be possible to apply a case expression, but how can I do this? ...

Determine data type of a column in SQLite

I'm working on an Android App where the user has different options for sorting the displayed data that comes from the database. Currently my orderBy string that I pass to Androids query() method looks like this: "LOWER("+columnName+") ASC" The problem with this is that if the data type in the column specified by columnName is integer,...

need to get out of the select case

We are using a code where we need to select an item in combobox, we do this by a select case statement like Case "SelectItem" However if there are no items in the combobox the code should exit from the case."End Select" was not working.. How can we resolve the same? is there a different logic? ...

Problem in executing different queries based on condition in CASE statement

Hello All, I am facing a problem in executing queries with CASE statement. Based on my condition,(for eg. length), I want to execute different SQL statement. Problematic sample query is as follows: select case when char_length('19480821') = 8 then select count(1) from Patient when char_length('19480821')=10 th...

SQL Server - CASE within a CASE checking for NULL

I am still learning SQL so this may seem a very odd question, but is this the best way to use CASE within a CASE to check for NULL? @FN_InputDt datetime) RETURNS varchar(3) as BEGIN DECLARE @Result varchar(3), @MonthNo int Set @MonthNo = datepart(m,@FN_InputDt) Set @Result = CASE WHEN @FN_InputDt IS NOT NUL...

USE CASE UML Modeling different ways to System access (SMS, IVR, WEB)

Hi, I’m working on a USE CASE diagram but I’m having problems modeling the following: A user wants to inquire his balance, but he can do it by phone, SMS or IVR. How should I represent the different ways? Each one has different flows. Should I model just one use case for each one, or should I represent the different ways as extended use ...

Conditional mapping in Hibernate 3.0?

How to create mapping in hibernate that depends on the type property, insert/retrieve the data into/from proper column. Structure: TABLE COLUMNS: |TYPE | CHARACTER | DATE | TIME | NUMERIC| POJO: class Pojo { private int type; private Object data; ... } Examples: Insert/Update If the type is 1 we input the value to colum...

Need help with syntax for test ISNUMERIC in case

I am trying to stop input of negative values to process in any of the ranges, rather if they are negative they should drop down to the end of the 1st case statement as 'Invalid'. This is not working as when I run a test against the input of (-1000) i get a row for <=50K. I am afraid my syntax is wrong, but not sure why. ALTER FUNCTION ...

sql nested case statments

does anyone know whats wrong with this nested select stament? It complains about missing )'s but i can't unerstand why it doesn't work (i've left off the other bits of the statment) Select (CASE WHEN REQUESTS.grade_id = 1 THEN (CASE WHEN ((date_completed-date_submitted)*24*60)<=30 THEN 'Yes' ELSE 'No' END) ELSE ...

c# switch statement is return suitable to replace break

Is this an appropriate way to handle c# switch statements or is an explicit break required still? reference public static string ToRegistryString(AliceKey.AliceKeyPaths aliceKeyPath) { switch (aliceKeyPath) { case AliceKey.AliceKeyPaths.NET_CLR_DATA: return @"\.NET CLR Data\"; ...

matching (and binding) two exception classes in one case statement in scala 2.7?

I have the following code: try { < ... some JSON parsing code .. > } catch { case e:ClassCastException => throw new ParseException(body, e) case e:JSONException => throw new ParseException(body, e) } This seems overly repetitious. I tried: case e:ClassCastException | e:JSONException => thr...

Row_Number() CTE Performance when using ORDER BY CASE

I have a table I'd like to do paging and ordering on and was able to get a query similar to the following to do the work (the real query is much more involved with joins and such). WITH NumberedPosts (PostID, RowNum) AS ( SELECT PostID, ROW_NUMBER() OVER (ORDER BY CASE WHEN @sortCol = 'User' THEN User END DESC, CASE ...