Concat function has not be run in Oracle SQL developer [duplicate] - sql

This question already has answers here:
Function vs. Stored Procedure in SQL Server
(19 answers)
Closed 2 months ago.
When I run my whole SQL query then I got an error. CONCAT() function has not be run while execution:
..... concat(cast(col1 as varchar2(10)),'-', col2) = 'value'
Below this one is part of the query but I stuck on this line only. Why Concat function has not be run.

CONCAT function takes only 2 arguments. You must be getting invalid number of Arguments here.
Use
... col1||'-'||col2 = 'value'....
No need to explicitly cast your variable here. Oracle will implicitly handle this.

Related

How to Check the given string is a reserved keyword in sql server [duplicate]

This question already has answers here:
Check if string is SQL Server Reserved Keywords or not
(3 answers)
Closed 8 years ago.
How to check whether the given string is a reserved keyword in sql server.
I checked a lot in google ,but i didn't find one!!
for eg: If i am giving the input String as 'Order',sql statement should
return whether it is reserved keyword.
Is there any built-in stored procedures or function to do this? Any help would be appreciated.
There is no built-in function to do that.
Here is the list of the known identifiers.
http://technet.microsoft.com/en-us/library/ms189822.aspx
I suggest to put these in an table and use it in a function / stored procedure.

What does a colon (':') mean in SQL syntax? [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
What does the colon sign “:” do in a SQL query?
Simple SQL question:
What does : stand for?
For example:
SELECT * FROM myTable
WHERE Employee_column = :P_EmplId;
The : isn't exactly easy to google when you don't know what this is called. Even searching here didn't help. I'm using Oracle 11g if that makes any difference.
It is a bind variable:
A placeholder in a SQL statement that must be replaced with a valid
value or value address for the statement to execute successfully. By
using bind variables, you can write a SQL statement that accepts
inputs or parameters at run time. The following example shows a query
that uses v_empid as a bind variable:
Most likely you took the query from a template. It is meant to be processed with php's MDB2 sql framework. The ":" (colon) signals a placeholder in the statement, meant to be replaced when the query is executed.

Passing single input parameter with format 'test1', 'test2', 'test3' [duplicate]

This question already has answers here:
Parameterize an SQL IN clause
(41 answers)
Closed 8 years ago.
My stored procedure has the following code:
WHERE tag IN (#InValue)
I want to send a list of tags as an input parameter
EXEC dbo.TestSelect #InValue = '''Test1'',''Test2'',''Test3'''
am I close?
I suggest taking a look at table valued parameters - these have been introduced in SQL Server 2008.
Table-valued parameters are a new parameter type in SQL Server 2008. Table-valued parameters are declared by using user-defined table types. You can use table-valued parameters to send multiple rows of data to a Transact-SQL statement or a routine, such as a stored procedure or function, without creating a temporary table or many parameters.

DIFFERENCE in Linq [duplicate]

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
Does Linq have "Difference"?
How to convert the following SQL Query to Linq
SELECT * FROM Designation WHERE DIFFERENCE(EmpDesg, ‘Engineer’) >= 3
You need to write a stored procedure and bring it into your context, define a user-defined function (if you're using EF) or you need to be willing to just execute a raw SQL query through the context. You can't access DIFFERENCE using LINQ to SQL directly (there is no LINQ query opeartor that will be translated into T-SQL DIFFERENCE).
Does Linq have "Difference"?
Summary:
Create User-Defined SQL Function
Add that function to your DBML diagram
Call that function in your WHERE clause

IS vs AS keywords for PL/SQL Oracle Function or Procedure Creation [duplicate]

This question already has answers here:
What is the difference between "AS" and "IS" in an Oracle stored procedure?
(6 answers)
Closed 9 years ago.
I have been trying to find out what the difference is between the IS and AS keywords in PL/SQL when creating an Oracle function or procedure.
I have searched and have been unable to find any information on this. Does anyone know the difference?
I've never known there to be a difference. The Oracle documentation implies that they are synonyms:
The function body begins with the keyword IS (or AS) and ends with the keyword END followed by an optional function name.
Same as DISTINCT and UNIQUE in select statements.
i.e, there is no material difference between 'IS' and 'AS'.
Backwards compatibility and meeting standards