Oracle SQL, concatenate multiple columns + add text

You have two options for concatenating strings in Oracle: CONCAT Using || CONCAT example: CONCAT( CONCAT( CONCAT( CONCAT( CONCAT(‘I like ‘, t.type_desc_column), ‘ cake with ‘), t.icing_desc_column), ‘ and a ‘), t.fruit_desc_column) Using || example: ‘I like ‘ || t.type_desc_column || ‘ cake with ‘ || t.icing_desc_column || ‘ and a ‘ || t.fruit_desc_column

Logger slf4j advantages of formatting with {} instead of string concatenation

It is about string concatenation performance. It’s potentially significant if your have dense logging statements. (Prior to SLF4J 1.7) But only two parameters are possible Because the vast majority of logging statements have 2 or fewer parameters, so SLF4J API up to version 1.6 covers (only) the majority of use cases. The API designers have … Read more

What does ## (double hash) do in a preprocessor directive?

## is the preprocessor operator for concatenation. So if you use DEFINE_STAT(foo) anywhere in the code, it gets replaced with struct FThreadSafeStaticStat<FStat_foo> StatPtr_foo; before your code is compiled. Here is another example from a blog post of mine to explain this further. #include <stdio.h> #define decode(s,t,u,m,p,e,d) m ## s ## u ## t #define begin … Read more

Concatenate two string literals

const string message = “Hello” + “,world” + exclam; The + operator has left-to-right associativity, so the equivalent parenthesized expression is: const string message = ((“Hello” + “,world”) + exclam); As you can see, the two string literals “Hello” and “,world” are “added” first, hence the error. One of the first two strings being concatenated … Read more

Append an array to another array in JavaScript [duplicate]

If you want to modify the original array instead of returning a new array, use .push()… array1.push.apply(array1, array2); array1.push.apply(array1, array3); I used .apply to push the individual members of arrays 2 and 3 at once. or… array1.push.apply(array1, array2.concat(array3)); To deal with large arrays, you can do this in batches. for (var n = 0, to_add … Read more

In Python, what is the difference between “.append()” and “+= []”?

For your case the only difference is performance: append is twice as fast. Python 3.0 (r30:67507, Dec 3 2008, 20:14:27) [MSC v.1500 32 bit (Intel)] on win32 Type “help”, “copyright”, “credits” or “license” for more information. >>> import timeit >>> timeit.Timer(‘s.append(“something”)’, ‘s = []’).timeit() 0.20177424499999999 >>> timeit.Timer(‘s += [“something”]’, ‘s = []’).timeit() 0.41192320500000079 Python 2.5.1 … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)