Saturday, May 14, 2011

Start Rubbin'

Garlic and Mustard Dry Rub

1 tablespoon garlic powder
2 tablespoons ground black pepper
1 tablespoon salt
1 tablespoon mustard powder
1 tablespoon chili powder
1 tablespoon ground cumin
1 tablespoon brown sugar
4 tablespoons ground paprika
1/2 teaspoon dried oregano

Just mix it all together and then rub on steak. Then let the steak come to room temperature before grilling. Enjoy!

Wednesday, November 10, 2010

Deleting Multiple Siebel Repositories

It's a common problem in a Siebel implementation. You and your team are following good practices. You use ADM or Dev2Prod to migrate your repository from a development environment to test, qa or production. As the project life cycle goes, you may end up with 10, 20 or even more Siebel Repositories in each of your environments. This overload of repositories will bring the enterprise to a crawl. EIM jobs might not start, Assignment Manager will not load, and many other problems will ensue. To alleviate this, you must clean out your repositories via deletion.



Compounding the problem of needing to delete repositories is the fact that it never fails you need to do this quickly due to some kind of outage or other time constraint. The only facility you have in Siebel is using Siebel Tools to one by one delete a record from the Repository object. Deletes of a single repository can take as little as 30 minutes or up to 4 hours, EACH!



Below is a T-SQL script I use to delete all repositories except the Siebel Repository. It can be easily modified to fit other target database platforms.



Back up your database first and then try it out in your test environment. Naturally, there are improvements which could be made, but as a quick solution, this certainly works quite well!



---Repository Delete

SET NOCOUNT ON
DECLARE @rw_id varchar(15), @table varchar(100), @err_num int, @err_msg VARCHAR(100)

DECLARE c1 cursor FOR SELECT ROW_ID FROM S_REPOSITORY WHERE NAME <> 'Siebel Repository'

DECLARE ct cursor FOR SELECT DISTINCT NAME FROM S_TABLE WHERE TYPE = 'Repository' AND NAME <> 'S_REPOSITORY' ORDER BY NAME

OPEN c1
FETCH NEXT FROM c1 INTO @rw_id

WHILE @@FETCH_STATUS = 0
BEGIN ----- 1st block ----

UPDATE S_REPOSITORY SET NAME = 'Deleting ...' WHERE ROW_ID = @rw_id
PRINT ' Deleting Repository with Row_Id -->' + @rw_id

OPEN ct
FETCH NEXT FROM ct INTO @table
WHILE @@FETCH_STATUS = 0
BEGIN ------ 2ND BLOCK -----

PRINT 'Deleting from table -->' + @table
UPDATE S_REPOSITORY SET NAME = 'Deleting from table -->' + @table WHERE ROW_ID = @rw_id
EXEC('DELETE FROM ' + @table + ' WHERE REPOSITORY_ID = ''' + @rw_id + '''')
FETCH NEXT FROM ct INTO @table
END
CLOSE ct
DEALLOCATE ct

PRINT ' Deleting Repository Record with Row Id -->' + @rw_id
DELETE FROM S_REPOSITORY WHERE ROW_ID = @rw_id

PRINT 'Repository with Row_Id -->' + @rw_id + ' deleted.'

FETCH NEXT FROM c1 INTO @rw_id

END
CLOSE c1
DEALLOCATE c1

Wednesday, September 29, 2010

No Loss Situation

It’s a no loss situation; this means absence of any competing or non-competing losers. It’s like tee ball with no score and where every kid gets pizza, a snow cone, and the same “League Champs” trophy.

This is different from the clichéd "win-win" situation. If there are winners then there is at least 1 loser.

No loss is far better than win-win. Plus it's cliché worthy.

Wednesday, August 11, 2010

Comparing and replacing Text Data in SQL Server

When NTEXT or TEXT data is longer than allowed for varchar(max), comparing or replacing data in the string is difficult. This is made easy by use of Substring and Datalength functions in TSQL.

Below is a sample script where I had to load delta of note data. To do this I had to understand which notes were actually changed in the note field not just viewed or accessed by a user. Initial Data Load notes are in the _IDL table and delta is in the base table. If the replace returned empty or null there was not a change, otherwise the resulting note was different and had to replace the previously loaded note record.

The below is what was used to analyze the delta.

select T1.Id, T1.AccountId,T1.OpptyId,T1.ContactId,T1.CustomerServiceId,T1.ProjectId,T1.Subject,T1.Description
from T_SOD_STG_Notes T1, T_SOD_STG_Notes_IDL T2 WHERE T1.Id = T2.Id
AND Replace(SUBSTRING(T1.Description,1,DATALENGTH(T1.Description)),SUBSTRING(T2.Description,1,Datalength(T2.Description)),'') IS NOT NULL
AND Replace(SUBSTRING(T1.Description,1,DATALENGTH(T1.Description)),SUBSTRING(T2.Description,1,Datalength(T2.Description)),'') <> ''

Of course, I could put the exact same replace(substring(...,Datalength(...))) logic into the select and just selected the delta note as well.

Tuesday, August 10, 2010

My Best Hummus

1 can (15 oz) garbanzo bean (chick peas) drained*
1/8 cup tahina paste
1/8 cup extra virgin cold pressed olive oil
1/2 tsp kosher salt
1/4 tsp paprika
1/8 tsp cumin
half a fresh lemon
some white pepper
crushed red pepper (garnish)

I usually make a double batch.

Instructions. Drain the beans, conserving the "juice." Add the beans, tahina, olive oil, salt, paprika, cumin into your blender. Squeeze the juice out of the lemon. Dash some white pepper in on top. Grab a wooden spoon or silicon (or rubber) scraper. Turn on the blender at it's slowest setting. Gentle push from the edges into the center just staying on top of the ingredients. Everything will blend. If it's too chunky add either (a) more olive oil (my preference), or (b) some of the "juice" you conserved.

I blend mine in my Kitchen Aid blender until I get to second highest setting and leave it on until the humus is light and fluffy; almost whipped. Everyone loves. Lately I've been adding some fresh garlic. Also, a teaspoon of truffle oil instead of garlic would be a gourmet touch.

Keep it simple. Serve directly on a plate in a big dollup drizze with a touch of olive oil and garnish with crushed red pepper. I like to use barbari bread from my local mediterranean market and it can also be found at Sam's. Pita bread is fine. Try your favorite flat bread. I cut mine in 3 inch square, warm in my counter-top toaster then cut into triangles.

Enjoy!