Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does := mean in oracle when we use it [closed]

What does := mean in oracle when we use it Please give me some demonstrations... and also how do we usually use a dynamic query in a stored procedure in oracle...

like image 795
Mainakh Bhattacharjee Avatar asked Aug 06 '13 12:08

Mainakh Bhattacharjee


People also ask

What is the difference between and := in PL SQL?

= is the equality comparison operator, both in PL/SQL and SQL. := is the PL/SQL value assignment operator.

What does (+) mean in Oracle?

The plus sign is Oracle syntax for an outer join. There isn't a minus operator for joins. An outer join means return all rows from one table. Also return the rows from the outer joined where there's a match on the join key. If there's no matching row, return null.

How can I remove last character from a string in Oracle?

Syntax: SELECT SUBSTRING(column_name,1,length(column_name)-N) FROM table_name; Example: Delete the last 2 characters from the FIRSTNAME column from the geeksforgeeks table.


1 Answers

:= is the assignment operator in PL/SQL (Oracle's procedural extension to SQL). You use this to assign values to variables. If you just use = then this is checking for equality rather than assigning a value.

Here is a very simple example using the assignment operator to assign values to variables:

Declare
   v1 number;
   v2 number;
   res number;
Begin
   --initialise values
   v1 := 2;
   v2 := 2;
   res := v1 + v2;
   dbms_output.put_line(res);
end;

I think you will need to be a bit more specific about what you want to know about dynamic SQL. As the comment above suggests, it would also be best to raise one thread per question as these are unrelated.

like image 173
ChrisProsser Avatar answered Oct 28 '22 04:10

ChrisProsser