FAQ Database Discussion Community


File exists but java file.exists() but return false

java,file,exists
As the title says, I'm checking if a file exists or not with java. The file is stored in C:\Windows\System32. If I run the project with Netbeans, no problem. It returns true. But if I run the .jar, it returns false. I'm admin of the computer, but I don't know...

Verify youtube api v3 video exists JS

api,video,youtube,exists
I used the v3 API to check if a youtube video exists, however, I am not able to fetch the return data. I assume I need the "pageInfo": { "totalResults": 1, "resultsPerPage": 1 }, to check it. But how to get this information using the following code? var data =...

sikuli (python) script starting at xx hour of the day, wait(“image.png”,highnumber) not working?

python,wait,exists,sikuli
first i'd like to thanks everyone who can help me i've been using a program that automated some boring features in a game i like, but it's not working anymore. the thing i want it to do is really stupid, but am not getting good results.. so 1) since i...

HTML/Java: .exists() always returns true

javascript,html,exists,rft
I have the following code. The site has a tab that only shows up once something happens. I'm testing to see if the tab is showing up but it always returns true. if (html_tab1().exists() == true) { //Some code } I think the problem is the way the html hides...

find missing values between two tables

compare,exists,not-exists
I have two tables named selected_courses and all_courses. I want to find not selected courses with sql queries. Tables: selected_course all_courses +---------------+ +------------+ student_id|course_id course_id|course_name +---------------+ +------------+ 1 A1 A1 1 A2 A2 1 A3 A3 2 A2 A4 2 A3 select all_courses.* from all_courses where not exists (select course_id...

FOR ALL/EXIST Queries

mysql,sql,exists,forall
I am following an online course on databases. However, I really don't know what the next step is and how I can answer this question. Can anyone please help? This is what I have so far. SELECT P.name FROM Persons P LEFT JOIN Knows K ON K.personA_id = P.id WHERE...

Microsoft Access and SQL - Update table.1 value when the record does not exist on table.2

sql,ms-access,exists
I'm having some issues with getting the code below to work. When there is not a matching invoice on the Upload.Invoice table, I would like to update the Status field of the Unprocessed/Unapproved table to 2 when it is at 7 and the invoice field is not null. I have...

SQLite insert if not exist else increase integer value

python,sqlite,exists,not-exists
I need a way to insert a value if the value doesn't exist and if it does it should increase that value by another variable. This is what my table looks like: CREATE TABLE IF NOT EXISTS table( Id INTEGER PRIMARY KEY, Date TEXT, Quantity INTEGER Whenever i add a...

Echo each key value from array if second array key equals

php,arrays,function,compare,exists
I have two arrays: $choices = array ( [model] => 3D Modeling / BIM [edb] => Engineering & Design-Build [gse] => Green & Sustainable Energy [ipd] => Integrated Project Design [lc] => Lean Construction [mt] => Material Supply [ecs] => Electrical Construction & Service [fps] => Fire Protection Services [hms]...

Problems with HAVING query

mysql,sql,exists,forall
I am following an online course on databases. However, I don't know how to proceed with this question. Can anyone help? This is my code: SELECT distinct name FROM Persons P, Knows K WHERE K.personA_id = P.id AND K.personB_id = P.id GROUP BY name HAVING SUM(K.id) = 2 ...

Using EXISTS return wrong values in Script via Management Studio

sql-server,sql-server-2008,ssms,exists
I have a problem with following queries. Part 1 Updates the table. Part 2 Changes the column-name. If I rerun the script via Management Studio I get an error, The column "permissiontype_id" does not exist. The Select Statement in Exists shows the right result... I get such errors with some...

Option Button - Check if exists on sheet

vba,excel-vba,exists,optionbutton
I have a workbook with multiple sheets where I use option buttons for different scripts to be active. My problem is, that not all of the buttons are used on all of the sheets, and they are written in a single sub, so if I do not use an option...

Getting missing records where the record before and after exists

sql,exists
I am having trouble constructing a query that shows the missing records where the records before and after exists. Example being: Ticket # 123 125 What I would like to return is: 124 The tables that I am comparing are Tickets and TicketBooks. Tickets house all the used tickets, and...

Existance in JSON field check query

sql,arrays,json,postgresql,exists
I'm using PostgreSQL JSON type field in my database. JSON format: [ {"id": "13", "something": "not_important"}, {"id": "5426565165191919", "something": "not_important"}, {"id": "46", "something": "not_important"} ... ] List of IDs like ["13", "46", "84"]. How to make query that tell me that some ID is not exists? (Not important which one.)...

Query without value before certain date

sql,database,postgresql,date,exists
I'm being trained in database management and this is my first post ever, so I apologize if I don't follow a standard procedure in posting. I have searched and just can't find an answer. In PostgreSQL, I'm trying to find all new customer orders in 2014. But some customers may...

Postgres select only if table exists

python,postgresql,select,exists
How can I execute select * from my_table but avoid throwing errors if my_table doesn't exist Is it possible? UPDATE: I'm woking in Odoo, I create the table when user presses a button, so for the very first time when my module is installed the table won't exist and I...

Select only users that are (at least) member in certain groups

sql,postgresql,report,exists
I been working on a query to get a users list with their respective groups. I got that covered. However there are some restrictions: if The user is ONLY member of group5 it should not appear on the list If is member of group5 and other groups it should appear...

Php Check if 2 from Database are empty

php,variables,if-statement,exists
Hello I am working on simple video script where I need to do the following: I need to check if Variable Source is empty (if it's not empty echo $source, but if it is empty proceed to check other variable below) if Variable Embed is set, if it is set...

SQL find records from table 1 that are not in table 2 OR in table 2 with condition

mysql,sql,left-join,exists,impala
I see many examples on how to find records that are not in another table, but I'm having a lot of trouble finding records that are either not in table 2, or are in table two, but the freq column value is less than 10%. I'm first joining a list...

Rails exists? Case insensitive

ruby-on-rails,ruby,exists,case-insensitive
Model.exists?("lower(email) = ?", params[:email].downcase) Returns error: ArgumentError (wrong number of arguments (2 for 0..1)): Is it possible to do a exists? with a case insensitive match?...

ORA-00933: SQL command not properly ended in Groovy Script

sql,oracle,oracle11g,exists,drop-table
Wrote this script: static void schema() { Sql.newInstance(*DB_CONFIG, DB_DRIVER).execute(''' drop table if exists post; drop table if exists author; create table author( id integer primary key, name varchar(500) ); create table post( id integer primary key, title varchar(500), text longvarchar, author integer not nul, foreign key(author) references author(id) ); ''')...

Proving that a reversible list is a palindrome in Coq without exists tactic

exists,palindrome,coq
For an exercise in software foundation I want to prove the following theorem : Theorem rev_pal {X:Type} : forall (l:list X), l = rev l -> pal l. pal is defined as follow : Inductive pal {X:Type} : list X -> Prop := | pal_nil : pal [] | pal_one...

Elastic Search : General and conditional filters

elasticsearch,conditional,apply,exists
I'm using Elastic Search, with query match_all and filtering. In my situation I want to apply a general filter and filters by condition. Here in pseudo: query: match all (works fine) filter range date between d1 and d2 (works fine without bullet 3) filter (apply only if field exists, but...

where is my mistake in my SQL code?

mysql,sql,exists
SQL Command : UPDATE table1 SET colOne=1 WHERE id EXISTS ( SELECT IF(col1=19,col2,col1) AS id FROM table2 WHERE (col3=19 AND col4='X') OR (col3=0 AND col4='Y' AND (col1=19 OR col2=19)) ) the inner SELECT query separately work fine...

Is it possible to check existance of variables?

c++,c,variables,exists
Can we understand if there is a variable mentioned/created/exists ? I mean something like that: //..Some codes int main(){ int var1; float var2; char var3; cout << isExist("var1") << endl;//Or isExist(/*Something related with var1*/) cout << isExist("var2") << endl; cout << isExist("var3") << endl; cout << isExist("var456") << endl;//There is...

Correct Usage of IF Exists in SQL

sql,sql-server,tsql,if-statement,exists
I am trying to run the following SQL statement below select FB.FundingSourceID, FB.FiscalYearID, (FB.FundingBudget-CA.CurrentAmount-DE.CFOApproved) as Amount from (select FundingSourceID, FiscalYearID, SUM(COALESCE(Amount,0)) as FundingBudget from [cap].[FactFundingSourceBudget] WHERE IsDeleted = 0 group by FundingSourceID, FiscalYearID) AS FB LEFT JOIN ( select FundingSourceID, FiscalYearID, SUM(COALESCE([Current],0)) as CurrentAmount from [cap].[FactSampledFunding] F WHERE F.IsDeleted =...