Oracle functions - Unknown number of parameters [duplicate] - sql

This question already has answers here:
Oracle equivalent of Java's Varargs
(2 answers)
Closed 3 years ago.
Can a function in Oracle have an unknown number of parameters?
for example: create function sample(parameters... varchar)
so it can call something like: sample("A") or sample("A","B") or sample("A","B","C")

You can use sys.odcivarchar2list:
function sample(parameters sys.odcivarchar2list)
And then call it by:
sample(sys.odcivarchar2list('A','B','C'))
or
sample(sys.odcivarchar2list('A'))
and so on.

Related

name of variable with braces - what is it in kotlin [duplicate]

This question already has an answer here:
What is this syntax, parentheses around variable/property names at declaration site?
(1 answer)
Closed 9 months ago.
I have such code:
val (valName) = list[fileAndMediaHolder.adapterPosition] as FileAndMediaItem
() - what is it in Kotlin?
Sometimes it is convenient to destructure an object into a number of variables, for example:
val (name, age) = person

SQL Select statement how to return emoji [duplicate]

This question already has answers here:
SQL Query Where Column = '' returning Emoji characters 🎃 and 🍰
(4 answers)
Closed 3 years ago.
I currently have a query where I want to select cake:
SELECT '🍰'
But upon executing query, it gives me an output of '??'
How to output the real cake?
set as unicode using the N'' notation
SELECT N'🍰'

Ternary Conditional Operator in kotlin [duplicate]

This question already has answers here:
How to write ternary conditional operator?
(33 answers)
Closed 4 years ago.
What is the equivalent of this expression in Kotlin.
a ? b : c
This is giving error.
In Kotlin, if statements are expressions. So the following code is equivalent:
if (a) b else c
Hope it's working for you.

Is it possible to reference a variable via string manipulation? [duplicate]

This question already has answers here:
T-SQL: How to use parameters in dynamic SQL?
(4 answers)
how to pass variables this in dynamic query in sql
(1 answer)
Closed 7 years ago.
I have a series of datetime variables that need to be referenced, and the key to which variable needs referencing is reached by using substring on another field. I can create the name of the variable as a string using string manipulation, something like this:
'#' + SUBSTRING(field, CHARINDEX(',', field) + 2, LEN(field) - CHARINDEX(',', field) + 1) + 'start'
Is there a way to get SQL to recognize that this is the name of one of my variables? Some kind of function to convert the string?

difference between like and = [duplicate]

This question already has answers here:
Equals(=) vs. LIKE
(16 answers)
WHERE clause on SQL Server "Text" data type
(7 answers)
Closed 7 years ago.
what is the differences between = to like ?
thanks for help :)
by the way if it's help , the error i get is: the data types text and varchar are incompatible in the equal to operator [msg 402]
1:
Like
The LIKE operator is used to search for a specified pattern in a column.
Where
The WHERE clause is used to extract only those records that fulfill a specified criterion.
In your case the first query do not work is because no records match the criteria you are searching.