Verification

  • I have a table with these records:

    cod01 cod02 cod03 codA codB and some other stuff that is not important for this.

    The information is this:

    1234 0 0 02 01

    5678 0 0 02 01

    How can i check, having the 1234 0 0 record and the 5678 0 0 record, if they both have the same codes in the codA and codB column?

    Any ideas?

    Best regards.

  • taurus2050 (7/2/2009)


    I have a table with these records:

    cod01 cod02 cod03 codA codB and some other stuff that is not important for this.

    The information is this:

    1234 0 0 02 01

    5678 0 0 02 01

    How can i check, having the 1234 0 0 record and the 5678 0 0 record, if they both have the same codes in the codA and codB column?

    Any ideas?

    Best regards.

    I'm slightly confused, what are you try ask of your data?

  • This is an example of the table:

    cod01 cod02 cod03 codA codB

    1234 0 0 02 01

    5678 0 0 02 01

    I get as parameters the cod01, cod02 and cod03 from both the source and the destiny. What i must know is if the destiny record (5678 0 0) has the codA and codB that the source record (1234 0 0) has.

  • Still clear as mud. How are you getting the parameters? Is this a store procedure you are trying to write? what is the expected output from the code?

    Your current explaination leaves things so open and vague as to what you are actually looking for here.

  • Sorry.

    It is a stored procedure, and the input parameters are the source cod01, cod02 and cod03 and the destiny cod01, cod02 and cod03.

    The table has these rows as example:

    1234 0 0 02 01

    5678 0 0 02 01

    I receive as input 1234 0 0 and 5678 0 0.

    I have to insert into another table a row, but only if 5678 0 0 has the 02 01 row.

    I thought of a solution, but i was trying to find if there is a better way.

    Make a cursor with the 1234 0 0 as where clauses.

    Inside the cursor, make a select statement with 5678 0 0 as where clauses and check to see if the select statement returns any row.

    I can't think of a better way to explain.

  • taurus2050 (7/2/2009)


    Sorry.

    It is a stored procedure, and the input parameters are the source cod01, cod02 and cod03 and the destiny cod01, cod02 and cod03.

    The table has these rows as example:

    1234 0 0 02 01

    5678 0 0 02 01

    I receive as input 1234 0 0 and 5678 0 0.

    I have to insert into another table a row, but only if 5678 0 0 has the 02 01 row.

    I thought of a solution, but i was trying to find if there is a better way.

    Make a cursor with the 1234 0 0 as where clauses.

    Inside the cursor, make a select statement with 5678 0 0 as where clauses and check to see if the select statement returns any row.

    I can't think of a better way to explain.

    A better way is to show us what you have developed so far. Table DDL, sample data, expected results also would be quite helpful. Please read the first article I reference below in my signature block regarding asking for assistance.

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply