Oracle PL/SQL Quick Notes

Hi Guys, We come across few queries in oracle and pl/sql on daily development tasks which we forget/wont remember correctly sometime. This post keeps track on those items. Keep visiting this post for the regular updates.   This can be used to refresh for your oracle and pl/sql interviews as well. Feel free to add your thoughts in the comments

153 total views, no views today

» Read more

How to Insert Single and Double Quotes in Oracle?

How to Insert Single and Double Quotes in Oracle? Inserting Single quote in oracle: If your query is like this, insert into emp (id,name,salary) values (10,’Naveen’s’,10000); // error then you will get the error for the single quote in the name. We have to escape it to insert in oracle using one more single quote like this, insert into emp

54 total views, no views today

» Read more

select with timestamp or date in oracle

select with timestamp or date in oracle: If you want to select the date field or timestamp field with the given date, then you have to use the query like this, select * from TABLE_NAME where TO_CHAR(TIMESTAMP_OR_DATE_COLUMN,’DD-MM-YYYY’) =’25-02-2014′; Eg: select * from POST_SITE where TO_CHAR(POST_TMS,’DD-MM-YYYY’) =’25-02-2014′; here POST_SITE is the name of the table and POST_TMS is the name of

71 total views, no views today

» Read more

LISTAGG EXAMPLE IN ORACLE

LISTAGG EXAMPLE IN ORACLE: LISTAGG can be used to get all the row values in single row. Example: [STUDENT_TABLE] Student_id Student_Name Course_id 1                   Naveen                A100 2                   Hems                  A130 3                   Chudar               A100 4                   Balaji                  A100 5                  Aravind                A120 6                   RVS                    A130 7                    JP                      A130 8                    Arun                   A120 9                  K Aravind             A100 Now you want to get the result with respect

79 total views, no views today

» Read more

Oracle Date Formats examples

The below are the mostly used oracle date formats: MM/DD/YYYY HH.MI.SS – 01/23/2014 08.41.56 MM/DD/YYYY HH24.MI.SSFF – 01/23/2014 08.41.56066000 MM/DD/YYYY HH24.MI.SSXFF – 01/23/2014 08.41.56.066000 MM/DD/YYYY HH24:MI:SS AM – 01/23/2014 08:41:56 AM MM/DD/YYYY HH24:MI:SS PM – 01/23/2014 08:41:56 AM Please add if you know any other oracle date formats in the comments area. 58 total views, no views today

58 total views, no views today

» Read more

Difference Between to_char and to_date with example

to_char: to_char converts a date to string. Query: Select to_char(sysdate) from dual; Output: 25-NOV-13 Query: Select to_char(sysdate,’DD-MM-YYYY’) from dual; Output: 25-11-2013 to_date: to_date converts a string to date. Query: Select to_date(sysdate) from dual; Output: 25-NOV-13 Query: Select to_date(sysdate,’DD-MM-YYYY’) from dual; Output: 25-NOV-13 70 total views, no views today

70 total views, no views today

» Read more

Enter the full pathname for java.exe

Enter the full pathname for java.exe Error: Enter the full pathname for java.exe in sql developer. Solution: Path Given: D:\Naveen\jdk1.6.0_45 Note: This path only I have given in the environmental variables. Control Panel\System and Security\System Advanced -> Environmental Variables 83 total views, no views today

83 total views, no views today

» Read more

Joining two tables oracle example

student_details table: select * from student_details; id name 1 divya 2 hems 3 chudar student_rank table: select * from student_rank; id rank 1 5 2 6 3 3 Joining both tables – selecting all: select * from student_details sd,student_rank sr where sr.id=sd.id; id name id_1 rank 1 divya 1 5 2 hems 2 6 3 chudar 3 3 Joining both

58 total views, no views today

» Read more

[solved] oracle sql developer unable to launch the java virtual machine located at path

oracle sql developer unable to launch the java virtual machine located at path Error: oracle sql developer unable to launch the java virtual machine located at path Solution: In windows 7 copy and paste the msvcr71.dll to sqldeveloper\bin. Recommended Books: 219 total views, no views today

219 total views, no views today

» Read more
1 2