Sybase Error Codes

Problem: Need to distinguish between Sybase RDBMS related exceptions and user data exceptions .

 

Solution:  Since Sybase uses error numbers less than 2000, you can choose to use numbers larger than 3000. You can control the returned error code by using the raiserror function. Yes that is not a misspelling.

Note: Sybase with many of its functions, tried to save keystrokes by eliminating duplicate characters. Here Sybase did not allow double “e”s but left the double “r”s in. Oh well.

For more info see http://stackoverflow.com/questions/7482383/distinguish-sybase-expections-types

Good SQL.  Good night.

Stuck In The Middle of Middleware?

Have you ever felt stuck with something?

stuckThere have been products in the software industry that have been a little less than spectacular.  For instance, Motif was supposed to be the new holy grail for developing graphical user interfaces (GUIs).  (I know I am showing my age.)  But it was slow coming up to the screen.  Why?  Because the Motif designers, decided to load everything into memory at start up.  Even rarely used functions.

Now comes middle ware products.  And guess what?  The designers of those products decided to load everything into memory upon start up.  You know what happened?  Yep, they were slow at start up.  You would think developers would learn from past mistakes.

But in addition, middle ware products were bogged down because the functions stayed in memory.  That is because they were designed and tested for middle sized problems.  Yes the name for these products was “Middle Sized Ware”.  But marketeers decided the name limited the market for sales, so they dropped the “sized” part.

So why don’t software companies load functions into memory “as they are needed”?

So why aren’t software systems designed in case they are used by a thousand users?

It is because software companies are in a hurry and want to keep costs down.  So they hire cheap, inexperienced developers.

The solution is to hire a few experienced people (not all) and take some time to design a killer app like Steve Jobs did.  Nobody ever said they got stuck with an iPhone.

Committees – Need Lots of Love and KISS

Committees get overly complicated and bogged down.  Here is a website that tries to solve this dilemma.

The New KISS: Keep in Simple Strategy

Irreverent but in an innovative way.

Reminds me of the book “Exploiting Chaos”.

Sybase SQL Question – Remove percentage sign from values in table

Solution:

If your DBMS does NOT have a “replace” function, you will have to use character substitution using several string functions.

Here is an example in Sybase and SQL Server.

UPDATE YourTable

SET YourColumn = stuff(YourColumn, patindex(YourColumn, ‘%’), 1, NULL)

This says find the pattern of ‘%’ in YourColumn. Now use that position number and replace aka stuff the character with NULL instead.

Good SQL, good night.

SQL Question – Conditional Join on Columns based on value of one column

Here is my answer.

Try a union
select * from tbla ta, tblb tb
where ta.column_1 = 1
and ta.column_2 = tb.column_2
union
select * from tbla ta, tblb tb
where ta.column_1 = 2
and ta.column_2 = tb.column_2
and ta.column_3 = tb.column_3
union
select * from tbla ta, tblb tb
where ta.column_1 = 3
and ta.column_2 = tb.column_2
and ta.column_3 = tb.column_3
and ta.column_4 = tb.column_4
the end

Here is the website to see other answers

http://stackoverflow.com/questions/10846936/sybase-conditional-join-on-columns-based-on-value-of-one-column/10866671#10866671

Needle.com and SQL Needler

Just read this article in USAToday regarding Needle.com an online customer service company that answers questions for various products.

http://www.usatoday.com/tech/columnist/talkingtech/story/2012-05-30/needle-talking-tech/55287900/1

I wonder if I should join the company and answer questions regarding SQL, Sybase, and database management.  But the pay looks to be rather low.

Richard Branson on Office Ties and Why Kids Cut Them

Cut Off Tie

Interesting article on the change in office attire.  Click http://www.entrepreneur.com/article/223670 to read.

Subtitle : Why Kids Revolt

Flash Crash Epitaph – A Short Story

flashcrashcover

On May 6, 2010, the Flash Crash occurred.

Finally a non-technical short story that explains how it could have happened and how it might happen again.

The latest article to mention the Flash Crash is http://www.usatoday.com/story/money/markets/2013/02/13/dow-nears-new-peak-amid-eerie-calm/1912509/

Click on Flash Crash Epitaph  to read this short story.  Enjoy!