Amardeep Sidhu's Oracle blog

Little bit of fun with Oracle

Take care of a slash in a SQL script

with one comment

Since long time i have almost been writing useless posts only. Now, i guess my blog doesn’t even look like an Oracle blog. So thought about posting something related to Oracle ;)

Day before yesterday a colleague at my workplace asked that she was running an SQL script (which contained a simple DBMS_MVIEW.REFRESH() statement to refresh an MVIEW), it ran successfully but after completion re-ran the last command run in the session. I was also puzzled and checked the SQL script but it contained simple DBMS_MVIEW.REFRESH() statement. Next try revealed that the script actually had a / (slash) in the second line (with no semi-colon at the end of the first line). Something like this (I used dbms_stats instead of dbms_mview):

exec dbms_stats.gather_table_stats(user,'EMP')
/

Now this thing, when run in SQL* Plus session can be confusing:

SCOTT@TESTING >
SCOTT@TESTING >delete emp1;
delete emp1
*
ERROR at line 1:
ORA-00942: table or view does not exist

SCOTT@TESTING >@c:\test

PL/SQL procedure successfully completed.

delete emp1
*
ERROR at line 1:
ORA-00942: table or view does not exist

SCOTT@TESTING >

There is no semicolon at the end of the first statement but it executes without that also. So the slash in the 2nd line simply re-executes the last SQL, as expected :) . But it does get confusing !

Written by Sidhu

June 14th, 2009 at 5:31 pm

Posted in Troubleshooting

Tagged with ,

Required ;)

with 9 comments

On the wall just outside my office. Who says there is recession ? ;)

required

Written by Sidhu

February 23rd, 2009 at 11:42 pm

Posted in General

Tagged with ,

Quote modified for S/W industry

with 2 comments

Got this in a forward mail. Good one.

Forgiving or punishing

the terrorists

is left to God.

But,

fixing their appointment

with God

is our responsibility

- Indian Army

Updated statement for this in S/W INDUSTRY…

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

Forgiving or punishing

the Developer

is left to Manager.

But,

fixing their appointment

with Manager

is our responsibility

-   Tester

We all knew that…

but this one is  for the finishing touch!!!

Damn good.

Forgiving or punishing

the Manager

is left to Client.

But,

fixing their appointment

with Client

is our responsibility

-       Developer

;)

Written by Sidhu

February 22nd, 2009 at 12:35 pm

Posted in Fun

Tagged with , ,

Manually booting an OS from GRUB

with 2 comments

One of my friend today asked me about removing Linux partitions & GRUB (from a dual boot system) and return back to windows alone. Removing Linux involves just formatting/removing the partitions. Now to remove GRUB either do fdisk /mbr from a Windows 98 bootable CD or do fixmbr after booting into repair mode with Windows XP CD. But if you have none then to remove GRUB you will need some utility like this one and if you reboot before doing that it might make GRUB unable to boot into Windows. It will get stuck at GRUB> prompt only. So there is an option: to manually boot the OS you want (ie Windows). A quick search gave link to this thread. It involves few commands on the GRUB prompt:

grub> rootnoverify (hd0,0)
grub> makeactive
grub> chainloader +1
grub> boot

It will load the NTLDR where your Windows is installed in Partition 1 on HDD 1.

Written by Sidhu

December 14th, 2008 at 7:28 pm

Posted in Unix/Linux,Windows

Tagged with , ,

My re-designed website ;)

with 2 comments

Since long time i have been struggling to learn CSS and make my website look great. The efforts did succeed but not in a way i wanted. After playing with CSS for few months i finally switched to Joomla and yes, in a week my website looks pretty cool. CSS automated ;) . Joomla installation is pretty next-next job. Then play around a bit and you are done. Next game is to choose a nice looking template according to your taste and addition of few extensions to make yours tasks easier. (WordPress & Joomla rock because of these free extensions). So after long time i feel satisfied with the way my website looks. Here are the screenshots of the old and present new look for archives ;)

Joomla rocks !!!

Written by Sidhu

December 9th, 2008 at 8:39 pm

Posted in General

Tagged with , ,