Re: Rule Composer: Verify if value EXISTS in DB column

From: Andre Afonso (andre.afonso_at_tekever.com.no.spam)
Date: 02/22/05


Date: Tue, 22 Feb 2022 18:33:46 -0000

OK,

I've solved it by creating a class that implements a method that checks if
the value exists issuing an sql query "SET ROWCOUNT 1; SELECT * WHERE column
= value". The method returns the SqlDataReader.HasRows.

Then I call the method in the condition passing it the value to check for
existence.

Don't forget to create a variable of the class type in the "scope" of the
"call rule shape" usign the "orchestration view".

Andre Afonso

"Andre Afonso" <andre.afonso@tekever.com.no.spam> wrote in message
news:ejXcwHQGFHA.4088@TK2MSFTNGP09.phx.gbl...
> Hello,
>
> I need some guidance building a rule that would behave like a SQL EXISTS
> predicate, i.e. that would iterate trought the values of a database column
> and stop on the first equal value found.
>
> Now, in Rule Composer there's the "exists" predicate for rule conditions,
> but this one works only for XML documents and my data source is a sql
> database. So this won't do.
>
> The other option is to use the "equal" predicate. Using this the rule
> searches the column for a equal value, but the issue with this predicate
is
> that it considers every record in the table, what is not intended and
> degrades performance. And also it will cause the rule will fire more than
> once if more than one equal value is found. I've tried to avoid this by
> using the "halt" action, but that ends all rule processing, not just the
> given rule, not letting other existing rules to fire.
>
> Is there an easy way to accomplish the behavior of a SQL EXISTS predicate
in
> the given scenario?
>
> Thank you,
>
> Andre Afonso
>
>



Relevant Pages

  • Re: In Vs Like
    ... SQL 1 ... SELECT * FROM TAB1 ... Oracle has implemented transitive closure: ... and the join predicate is discarded. ...
    (comp.databases.oracle.server)
  • Re: 3vl 2vl and NULL
    ... I am very aware of the fact that SQL is not relational. ... >The result has *one* predicate, though, not many. ... >> The meaning would be "There exists an age that is uniquely identified by ... That row should not be in the projection on Age. ...
    (comp.databases.theory)
  • Re: Adding unique tags to associate records
    ... Looking for a SQL Server replication book? ... Looking for a FAQ on Indexing Services/SQL FTS ... > Is there anyway to embed tags that use puctuation into a coulmn of an FTS ... > value using the Contains predicate. ...
    (microsoft.public.sqlserver.fulltext)
  • Rule Composer: Verify if value EXISTS in DB column
    ... I need some guidance building a rule that would behave like a SQL EXISTS ... i.e. that would iterate trought the values of a database column ... Now, in Rule Composer there's the "exists" predicate for rule conditions, ... not letting other existing rules to fire. ...
    (microsoft.public.biztalk.general)
  • Re: Better n-tier suggestions
    ... Even if you can't use LINQ to SQL, there are other options to make your ... major problem. ... problem is if I decide to change the database column "Name" to ...
    (microsoft.public.dotnet.languages.csharp)