Blog Stats
  • Posts - 18
  • Articles - 0
  • Comments - 9
  • Trackbacks - 0

 

April 2010 Entries

.Net oracle parameter order

Using the ODAC (Oracle Data Access Components) downloaded from Oracle to talk to a handfull of Oracle DBs - Was putting together my DAL to update the DB, and things weren't working as I hoped - UPDATE foo SET bar = :P_BAR WHERE bap = :P_BAP I assign my parameters - objCmd.Parameters.Add(objBap); objCmd.Parameters.Add(objBar); Execute update command - int result = objCmd.ExecuteNonQuery() and result is zero! ... Is my filter incorrect? SELECT count(*) FROM foo WHERE bap = :P_BAP ...result is one...

Oracle Sequences

Reminder to myself - SQL Server has nice index columns directly tied to their tables. Oracle has sequences that are islands to themselves. select seq_name.currval from dual; select seq_name.nextval from dual; currval - return current number at top of sequence nextval - increment sequence by 1, return new number therefore - to create functionality in oracle similar to an index column - OPTION A) - Create insert trigger: CREATE OR REPLACE TRIGGER dept_bir BEFORE INSERT ON departments FOR EACH ROW WHEN...

 

 

Copyright © jkrebsbach