View gist:649590
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select 'Hello World' from dual |
View gist:649621
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select 'Hello World' from dual; |
View gist:649722
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select column_name, column_id | |
from user_tab_cols | |
where table_name = '&tableName' | |
order by 2 |
View gist:649730
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create or replace function getDelimRow(i_table_name varchar2, i_delim varchar2, i_rowNumber number) return varchar2 is | |
Result varchar2(2000); --delimited string that will be returned | |
execSql varchar2(2000); --sql to execute to get delimited string | |
l_colName varchar2(2000); --column name from user_tab_cols for the table passed in | |
concatCols varchar2(2000); --all cols concated together to be part of the execsql var. | |
cursor l_cur is | |
select column_name | |
from user_tab_cols | |
where table_name = upper(i_table_name) | |
order by column_name; --i know, cursors are bad. Got a suggestion? |
View gist:649803
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use LWP::Simple; | |
my $url = 'http://site/files'; | |
my $file = 'fileName'; | |
getstore( "$url/$file", $file ); |
View gist:664350
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create or replace trigger master_table_audit | |
after insert or update or delete on master_table | |
for each row | |
-- | |
begin | |
if UPDATING then | |
insert into audit_table ( | |
pk_uid | |
,edit_user | |
,edit_datetime |
View easyAuditTrails.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create or replace trigger master_table_audit | |
after insert or update or delete on master_table | |
for each row | |
-- | |
begin | |
if UPDATING then | |
insert into audit_table ( | |
pk_uid | |
,edit_user | |
,edit_datetime |
View gist:668076
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem install ruby-oci8 | |
1 gem installed | |
Installing ri documentation for ruby-oci8-2.0.4-x86-mingw32... | |
Installing RDoc documentation for ruby-oci8-2.0.4-x86-mingw32... |
View gist:668381
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Product | |
attr_accessor :external_id #automagically create reader & writer methods | |
attr_reader :internal_id #automagically create reader method | |
attr_writer :product_id #automagically create writer method | |
end |
View Numericality?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
validates :cost, :numericality=> {:greather_than => 0} |
OlderNewer