exists

How do I check for the existence of an external file with XSL?

I've found a lot of examples that reference Java and C for this, but how do I, or can I, check for the existence of an external file with XSL. First, I realize that this is only a snippet, but it's part of a huge stylesheet, so I'm hoping it's enough to show my issue. <!-- Use this template for Received SMSs --> <xsl:template name=...

Shell script to test whether a directory exists and if not create it?

I am trying to create a script to detect whether a directory exists, and if it does not, to create it. How can I do that? I did some digging and found a clue: test -d directory ...will return true or false depending on whether the directory exists or not. But how do I tie this together with mkdir? ...

check if a table exsist in where

This query generates an error because table2 doesn't exist: Select * FROM table WHERE table2.id IS NOT NULL Is there anything like this for check the table2 before apply the check on the id? Select * FROM table WHERE (EXIST(table2) AND table2.id IS NOT NULL) or not EXIST(table2) Thanks ...

Oracle EXISTS query is not working as expected - DB Link bug?

I'm completely baffled by the results of this query: select count(*) from my_tab mt where mt.stat = '2473' and mt.name= 'Tom' and exists (select * from [email protected] cu, [email protected] pr where cu.user_id = pr.user_id and mt.name = pr.name and m...

If url exists Objective-c

Hey, I have a program that needs to tell if an online image exists, but the only way that I've gotten this to work is by loading the image in a NSData pointer and checking if the pointer exists. - (BOOL)exists { NSString *filePath = @"http://couleeapps.hostei.com/BottomBox.png"; NSURL *url = [NSURL URLWithString:filePath]; ...

Is there alternative way to write this query?

I have tables A, B, C, where A represents items which can have zero or more sub-items stored in C. B table only has 2 foreign keys to connect A and C. I have this sql query: select * from A where not exists (select * from B natural join C where B.id = A.id and C.value > 10); Which says: "Give me every item from table A where all sub-...

Invalid SQL Query

I have the next query that in my opinion is a valid one, but I keep getting error telling me that there is a proble on "WHERE em.p4 = ue.p3" - Unknown column 'ue.p3' in 'where clause'. This is the query: SELECT DISTINCT ue.p3 FROM table1 AS ue INNER JOIN table2 AS e ON ue.p3 = e.p3 WHERE EXISTS( SELE...

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...

"form already exists" after form is closed and another instance opened. Delphi

I keep running into this strange problem. It almost seems to be random but I run my application and open a form, do some work with it and close it. The next time I go to open another isntance of that form I get an error message about the form already existing. This is very odd and I haven't been able to constantly reproduce the error....

detect if contact has photo

ive got an imageview which im displaying a contacts picture using a uri which always looks similar to this: content://com.android.contacts/contacts/34/photo how would i be able to detect whether this photo exists, as if it doesnt then i want to use a placeholder instead (stored in my drawable folder). at the moment it just shows a ...

How to judge a window exsits?

could return boolean? I want to new a JFrame if the JFrame not exsits,but not to new if exsits. I creat a Map to save JFrame's name. ...

In Linq, how to find if a set contains an element without using Count(predicate)?

Hi, Since IEnumerable.Contains() method does not accept a predicate as an argument, Most people use the following code to check the existence of something matching a condition: // ProductId is unique. if (Products.Count(c => c.ProductId = 1234) == 1) { // Products list contains product 1234. } This code forces to walk through eve...

Conditionally insert a row

I'd like to insert a row into table A, but only if another row in table B exists. For example something like this... IF EXISTS (SELECT * FROM B WHERE id=1) INSERT INTO A (id, value1, value2) VALUES (1, 'foo', 'bar') However that doesn't work. What will? ...

Check if multiple strings exist in another string

How can I check if any of the strings in an array exists in another string? Like: a = ['a', 'b', 'c'] str = "a123" if a in str: print "some of the strings found in str" else: print "no strings found in str" That code doesn't work, it's just to show what I want to achieve. ...

Magento: addAttributeToFilter but ignore for products that don't have this attribute?

I'm trying to show add some filters on my store, but they have a nasty side effect. Suppose I have product type A and B. Now I want to only show A where color = blue/red. $collection = Mage::getResourceModel('catalog/product_collection') ->setStoreId($this->getStoreId()) ->addCategoryFilter($this) ->addAttributeToFilter(ar...

in Flex, how to check if a component exists or not

In flex, How can I check if a component exists? ...

SQL-Query: EXISTS in Subtable

I have two tables tabData and tabDataDetail. I want all idData(PK) from Parent-Table(tabData) that have only rows in Child-Table(tabDataDetail, FK is fiData) with: fiActionCode=11 alone or fiactionCode=11 and fiActionCode=34 Any other combination is invalid. How to get them? What i've tried without success(slow and gives me also r...

Help with SQL Server procedure rollback

I need some help with this procedure: What its supposed to do is try to insert a new user if there is no other with same NAME. If there is a already an user, it should rollback else commit. But it doesn't work, it commits anyway. Any suggestions? SET ANSI_NULLS ON SET QUOTED_IDENTIFIER ON GO ALTER procedure [dbo].[SP_USUARIOS_INSERT...

How to formulate T-SQL to exclude duplicates?

I am trying to develop a query to just return non-duplicate records so that I can add these to my database, but I keep getting the duplicate record error. I tried ur solution but am still getting duplicate error problem. I deleted the 35 rows which were duplicate. What else could be causing this? Here is my query. Part of the conf...

How to formulate T-SQL to avoid PK constraint?

I am trying to develop a query to just return non-duplicate records so that I can add these to my database, but I keep getting this error: Msg 2627, Level 14, State 1, Line 1 Violation of PRIMARY KEY constraint 'PK_j5c_MasterMeasures'. Cannot insert duplicate key in object 'dbo.j5c_MasterMeasures'. The statement has been terminated. ...