I know what I am trying to do, but not HOW to do it, exactly!
I have a stored procedure in SQL that does this:
*********************************
CREATE PROCEDURE [DBO].[BOM_SEARCH]
@PART_NO VARCHAR(25),
@1_PART_DESC VARCHAR(25),
@2_PART_DESC VARCHAR(25),
@3_PART_DESC VARCHAR(25)
AS
SELECT
distinct PART.PART_NBR,
PART.PART_TYPE,
PART.BOM_UM,
PART.PART_DESC,
TXDT.COMMENT_ONE,
TXDT.COMMENT_TWO,
TXDT.TEXT_ID,
TXDT.PREFIX_ID,
TXDT.SEQ_NBR
FROM
PART_ELK PART,
TXDT_ELK TXDT
WHERE
PART.PART_NBR*=TXDT.TEXT_ID AND
PART.USER_FIELD_3='ELK' AND
TXDT.PREFIX_ID = 'TXT' AND
UPPER(PART.PART_NBR) LIKE UPPER(@PART_NO) + '%'
GO
*********************************
However, what I really need to do is a function on the side, which will put together all of the TXDT.COMMENT_ONE and TXDT.COMMENT_TWO fields (see below) and then join that into the above stored procedure....
Or maybe this needs a subquery?
Please note - the symtax below is shown for CONCEPT only, it is from ORACLE (which I did get to work correctly =)
*********************************
BEGIN
FOR i IN (SELECT T.COMMENT_ONE,T.COMMENT_TWO
FROM TXDT_ELK T, PART_ELK P
WHERE T.TEXT_ID = P.PART_NBR and T.PREFIX_ID = 'TXT' AND
LOOP
concat_strg :=
substr(
concat_strg ||
Ltrim(Rtrim(i.comment_one)) || ' ' ||
Ltrim(Rtrim(i.comment_two)) || ' '
,1,4000);
END LOOP;
RETURN concat_strg;
END;
/
*********************************
Can any one help guide me, please?
LMC
LMC
I have a stored procedure in SQL that does this:
*********************************
CREATE PROCEDURE [DBO].[BOM_SEARCH]
@PART_NO VARCHAR(25),
@1_PART_DESC VARCHAR(25),
@2_PART_DESC VARCHAR(25),
@3_PART_DESC VARCHAR(25)
AS
SELECT
distinct PART.PART_NBR,
PART.PART_TYPE,
PART.BOM_UM,
PART.PART_DESC,
TXDT.COMMENT_ONE,
TXDT.COMMENT_TWO,
TXDT.TEXT_ID,
TXDT.PREFIX_ID,
TXDT.SEQ_NBR
FROM
PART_ELK PART,
TXDT_ELK TXDT
WHERE
PART.PART_NBR*=TXDT.TEXT_ID AND
PART.USER_FIELD_3='ELK' AND
TXDT.PREFIX_ID = 'TXT' AND
UPPER(PART.PART_NBR) LIKE UPPER(@PART_NO) + '%'
GO
*********************************
However, what I really need to do is a function on the side, which will put together all of the TXDT.COMMENT_ONE and TXDT.COMMENT_TWO fields (see below) and then join that into the above stored procedure....
Or maybe this needs a subquery?
Please note - the symtax below is shown for CONCEPT only, it is from ORACLE (which I did get to work correctly =)
*********************************
BEGIN
FOR i IN (SELECT T.COMMENT_ONE,T.COMMENT_TWO
FROM TXDT_ELK T, PART_ELK P
WHERE T.TEXT_ID = P.PART_NBR and T.PREFIX_ID = 'TXT' AND
LOOP
concat_strg :=
substr(
concat_strg ||
Ltrim(Rtrim(i.comment_one)) || ' ' ||
Ltrim(Rtrim(i.comment_two)) || ' '
,1,4000);
END LOOP;
RETURN concat_strg;
END;
/
*********************************
Can any one help guide me, please?
LMC
LMC