Friday, July 2, 2010

How to dynamically enable and disable pickmap constrain

Imagine this scenario : You have a picklist that, under certain conditions, must have a constrain in the pickmap list, so what should I do to disable it when is not necessary?
Easy, read tools online help.

Pick Map UpdOnlyIfNull

Marks a copy pick map (read Pick Map) to perform only the copy operation if the field specified in the pick map updonlyifnull is null. Constrain pick maps are also copy pick maps. In cases where the constraint is active, this results in no operation (no-op). In cases where the UpdOnlyIfNull causes the constraint to be ignored, the copy operation works. To avoid the copy operation use a calculated field as the field for the constrain pick map.

Wednesday, June 25, 2008

EIM : Handling EIM process failures

Imagine this scenario, you are deleting a large number of contacts and you process aborts somewhere during the process. If you are using default parameters in process IFB, you can be in a lot of trouble. Why? EIM have this 3 parameters

COMMIT EACH PASS = TRUE
COMMIT EACH TABLE = TRUE
ROLLBACK ON ERROR = FALSE
whith this defaults, this means that after deleting a table a commit is performed. And no rollback is performed. this can leave you with "orphan" records.
To avoid this, just change your parameters to
COMMIT EACH PASS = FALSE
COMMIT EACH TABLE = FALSE
ROLLBACK ON ERROR = TRUE
This ensures that EIM will either complete sucessfully or rollback the batch.

Just one note, be sure that your database resources are large enough to handle this transaction.

Friday, June 6, 2008

PL\SQL : Copy tables between databases

As you noticed, my posts run around my daily problems, and this isn't an exception. Past week I needed to copy large amount of data between production and development database to perform some tests. After some research I've found SQL*Plus COPY command, that fits like a glove in my needs.
So here's the syntax:


COPY FROM database TO database action
destination_table (column_name, column_name...) USING query

where action stands for:

  • create - if destination table doesn't exist yet;
  • replace - if destination table exists and we wish to drop and create it again;
  • append - Inserts data if table exist, otherwise it will be created;
  • insert - Insert data into an existing table.

An example could be :

SQL>copy from user/pass@DB1 
to user2/pass2@DB2
append new_emp
using select * from emp;
Enjoy!

Monday, April 21, 2008

SBL-EAI-04375 - EAI upsert error

Past week I came across an annoying error, lets supose that I have an integration object that generates a schema like this:

   <name>Account Name</name>
<competitorlist>
<competitor>
<name>Name 1</name>
<type>TYPE</type>
</competitor>
</competitorlist>
When I used EAI to upsert this values, it works fine in first execution, but fails in next executions (with same data)
with this error :

"Method 'WriteRecord' of business component 'BC' (integration component 'BC') for record with search specification '[Name]="TYPE" AND [Type]="Name 1"' returned the following error:"The same values for 'Name, Type' already exist.
If you would like to enter a new record, please ensure that the field values are unique.(SBL-DAT-00382)"(SBL-EAI-04375)
--
Error invoking service 'EAI Siebel Adapter',

So, let me explain all scenario for a better explanation:
  • Table that supports competitor list have a key for name and type for each account
  • BC that supports this IO have a MVG declaration with Type Field = Type and Type Value = TYPE
  • By mistake values in CompetitorList came switched...
   <name>Account Name</name>
<competitorlist>
<competitor>
<name>TYPE</name>
<type>Name 1</type>
</competitor>
</competitorlist>
So what's really happening? Why first execution works fine (even with switched values)? After strugling with it for a day
I found the answer in siebel sql trace, When EAI process is trying to decide if is an update or an insert in Competitors table, is used MVG restriction to perform the
query, so, because values are switched EAI is looking for a register with type = TYPE, which wasn't found because we are inserting a record with type= Name 1, then when EAI
didn't found any record it will try to insert a new one with values that already exists in db causing this error to happen.

This is a pretty strange situation, that causes a pretty confuse explanation.
So, bottom line is : If any similiar situation happens to you, look in siebel logs for the query that is causing it.

Wednesday, April 16, 2008

Using BS simulator

Today, I've lost 4 hours trying to understand an unexpectable error when testing a BS Method using BS simulator, so here's the story.
All my executin ends in:

An error has ocurred in business component "Service Request" creation used by business object "Business Service"....
After struigling with it, and try to discover where I've used that BS, because I don't remember to use it, I've discover (with a little help from Gonçalo) this piece of code :
   activeBO = TheApplication().ActiveBusObject();
bcSR = activeBO.GetBusComp("Service Request");
So I've solved the mistery, "Business service" is the ActiveBusObject when you instantiate a method from BS simulator, and that's causing the unexpected error.

Thanks Gonçalo, without your help I surely can't solve this out.

Monday, March 3, 2008

ORA-01445: cannot select ROWID from a join view wihtout a key-preserved table.

Today, I was building an huge query, after adding another branche, the query returned me this strange error :

ORA-01445: cannot select ROWID from a join view wihtout a key-preserved table.
My query was something like this :
select * from tableA a join tableB b on (a.column = b.column)
No row_ids...

After struggling with it for a while, I search metalink, and after all it was Oracle thats causing my problems.... Oracle(9) has a limit of 1050 columns in any query that uses ANSI joins. So I've changed my query to :
select * from tableA a join (select column from tableB) b on (a.column = b.column)
This way I've reduced my query colums and my problem was solved.

Friday, February 15, 2008

Applet : Fast button enable

Today, I came across this great tip from Siebel Unleashed, in how to enable an applet button;

If you create a button and give method name as CopyScript then change it to EventMethodCopyScript it will automatically enable the button. But you need to change the method name at BC level too. So at BC Level the scripting will change to

if(MethodName == “EventMethodCopyScript”)

Enjoy!