martedì 30 giugno 2009

How to retrieve the start day of the week

trunc(to_date('22-AUG-03'), 'DAY') would return '17-AUG-03'

How to retrieve the first day of the year

trunc(to_date('22-AUG-10'), 'YEAR') would return '01-JAN-10'

How to retrieve the first day of the month

Since there isn't a "first_day" function, we can use the trunc function:

trunc(to_date('22-AUG-03'), 'MONTH') would return '01-AUG-03'

DUP_VAL_ON_INDEX

The DUP_VAL_ON_INDEX is raised when a SQL statement attempts to create a duplicate value in a column on which a unique index exists.


begin

insert into $table_name[...]

exception

when DUP_VAL_ON_INDEX then

update $table_name[...]

or...

dbms_output.put_line('Error');

end;

martedì 23 giugno 2009

How to display all Data Pump jobs in the database

select * from dba_datapump_jobs

Column Datatype Description
OWNER_NAME VARCHAR2(30) User that initiated the job
JOB_NAME VARCHAR2(30) Name of the job
OPERATION VARCHAR2(30) Type of operation being performed
JOB_MODE VARCHAR2(30) Mode of operation being performed
STATE VARCHAR2(30) Current job state
DEGREE NUMBER Number of worker processes performing the operation
ATTACHED_SESSIONS NUMBER Number of sessions attached to the job


Related View
USER_DATAPUMP_JOBS displays the Data Pump jobs owned by the current user. This view does not display the OWNER_NAME column.

giovedì 18 giugno 2009

An A-Z Index of the Apple OS X command line

a
alias Create an alias •
alloc List used and free memory
awk Find and Replace text within file(s)
b
basename Convert a full pathname to just a folder path
bash Bourne-Again SHell
bg Send to background •
bind Display readline key and function bindings •
bless Set volume bootability and startup disk options.
break Exit from a For, While, Until or Select loop •
builtin Execute a shell builtin •
c
cal Display a calendar
caller Return the context of a subroutine call •
case Conditionally perform a command •
cat Display the contents of a file
cd Change Directory •
chflags Change a file or folder's flags
chgrp Change group ownership
chmod Change access permissions
chown Change file owner and group
chroot Run a command with a different root directory
cksum Print CRC checksum and byte counts
clear Clear terminal screen
cmp Compare two files
comm Compare two sorted files line by line
command Run a command (not a function) •
complete Edit a command completion [word/pattern/list] •
continue Resume the next iteration of a loop •
cp Copy one or more files to another location
cron Daemon to execute scheduled commands
crontab Schedule a command to run at a later date/time
cut Divide a file into several parts
d
date Display or change the date & time
dc Desk Calculator
dd Data Dump - Convert and copy a file
declare Declare variable & set attributes •
defaults Set preferences
df Display free disk space
diff Display the differences between two files
diff3 Show differences among three files
dig DNS lookup
dirname Convert a full pathname to just a path
dirs Display list of remembered directories •
diskutil Disk utilities - Format, Verify, Repair
disown Unbind a job from the current login session •
ditto Copy files and folders
dot_clean Remove dot-underscore files
drutil Interact with CD/DVD burners dscacheutil Query or flush the Directory Service/DNS cache
dscl Directory Service command line utility
du Estimate file space usage
e
echo Display message on screen •
ed A line-oriented text editor (edlin)
enable Enable and disable builtin shell commands •
env Set environment and run a utility
eval Evaluate several commands/arguments •
exec Execute a command •
exit Exit the shell •
expand Convert tabs to spaces
expect Programmed dialogue with interactive programs
Also see AppleScript
export Set an environment variable •
expr Evaluate expressions
f
false Do nothing, unsuccessfully
fc Fix command (history)
fdisk Partition table manipulator for Darwin UFS/HFS/DOS
fg Send job to foreground •
find Search for files that meet a desired criteria
fmt Reformat paragraph text
fold Wrap text to fit a specified width
for Loop command •
fsck Filesystem consistency check and repair
fsaclctl Filesystem enable/disable ACL support
fs_usage Filesystem usage (process/pathname)
ftp Internet file transfer program
g
GetFileInfo Get attributes of HFS+ files
getopt Parse positional parameters
getopts Parse positional parameters •
goto Jump to label and continue execution
grep Search file(s) for lines that match a given pattern
groups Print group names a user is in
gzip Compress or decompress files
h
hash Refresh the cached/remembered location of commands •
head Display the first lines of a file
hdiutil Manipulate iso disk images
history Command History •
hostname Print or set system name
i
id Print user and group names/id's
if Conditionally perform a command •
info Help info
install Copy files and set attributes
j
jobs List active jobs •
join Join lines on a common field
k
kextfind List kernel extensions
kill Stop a process from running
l
l List files in long format (ls -l)
last Indicate last logins of users and ttys
launchctl Load or unload daemons/agents
ll List files in long format, showing invisible files (ls -la)
less Display output one screen at a time
let Evaluate expression •
lipo Convert a universal binary
ln Make links between files (hard links, symbolic links)
local Set a local (function) variable •
locate Find files
logname Print current login name
login log into the computer
logout Exit a login shell (bye) •
lpr Print files
lprm Remove jobs from the print queue
lpstat Printer status information
ls List information about file(s)
lsregister Reset the Launch Services database
lsbom List a bill of materials file
lsof List open files
m
man Help manual
mdfind Spotlight search
mdutil Manage Spotlight metadata store
mkdir Create new folder(s)
mkfifo Make FIFOs (named pipes)
more Display output one screen at a time
mount Mount a file system
mv Move or rename files or directories
n
net Manage network resources
netstat Show network status
networksetup Network and System Preferences
nice Set the priority of a command
nohup Run a command immune to hangups
ntfs.util NTFS file system utility
o
onintr Control the action of a shell interrupt
open Open a file/folder/URL/Application
osacompile Compile Applescript
osascript Execute AppleScript
p
passwd Modify a user password
paste Merge lines of files
pbcopy Copy data to the clipboard
pbpaste Paste data from the Clipboard
pico Simple text editor
ping Test a network connection
pkgutil Query and manipulate installed packages plutil Property list utility
pmset Power Management settings
popd Restore the previous value of the current directory •
pr Convert text files for printing
printenv Print environment variables
printf Format and print data •
ps Process status
pushd Save and then change the current directory
pwd Print Working Directory •
q
quota Display disk usage and limits
r
rcp Copy files between machines
read Read one line from standard input •
readonly Mark a variable or function as read-only •
reboot Stop and restart the system
return Exit a function •
rev Reverse lines of a file
rm Remove files
rmdir Remove folder(s)
rpm Remote Package Manager
rsync Remote file copy - Sync file tree (also RsyncX)
s
say Convert text to audible speech
sched Schedule a command to run at a later time.
screen Multiplex terminal, run remote shells via ssh
screencapture Capture screen image to file or disk
sdiff Merge two files interactively
security Administer Keychains, keys, certificates and the Security framework
sed Stream Editor
select Generate a list of items •
set Set a shell variable = value •
setfile Set attributes of HFS+ files
shift Shift positional parameters •
shopt Set shell options •
shutdown Shutdown or restart OS X
sleep Delay for a specified time
softwareupdate System software update tool
sort Sort text files
source Execute commands from a file •
split Split a file into fixed-size pieces
stop Stop a job or process
su Substitute user identity
sudo Execute a command as another user
sum Print a checksum for a file
suspend Suspend execution of this shell •
sw_vers Print Mac OS X operating system version
system_profiler Report system configuration
systemsetup Computer and display system settings
t
tail Output the last part of files
tar Tape ARchiver
tee Redirect output to multiple files
test Condition evaluation •
textutil Manipulate text files in various formats (Doc,html,rtf)
time Measure Program Resource Use
times Print shell & shell process times •
touch Change file timestamps
tr Translate, squeeze, and/or delete characters
trap Execute a command when the shell receives a signal •
traceroute Trace Route to Host
true Do nothing, successfully
tty Print filename of terminal on stdin
type Describe a command •
u
ufs.util Mount/unmount UFS file system
ulimit limit the use of system-wide resources •
umask Users file creation mask
umount Unmount a device
unalias Remove an alias •
uname Print system information
unexpand Convert spaces to tabs
uniq Uniquify files
units Convert units from one scale to another
unset Remove variable or function names •
until Loop command •
users Print login names of users currently logged in
uuencode Encode a binary file
uudecode Decode a file created by uuencode
uuidgen Generate a Unique ID (UUID/GUID)
uucp Unix to Unix copy
v
vi Text Editor
w
wait Wait for a process to complete •
wc Print byte, word, and line counts
where Report all known instances of a command
which Locate a program file in the user's path
while Loop command •
who Print all usernames currently logged on
whoami Print the current user id and name (`id -un')
write Send a message to another user
x
xargs Execute utility - passing arguments
yes Print a string until interrupted


Commands marked • are bash built-in commands.

An A-Z Index of the Bash command line for Linux

a
alias Create an alias
apropos Search Help manual pages (man -k)
apt-get Search for and install software packages (Debian)
aspell Spell Checker
awk Find and Replace text, database sort/validate/index

b
bash GNU Bourne-Again SHell
bc Arbitrary precision calculator language
bg Send to background
break Exit from a loop
builtin Run a shell builtin
bzip2 Compress or decompress named file(s)

c
cal Display a calendar
case Conditionally perform a command
cat Display the contents of a file
cd Change Directory
cfdisk Partition table manipulator for Linux
chgrp Change group ownership
chmod Change access permissions
chown Change file owner and group
chroot Run a command with a different root directory
chkconfig System services (runlevel)
cksum Print CRC checksum and byte counts
clear Clear terminal screen
cmp Compare two files
comm Compare two sorted files line by line
command Run a command - ignoring shell functions
continue Resume the next iteration of a loop
cp Copy one or more files to another location
cron Daemon to execute scheduled commands
crontab Schedule a command to run at a later time
csplit Split a file into context-determined pieces
cut Divide a file into several parts

d
date Display or change the date & time
dc Desk Calculator
dd Convert and copy a file, write disk headers, boot records
ddrescue Data recovery tool
declare Declare variables and give them attributes
df Display free disk space
diff Display the differences between two files
diff3 Show differences among three files
dig DNS lookup
dir Briefly list directory contents
dircolors Colour setup for `ls'
dirname Convert a full pathname to just a path
dirs Display list of remembered directories
dmesg Print kernel & driver messages
du Estimate file space usage

e
echo Display message on screen
egrep Search file(s) for lines that match an extended expression
eject Eject removable media
enable Enable and disable builtin shell commands
env Environment variables
ethtool Ethernet card settings
eval Evaluate several commands/arguments
exec Execute a command
exit Exit the shell
expect Automate arbitrary applications accessed over a terminal
expand Convert tabs to spaces
export Set an environment variable
expr Evaluate expressions

f
false Do nothing, unsuccessfully
fdformat Low-level format a floppy disk
fdisk Partition table manipulator for Linux
fg Send job to foreground
fgrep Search file(s) for lines that match a fixed string
file Determine file type
find Search for files that meet a desired criteria
fmt Reformat paragraph text
fold Wrap text to fit a specified width.
for Expand words, and execute commands
format Format disks or tapes
free Display memory usage
fsck File system consistency check and repair
ftp File Transfer Protocol
function Define Function Macros
fuser Identify/kill the process that is accessing a file

g
gawk Find and Replace text within file(s)
getopts Parse positional parameters
grep Search file(s) for lines that match a given pattern
groups Print group names a user is in
gzip Compress or decompress named file(s)

h
hash Remember the full pathname of a name argument
head Output the first part of file(s)
history Command History
hostname Print or set system name

i
id Print user and group id's
if Conditionally perform a command
ifconfig Configure a network interface
ifdown Stop a network interface
ifup Start a network interface up
import Capture an X server screen and save the image to file
install Copy files and set attributes

j
join Join lines on a common field

k
kill Stop a process from running
killall Kill processes by name

l
less Display output one screen at a time
let Perform arithmetic on shell variables
ln Make links between files
local Create variables
locate Find files
logname Print current login name
logout Exit a login shell
look Display lines beginning with a given string
lpc Line printer control program
lpr Off line print
lprint Print a file
lprintd Abort a print job
lprintq List the print queue
lprm Remove jobs from the print queue
ls List information about file(s)
lsof List open files

m
make Recompile a group of programs
man Help manual
mkdir Create new folder(s)
mkfifo Make FIFOs (named pipes)
mkisofs Create an hybrid ISO9660/JOLIET/HFS filesystem
mknod Make block or character special files
more Display output one screen at a time
mount Mount a file system
mtools Manipulate MS-DOS files
mv Move or rename files or directories
mmv Mass Move and rename (files)

n
netstat Networking information
nice Set the priority of a command or job
nl Number lines and write files
nohup Run a command immune to hangups
nslookup Query Internet name servers interactively

o
open Open a file in its default application
op Operator access

p
passwd Modify a user password
paste Merge lines of files
pathchk Check file name portability
ping Test a network connection
pkill Stop processes from running
popd Restore the previous value of the current directory
pr Prepare files for printing
printcap Printer capability database
printenv Print environment variables
printf Format and print data
ps Process status
pushd Save and then change the current directory
pwd Print Working Directory

q
quota Display disk usage and limits
quotacheck Scan a file system for disk usage
quotactl Set disk quotas

r
ram ram disk device
rcp Copy files between two machines
read read a line from standard input
readonly Mark variables/functions as readonly
reboot Reboot the system
renice Alter priority of running processes
remsync Synchronize remote files via email
return Exit a shell function
rev Reverse lines of a file
rm Remove files
rmdir Remove folder(s)
rsync Remote file copy (Synchronize file trees)

s
screen Multiplex terminal, run remote shells via ssh
scp Secure copy (remote file copy)
sdiff Merge two files interactively
sed Stream Editor
select Accept keyboard input
seq Print numeric sequences
set Manipulate shell variables and functions
sftp Secure File Transfer Program
shift Shift positional parameters
shopt Shell Options
shutdown Shutdown or restart linux
sleep Delay for a specified time
slocate Find files
sort Sort text files
source Run commands from a file `.'
split Split a file into fixed-size pieces
ssh Secure Shell client (remote login program)
strace Trace system calls and signals
su Substitute user identity
sudo Execute a command as another user
sum Print a checksum for a file
symlink Make a new name for a file
sync Synchronize data on disk with memory

t
tail Output the last part of files
tar Tape ARchiver
tee Redirect output to multiple files
test Evaluate a conditional expression
time Measure Program running time
times User and system times
touch Change file timestamps
top List processes running on the system
traceroute Trace Route to Host
trap Run a command when a signal is set(bourne)
tr Translate, squeeze, and/or delete characters
true Do nothing, successfully
tsort Topological sort
tty Print filename of terminal on stdin
type Describe a command

u
ulimit Limit user resources
umask Users file creation mask
umount Unmount a device
unalias Remove an alias
uname Print system information
unexpand Convert spaces to tabs
uniq Uniquify files
units Convert units from one scale to another
unset Remove variable or function names
unshar Unpack shell archive scripts
until Execute commands (until error)
useradd Create new user account
usermod Modify user account
users List users currently logged in
uuencode Encode a binary file
uudecode Decode a file created by uuencode

v
v Verbosely list directory contents (`ls -l -b')
vdir Verbosely list directory contents (`ls -l -b')
vi Text Editor
vmstat Report virtual memory statistics

w
watch Execute/display a program periodically
wc Print byte, word, and line counts
whereis Report all known instances of a command
which Locate a program file in the user's path.
while Execute commands
who Print all usernames currently logged in
whoami Print the current user id and name (`id -un')
Wget Retrieve web pages or files via HTTP, HTTPS or FTP
write Send a message to another user

x
xargs Execute utility, passing constructed argument list(s)

y
yes Print a string until interrupted


. Run a command script in the current shell

An A-Z Index of the Windows XP command line

a
ADDUSERS Add or list users to/from a CSV file
ARP Address Resolution Protocol
ASSOC Change file extension associations•
ASSOCIAT One step file association
AT Schedule a command to run at a later time
ATTRIB Change file attributes

b
BOOTCFG Edit Windows boot settings
BROWSTAT Get domain, browser and PDC info

c
CACLS Change file permissions
CALL Call one batch program from another•
CD Change Directory - move to a specific Folder•
CHANGE Change Terminal Server Session properties
CHKDSK Check Disk - check and repair disk problems
CHKNTFS Check the NTFS file system
CHOICE Accept keyboard input to a batch file
CIPHER Encrypt or Decrypt files/folders
CleanMgr Automated cleanup of Temp files, recycle bin
CLEARMEM Clear memory leaks
CLIP Copy STDIN to the Windows clipboard.
CLS Clear the screen•
CLUSTER Windows Clustering
CMD Start a new CMD shell
COLOR Change colors of the CMD window•
COMP Compare the contents of two files or sets of files
COMPACT Compress files or folders on an NTFS partition
COMPRESS Compress individual files on an NTFS partition
CON2PRT Connect or disconnect a Printer
CONVERT Convert a FAT drive to NTFS.
COPY Copy one or more files to another location•
CSCcmd Client-side caching (Offline Files)
CSVDE Import or Export Active Directory data

d
DATE Display or set the date•
DEFRAG Defragment hard drive
DEL Delete one or more files•
DELPROF Delete NT user profiles
DELTREE Delete a folder and all subfolders
DevCon Device Manager Command Line Utility
DIR Display a list of files and folders•
DIRUSE Display disk usage
DISKCOMP Compare the contents of two floppy disks
DISKCOPY Copy the contents of one floppy disk to another
DISKPART Disk Administration
DNSSTAT DNS Statistics
DOSKEY Edit command line, recall commands, and create macros
DSADD Add user (computer, group..) to active directory DSQUERY List items in active directory
DSMOD Modify user (computer, group..) in active directory

e
ECHO Display message on screen•
ENDLOCAL End localisation of environment changes in a batch file•
ERASE Delete one or more files•
EXIT Quit the current script/routine and set an errorlevel•
EXPAND Uncompress files
EXTRACT Uncompress CAB files

f
FC Compare two files
FIND Search for a text string in a file
FINDSTR Search for strings in files
FOR /F Loop command: against a set of files•
FOR /F Loop command: against the results of another command•
FOR Loop command: all options Files, Directory, List•
FORFILES Batch process multiple files
FORMAT Format a disk
FREEDISK Check free disk space (in bytes)
FSUTIL File and Volume utilities
FTP File Transfer Protocol
FTYPE Display or modify file types used in file extension associations•

g
GLOBAL Display membership of global groups
GOTO Direct a batch program to jump to a labelled line•

h
HELP Online Help

i
iCACLS Change file and folder permissions
IF Conditionally perform a command•
IFMEMBER Is the current user in an NT Workgroup
IPCONFIG Configure IP

k
KILL Remove a program from memory

l
LABEL Edit a disk label
LOCAL Display membership of local groups
LOGEVENT Write text to the NT event viewer.
LOGOFF Log a user off
LOGTIME Log the date and time in a file

m
MAPISEND Send email from the command line
MBSAcli Baseline Security Analyzer.
MEM Display memory usage
MD Create new folders•
MKLINK Create a symbolic link (linkd)
MODE Configure a system device
MORE Display output, one screen at a time
MOUNTVOL Manage a volume mount point
MOVE Move files from one folder to another•
MOVEUSER Move a user from one domain to another
MSG Send a message
MSIEXEC Microsoft Windows Installer
MSINFO Windows NT diagnostics
MSTSC Terminal Server Connection (Remote Desktop Protocol)
MUNGE Find and Replace text within file(s)
MV Copy in-use files

n
NET Manage network resources
NETDOM Domain Manager
NETSH Configure network protocols
NETSVC Command-line Service Controller
NBTSTAT Display networking statistics (NetBIOS over TCP/IP)
NETSTAT Display networking statistics (TCP/IP)
NOW Display the current Date and Time
NSLOOKUP Name server lookup
NTBACKUP Backup folders to tape
NTRIGHTS Edit user account rights

p
PATH Display or set a search path for executable files•
PATHPING Trace route plus network latency and packet loss
PAUSE Suspend processing of a batch file and display a message•
PERMS Show permissions for a user
PERFMON Performance Monitor
PING Test a network connection
POPD Restore the previous value of the current directory saved by PUSHD•
PORTQRY Display the status of ports and services
PRINT Print a text file
PRNCNFG Display, configure or rename a printer
PRNMNGR Add, delete, list printers set the default printer
PROMPT Change the command prompt•
PsExec Execute process remotely
PsFile Show files opened remotely
PsGetSid Display the SID of a computer or a user
PsInfo List information about a system
PsKill Kill processes by name or process ID
PsList List detailed information about processes
PsLoggedOn Who's logged on (locally or via resource sharing)
PsLogList Event log records
PsPasswd Change account password
PsService View and control services
PsShutdown Shutdown or reboot a computer
PsSuspend Suspend processes
PUSHD Save and then change the current directory•

q
QGREP Search file(s) for lines that match a given pattern.

r
RASDIAL Manage RAS connections
RASPHONE Manage RAS connections
RECOVER Recover a damaged file from a defective disk.
REG Registry: Read, Set, Export, Delete keys and values
REGEDIT Import or export registry settings
REGSVR32 Register or unregister a DLL
REGINI Change Registry Permissions
REM Record comments (remarks) in a batch file•
REN Rename a file or files•
REPLACE Replace or update one file with another
RD Delete folder(s)•
RMTSHARE Share a folder or a printer
ROBOCOPY Robust File and Folder Copy
ROUTE Manipulate network routing tables
RUNAS Execute a program under a different user account
RUNDLL32 Run a DLL command (add/remove print connections)

s
SC Service Control
SCHTASKS Create or Edit Scheduled Tasks
SCLIST Display NT Services
SET Display, set, or remove environment variables•
SETLOCAL Control the visibility of environment variables•
SETX Set environment variables permanently
SHARE List or edit a file share or print share
SHIFT Shift the position of replaceable parameters in a batch file•
SHORTCUT Create a windows shortcut (.LNK file)
SHOWGRPS List the NT Workgroups a user has joined
SHOWMBRS List the Users who are members of a Workgroup
SHUTDOWN Shutdown the computer
SLEEP Wait for x seconds
SLMGR Software Licensing Management (Vista/2008)
SOON Schedule a command to run in the near future
SORT Sort input
START Start a program or command in a separate window•
SU Switch User
SUBINACL Edit file and folder Permissions, Ownership and Domain
SUBST Associate a path with a drive letter
SYSTEMINFO List system configuration

t
TASKLIST List running applications and services
TASKKILL Remove a running process from memory
TIME Display or set the system time•
TIMEOUT Delay processing of a batch file
TITLE Set the window title for a CMD.EXE session•
TLIST Task list with full path
TOUCH Change file timestamps
TRACERT Trace route to a remote host
TREE Graphical display of folder structure
TYPE Display the contents of a text file•

u
USRSTAT List domain usernames and last login

v
VER Display version information•
VERIFY Verify that files have been saved•
VOL Display a disk label•

w
WHERE Locate and display files in a directory tree
WHOAMI Output the current UserName and domain
WINDIFF Compare the contents of two files or sets of files
WINMSD Windows system diagnostics
WINMSDP Windows system diagnostics II
WMIC WMI Commands

x
XCACLS Change file and folder permissions
XCOPY Copy files and folders



Commands marked • are Internal commands only available within the CMD shell.

All other commands (not marked with •) are external commands which may be used under the CMD shell, PowerShell, or directly from START-RUN.

martedì 9 giugno 2009

Display a calendar using a select statement

Try to execute this select statement... :P

SELECT LPAD( MONTH, 20-(20-LENGTH(MONTH))/2 ) MONTH,"Sun", "Mon", "Tue",
"Wed", "Thu", "Fri", "Sat"
FROM (SELECT TO_CHAR(dt,'fmMonthfm YYYY') MONTH,TO_CHAR(dt+1,'iw') week,
MAX(DECODE(TO_CHAR(dt,'d'),'1',LPAD(TO_CHAR(dt,'fmdd'),2))) "Sun",
MAX(DECODE(TO_CHAR(dt,'d'),'2',LPAD(TO_CHAR(dt,'fmdd'),2))) "Mon",
MAX(DECODE(TO_CHAR(dt,'d'),'3',LPAD(TO_CHAR(dt,'fmdd'),2))) "Tue",
MAX(DECODE(TO_CHAR(dt,'d'),'4',LPAD(TO_CHAR(dt,'fmdd'),2))) "Wed",
MAX(DECODE(TO_CHAR(dt,'d'),'5',LPAD(TO_CHAR(dt,'fmdd'),2))) "Thu",
MAX(DECODE(TO_CHAR(dt,'d'),'6',LPAD(TO_CHAR(dt,'fmdd'),2))) "Fri",
MAX(DECODE(TO_CHAR(dt,'d'),'7',LPAD(TO_CHAR(dt,'fmdd'),2))) "Sat"
FROM ( SELECT TRUNC(SYSDATE,'y')-1+ROWNUM dt
FROM all_objects
WHERE ROWNUM <= ADD_MONTHS(TRUNC(SYSDATE,'y'),12) - TRUNC(SYSDATE,'y')) GROUP BY TO_CHAR(dt,'fmMonthfm YYYY'), TO_CHAR( dt+1, 'iw' )) ORDER BY TO_DATE( MONTH, 'Month YYYY' ), TO_NUMBER(week);

How to find the last day of the PREVIOUS month

--


select last_day(add_months(sysdate,-1))
from dual



--

How to determine if a column has non-numeric values

Imagine you have a table with many records.

How to determine if a column of this table has non-numeric values?

This is a quick method:
select *
from MY_TABLE
where (LENGTH (TRIM (TRANSLATE (MY_FIELD, '0123456789', ' ') ) ) is not null)