Results 1 to 2 of 2

Thread: 2 queries!

  1. #1
    Join Date
    Dec 2003
    Posts
    11

    Unanswered: 2 queries!

    Hi,
    I'm trying to find the answers to the following questions:

    1. How to build the SQL for the following situation?
    table1 table2
    ------- -------
    row_id (unique) par_row_id (relates to row_id)
    reference_key

    i need to find out all records in table1 where the reference_key of table2 maps to more than one row_id of table1.

    2. Is it possible to build a trigger which invokes more than one SP in the same unit of work, to be specific, when an update is performed on a table?

    maxdp.
    ******

  2. #2
    Join Date
    Aug 2003
    Location
    Massachusetts, USA
    Posts
    106

    Re: 2 queries!

    Answer to:

    1. select t1.row_id, count(*) from table1 t1, table2 t2
    where t1.row_id = t2.par_row_id
    group by t1.row_id
    having count(*) > 1

    2. If you are using UDB for linux/unix you cannot call a SP from a trigger.

    Originally posted by maxdp
    Hi,
    I'm trying to find the answers to the following questions:

    1. How to build the SQL for the following situation?
    table1 table2
    ------- -------
    row_id (unique) par_row_id (relates to row_id)
    reference_key

    i need to find out all records in table1 where the reference_key of table2 maps to more than one row_id of table1.

    2. Is it possible to build a trigger which invokes more than one SP in the same unit of work, to be specific, when an update is performed on a table?

    maxdp.
    ******

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •