Ambiguous Column Name Output Set Kerfuffle

Hey everyone (by which I mean Sandra Ashby J if you’re listening),

 

I built two custom query elements to output attribute values (Birthdate N1 and Birthdate N2). They run fine when they are in output sets individually, but when I  put both of them into a single output set I get an “ambiguous column name keyword_no” error. Anyone know how I can work around this?

 

Here’s what I’ve got for my elements:

 

ID

DESCRIPTION

CATEGORY

DATA_SELECT

DATA_FROM

DATA_WHERE

CONTROL_GROUP

207

Birthdate N1

101

!.key_value

VXS_CUST_KEYWORD

keyword_no = 1

208

Birthdate N2

101

!.key_value

VXS_CUST_KEYWORD

keyword_no = 2

 

Thanks in advance,

 

Rey

 

--

A. Rey Pamatmat

Tessitura Manager

The Public Theater

425 Lafayette Street

New York, NY 10003

(212) 539-8739

rpamatmat@publictheater.org

 

  • I'm not certain this will work, but I'm hopeful...

    Try moving the WHERE clause into the FROM clause.  So, for example, put this whole string in the DATA_FROM, including:

    (select * from vxs_cust_keyword where keyword_no=1)

  • Ahhh, clever… and effective! It worked!

     

    Thank you, Mr. Barnett.

     

    Rey

     

    From: Tessitura Technical Forum [mailto:forums-technical@tessituranetwork.com] On Behalf Of Nick Barnett
    Sent: Monday, December 13, 2010 12:47 PM
    To: Rey Pamatmat
    Subject: Re: [Tessitura Technical Forum] Ambiguous Column Name Output Set Kerfuffle

     

    I'm not certain this will work, but I'm hopeful...

    Try moving the WHERE clause into the FROM clause.  So, for example, put this whole string in the DATA_FROM, including:

    (select * from vxs_cust_keyword where keyword_no=1)

    From: A. Rey Pamatmat <bounce-areypamatmat2177@tessituranetwork.com>
    Sent: 12/13/2010 11:29:31 AM

    Hey everyone (by which I mean Sandra Ashby J if you’re listening),

     

    I built two custom query elements to output attribute values (Birthdate N1 and Birthdate N2). They run fine when they are in output sets individually, but when I  put both of them into a single output set I get an “ambiguous column name keyword_no” error. Anyone know how I can work around this?

     

    Here’s what I’ve got for my elements:

     

    ID

    DESCRIPTION

    CATEGORY

    DATA_SELECT

    DATA_FROM

    DATA_WHERE

    CONTROL_GROUP

    207

    Birthdate N1

    101

    !.key_value

    VXS_CUST_KEYWORD

    keyword_no = 1

    208

    Birthdate N2

    101

    !.key_value

    VXS_CUST_KEYWORD

    keyword_no = 2

     

    Thanks in advance,

     

    Rey

     

    --

    A. Rey Pamatmat

    Tessitura Manager

    The Public Theater

    425 Lafayette Street

    New York, NY 10003

    (212) 539-8739

    rpamatmat@publictheater.org

     




    This message was sent automatically to you by www.tessituranetwork.com because you subscribed to the Tessitura Technical Forum. You may reply to this message to post to the Technical forum or visit the site to search, read and post to the forums. In the interest of keeping the forum posts from becoming cluttered, we encourage you to delete previous message text from your reply before sending. Thank you!

  • Hi Rey  - I must have ‘heard’ you in my sleep as I woke around 4:30am and that was the time your post hit my inbox ;-)

     

    Glad Nick’s suggestion worked. There is another option that you can use. As sometimes the ambiguity happens with the data_select value.

     

    The reason this happens is when you have multiple elements in your Set and there are fields that have the same name and OSB can’t fathom which element they belong to. I’ve got into the habit of giving things an alias so ambiguity doesn’t ruin my day.

     

    So using yours as an example, I have given the fields that are used in Select and Where an alias. If I had another element that pulled from VXS_CUST_KEYWORD I would call key_value for it key3 and the keyword_no would be kw3. This allows anything to be combined with everything and ambiguity is kept at bay. A little bit of extra work, but there’s a lot less hair pulling.

     

    Just remember that if you copy and paste these to retype the quotes, I suspect they won’t transfer into SQL friendly quotes and hence will cause an error.

     

    Cheers

    S.

     

    ID

    DESCRIPTION

    CATEGORY

    DATA_SELECT

    DATA_FROM

    DATA_WHERE

    207

    Birthdate N1

    101

    !.key1

    (select customer_no, key_value as ‘key1’, keyword_no as ‘kw1’ from VXS_CUST_KEYWORD)

    kw1 = 1

    208

    Birthdate N2

    101

    !.key2

    (select customer_no, key_value as ‘key2’, keyword_no as ‘kw2’ from VXS_CUST_KEYWORD)

    kw2 = 2

     

     

     

     

    From: Tessitura Technical Forum [mailto:forums-technical@tessituranetwork.com] On Behalf Of A. Rey Pamatmat
    Sent: Tuesday, 14 December 2010 5:32 AM
    To: Sandra Ashby
    Subject: RE: [Tessitura Technical Forum] Ambiguous Column Name Output Set Kerfuffle

     

    Ahhh, clever… and effective! It worked!

     

    Thank you, Mr. Barnett.

     

    Rey

     

    From: Tessitura Technical Forum [mailto:forums-technical@tessituranetwork.com] On Behalf Of Nick Barnett
    Sent: Monday, December 13, 2010 12:47 PM
    To: Rey Pamatmat
    Subject: Re: [Tessitura Technical Forum] Ambiguous Column Name Output Set Kerfuffle

     

    I'm not certain this will work, but I'm hopeful...

    Try moving the WHERE clause into the FROM clause.  So, for example, put this whole string in the DATA_FROM, including:

    (select * from vxs_cust_keyword where keyword_no=1)

    From: A. Rey Pamatmat <bounce-areypamatmat2177@tessituranetwork.com>
    Sent: 12/13/2010 11:29:31 AM

    Hey everyone (by which I mean Sandra Ashby J if you’re listening),

     

    I built two custom query elements to output attribute values (Birthdate N1 and Birthdate N2). They run fine when they are in output sets individually, but when I  put both of them into a single output set I get an “ambiguous column name keyword_no” error. Anyone know how I can work around this?

     

    Here’s what I’ve got for my elements:

     

    ID

    DESCRIPTION

    CATEGORY

    DATA_SELECT

    DATA_FROM

    DATA_WHERE

    CONTROL_GROUP

    207

    Birthdate N1

    101

    !.key_value

    VXS_CUST_KEYWORD

    keyword_no = 1

    208

    Birthdate N2

    101

    !.key_value

    VXS_CUST_KEYWORD

    keyword_no = 2

     

    Thanks in advance,

     

    Rey

     

    --

    A. Rey Pamatmat

    Tessitura Manager

    The Public Theater

    425 Lafayette Street

    New York, NY 10003

    (212) 539-8739

    rpamatmat@publictheater.org

     




    This message was sent automatically to you by www.tessituranetwork.com because you subscribed to the Tessitura Technical Forum. You may reply to this message to post to the Technical forum or visit the site to search, read and post to the forums. In the interest of keeping the forum posts from becoming cluttered, we encourage you to delete previous message text from your reply before sending. Thank you!




    This message was sent automatically to you by www.tessituranetwork.com because you subscribed to the Tessitura Technical Forum. You may reply to this message to post to the Technical forum or visit the site to search, read and post to the forums. In the interest of keeping the forum posts from becoming cluttered, we encourage you to delete previous message text from your reply before sending. Thank you!