Welcome To Snipplr


Everyone's Recent SQL Snippets Tagged Oracle



Very useful sql to find which responsibility has access to a report or request.
0 2639 posted 14 years ago by theonlyalterego
Per cambiare il tipo di dato in una colonna devo fare un giretto...
0 913 posted 14 years ago by tuffo19
0 814 posted 14 years ago by marvin9000
use this SQL query to find out an applications full name (aka long name) and/or application id based on the application short name. This can obviously be re-written to perform the reverse.
0 1729 posted 14 years ago by theonlyalterego
0 900 posted 14 years ago by xavsio4
You would use a CURSOR FOR Loop when you want to fetch and process every record in a cursor. The CURSOR FOR Loop will terminate when all of the records in the cursor have been fetched.
1 945 posted 14 years ago by mprabhuram
Elapsed Time Calculation
0 893 posted 14 years ago by mprabhuram
GET_HASH_VALUE Function This function computes a hash value for the given string. Syntax DBMS_UTILITY.GET_HASH_VALUE ( name VARCHAR2, base NUMBER, hash_size NUMBER) RETURN NUMBER;
1 1175 posted 14 years ago by mprabhuram
Returns database's version
0 834 posted 14 years ago by mprabhuram
other links : http://tinman.cs.gsu.edu/~raj/880/su98/pldsql/node6.html
1 994 posted 14 years ago by mprabhuram
In the examples so far we have declared variables as a separate object using one of PL/SQL’s standard datatypes. Normally a PL/SQL variable is closely tied to a database object and uses the same datatype. For example, if the variable will hold the...
1 1032 posted 14 years ago by mprabhuram
Logic to subtract months from a date field and extract year and month
0 1103 posted 14 years ago by mprabhuram
Sequence is used to generate auto incrementing numbers
0 838 posted 14 years ago by mprabhuram
See the DBLinks that you have created in the past
0 1022 posted 14 years ago by mprabhuram
use this to convert the oracle time stamp into a character.
0 1083 posted 15 years ago by mprabhuram
This will take the alpha numeric loan number field and converts it into numeric loan number. If there are any loan numbers with alphabet then it is converted as NULL (basically alpha numeric loan numbers are ignored)
0 969 posted 15 years ago by mprabhuram
Use this logic to avoid double counting in ORACLE SQL
1 1056 posted 15 years ago by mprabhuram
This function can be used to find out if there exists an overlap between two pairs of dates or time. There is an alternate way to calculate the actual overlapping value - Read the snippet "How to avoid double counts"
0 3536 posted 15 years ago by mprabhuram
ROW_NUMBER() - Partition (group by) the expression values and assigns integer values to the rows depending on their order. thx to Shouvik Basu < http://www.orafaq.com/node/55 >
0 940 posted 15 years ago by mprabhuram
This sql query will select the past version information about a given file from the database. An example would be searching for %ApprovalHistoryVOImpl% would return all past version numbers (in the database) for the ApprovalHistoryVOImpl.class file....
0 1146 posted 16 years ago by theonlyalterego
This Oracle SQL snippet converts an Oracle SQL DATE to a STRING in the form CCYYMMDD.
0 1727 posted 16 years ago by retry
0 925 posted 17 years ago by Caliban
Generate the SQL necessary to create triggers that use the sequences listed above. NOTE: This particular script assumes that the tables all start with ‘tbl’. It may need to be modified to work with different naming conventions.
0 966 posted 17 years ago by thecrumb
Generate the SQL necessary to create sequences for every table. NOTE: This doesn’t create sequences. The results need to be copied and run as a script.
0 1204 posted 17 years ago by thecrumb