Hi,
1) What is difference in thers two statements:
String s1 = "abc";
and
String s1 = new String("abc")
2) as i am not using new in first statement, how string object will be created
Thanks
I want to my make a search-statement and query things like this
select * from table where col like '%vkvk%'
But with trial and error I've come to the conclusion that access doesn't work with LIKE or
wildcard operators. Does anybody have some other solutions because I ain't so in to access actually, so I really don't know.
$sql = 'SELECT
id,
DATE_FORMAT(date,"%d.%m.%Y - %H.%i Uhr") AS dat,
user1,
user2,
p_user1,
p_user2,
be_user1,
be_user2,
win
FROM
kok_1on1_matches
WHERE
user1="$user"
OR
user2="$user"';
What is wrong with the WHERE statement?
Here is my code:
// Function code
public static int something(){
int number1 = 1;
int number2 = 2;
return number1, number2;
}
// Main class code
public static void main(String[] args) {
something();
System.out.println(number1 + number2);
}
Error:
Exception in thread "main" java.lang.RuntimeException: Uncompilable source code - missing return statement
at assignment.Main.something(Main.java:86)
at assignment.Main.main(Main.java:53)
Java Result: 1
Hi Folks.
I'm looking for a way to determine the difference between two dates.
A normal SQL DATEDIFF statement won't cut it because I need to excluded non working Hours and days Namely Weekends and any time between 16:00 - 7:00.
Something similar to the NETWORKDAYS function in excel.
I'm codeing an excel spreadsheet. Using VBA connect to a SQL server to pull data.
Hey all,
About my question, I'm asking a theoretical question here about Base case or the halting case in a recursive method, what's its standards?
I mean, is it standard not to have body in it, just a return statement?
Is it always like the following:
If(input operation value)
return sth;
Do you have different thoughts about it??
Hello,
I've a SQL statement that returns a xml result, for a serialized object.I want to add a attribute to an element, that reflects the type of the object "xsi:type=table" but i don't know how?
Hi,
What is the best approach in using a timer. Use a System.Timer.Timer class or use a single Thread in a non-terminating loop with a Thread.Sleep statement?
Thanks in advance
Hi,
I've got tqo queries:
First doesn't work:
select hotels.TargetCode as TargetCode from hotels
union all
select DuplicatedObjects.duplicatetargetCode as TargetCode from DuplicatedObjects where DuplicatedObjects.objectType=4
because I get error:
Cannot resolve collation conflict for column 1 in SELECT statement.
Second works:
select hotels.Code from hotels where hotels.targetcode is not null
union all
select DuplicatedObjects.duplicatetargetCode as Code from DuplicatedObjects where DuplicatedObjects.objectType=4
Structure:
Hotels.Code -PK nvarchar(40)
Hotels.TargetCode - nvarchar(100)
DuplicatedObjects.duplicatetargetCode PK nvarchar(100)
Because apparently require 'date' doesn't include the method hours or seconds etc:
undefined method `hours' for 5:Fixnum (NoMethodError)
Am I missing something? Is 5.seconds only something you can do in Rails? If so, what is the require statement I need to get this to work in a ruby script?
I am trying to query all post that are made to the wall of a facebook event. But am not making any headway. Is this at all possible. How would you proceed? Create a multiquery FQL statement?
Is it possible to have a navigation system optimized using javascript, but for the sake of search engines, have the hyperlinks still be crawlable?
Or maybe a condition statement that calls HTML code only if javascript is not enabled in the browser or when crawled by a search engine?
I wrote php code for use to contact us form
but I can not find free SMTP server to use it.
I Try to use SMTP Server For Gmail but I found this error.
Warning: mail() [function.mail]:
"sendmail_from" not set in php.ini or
custom "From:" header missing in
C:\www\htdocs\contactUs.php on line
25"
line 25 is :
mail ($to,$subject,$body,$headers);
statement that indicate using Gmail SMTP Server is :
ini_set("SMTP","smtp.gmail.com");
SO,can U help me ?:(
I have an SQL file which will give me an output like below:
10|1
10|2
10|3
11|2
11|4
.
.
.
I am using this in a Perl script like below:
my @tmp_cycledef = `sqlplus -s $connstr \@DLCycleState.sql`;
after this above statement, since @tmp_cycledef has all the output of the SQL query,
I want to show the output as:
10 1,2,3
11 2,4
How could I do this using Perl?
Suppose that I have two massive folders in SVN: test and prod. I'm trying to use the following svn command to merge the content from test into prod:
svn merge ./prod@HEAD ./test@HEAD ./prod
However, my SVN repository is huge and this process takes an enormous amount of time. Is there any way that I can make a simpler merge statement which will be more processor friendly? Perhaps a server-URL based merge?
Any insight is appreciated....
How can I force Hibernate to update an entity instance even if the entity is not dirty? I'm using Hibernate 3.3.2 GA, Hibernate Annotations and Hibernate EntityManager btw. I really want Hibernate to execute the generic UPDATE statement even if no property on the entity has changed.
I need this because some event listeners need to get invoked to do some additional work when the application runs for the first time.
Thanks!
Is there any handy tool that can make updating tables easier? Usually I got an Excel file with the original value in one column and new value in another column. Then I write a formula in Excel to create the 'update' statement. Is there any way to simplify the updating task?
I believe the approach in SQL server 2000 and 2005 would be different, so could we discuss them both? Thanks.
what is in and not in equals in Linq to sql ?
fore example
select * from table in ( ...)
and
select * from table not in (..)
what is equal to above statement in Linq to sql ?
I have an SQL statement:
SELECT * FROM customers WHERE BINARY login='xxx' AND password='yyyy'
There are no blob/binary fields in the table, do I need the BINARY after the WHERE what else does it do?
I have the following TSQL Statement:
SELECT ProductId, OwnerId FROM Product
How I can store the ProductId and OwnerId in a TSQL variable and then return it to the calling application?
Can someone explain this XAML statement, particularly what is the Resolve?
<MenuItem Header="_Load File" Command="{Resolve {Type Commands:LoadFile}}" />
here is my SQL statement , i would like to find all the games that have the status 0 and names of teams that are like key_word or the sport's name that are like the key word.
The problem is that all the games that are displayed don't have status 0 .
What am i doing wrong?
sql="select * from games where games.status=0 and games.team_2_id
IN (select id from teams where name like '"+key_word+"')
or games.team_1_id
IN (select id from teams where name like '"+key_word+"')
or games.sport like '"+key_word+"'
"
I am executing the following SQL statement on an indexed SQL Server 2008 R2 database.
SELECT * FROM mydatabase WHERE (CONTAINS(ColumnA,'"The Apple is red"'))
The problem is that it returns too many entries. It also returns entries where 'ColumnA' contains only one of the words ('Apple' or 'is' or 'red'...) and not only the entries which contains the exact phrase.
According to MSDN this should be the way to search for a phrase.
Thanks
cpt.oneeye
Hi,
I try to use the SQL statement
SELECT * FROM table ORDER BY column
via an PDO-Object in PHP. Problem is, that I always get an error (Call to a member function fetchall() on a non-object - that means, the query did not return a PDO-object) when using the names of all columnname EXCEPT for ID. When I query
SELECT * FROM table ORDER BY ID
it works. ID is the PRIMARY INTEGER KEY, all other columns are TEXT or NUMERIC, neither of them would works with the ORDER BY clause.
Any ideas?
Is there any way to write a using statement without instantiating the IDisposable immediately?
For example, if I needed to do something like:
using (MyThing thing)
{
if (_config == null)
{
thing = new MyThing();
}
else
{
thing = new MyThing(_config);
}
// do some stuff
} // end of 'using'
Is there an accepted pattern for cases like this? Or am I back to handling the IDisposable explicitly again?