Total Pageviews
2013/04/23
Top 10 Traits of a Rockstar Software Engineer
- Loves To Code
- Gets Things Done
- Continuously Refactors Code
- Uses Design Patterns
- Writes Tests
- Leverages Existing Code
- Focuses on Usability
- Writes Maintainable Code
- Can Code in Any Language
- Knows Basic Computer Science
2013/04/15
Test a string for a numeric value
Environment
Oracle 11g
Problem
I write wrong value into specific column, it should accept numeric only.
Solution
To test a string for numeric characters, you could use a combination of the length function, trim function, and translate function built into Oracle.
You can use the following command:
Reference: http://www.techonthenet.com/oracle/questions/isnumeric.php
Labels:
Oracle
2013/04/09
ALL_TAB_COLUMNS Usage
Environment
Oracle 11g
Problem
Customer requests to update ACS_NO this column length from 8 to 10. But I have more than 100 tables in my system, how do I quickly get the table which have ACS_NO column?
Solution
Making good use of ALL_TAB_COLUMNS. ALL_TAB_COLUMNS provides by Oracle, it describes the columns of the tables, views, and clusters accessible to the current user.
We can use this SQL statement to find out the result:
See....we can get the result easily, and start to author alter table script.
Reference : http://docs.oracle.com/cd/B19306_01/server.102/b14237/statviews_2094.htm
Oracle 11g
Problem
Customer requests to update ACS_NO this column length from 8 to 10. But I have more than 100 tables in my system, how do I quickly get the table which have ACS_NO column?
Solution
Making good use of ALL_TAB_COLUMNS. ALL_TAB_COLUMNS provides by Oracle, it describes the columns of the tables, views, and clusters accessible to the current user.
We can use this SQL statement to find out the result:
See....we can get the result easily, and start to author alter table script.
Labels:
Oracle
Subscribe to:
Posts (Atom)