How to join on data in a long text field

  • I have a table with a column that has long text.  This column is for HTML that references a primary key, Sequence Number for Tables and Columns. 

    What I need to be able to do is to search on this column for specific sequence numbers or just do a join for definition.

    Here is an example of the data contained:

    <IMG id=TOOLBUTTON_Save title=Save style="BORDER-RIGHT: medium none; BORDER-TOP:

    medium none; Z-INDEX: 2; LEFT: 80px; BORDER-LEFT: medium none; WIDTH: 22px; CURSOR:

    hand; BORDER-BOTTOM: medium none; POSITION: absolute; TOP: 7px; HEIGHT: 20px"

    accessKey=V onclick=Save() tabIndex=13 alt=Save src="images/save.gif" moveable="true"

    isselected="false"> <INPUT id=10 style="VISIBILITY: hidden" name=10 DEType="78"

    FPKColumn="1" datatype="int"> <INPUT id=8 style="VISIBILITY: hidden" name=8 DEType="78"

    FPKColumn="1" datatype="int"> <INPUT id=17 style="VISIBILITY: hidden" name=17 DEType="78"

    FPKColumn="1" datatype="int"> <INPUT id=14 style="VISIBILITY: hidden" name=14 DEType="78"

    FPKColumn="1" datatype="int"> <INPUT id=13 style="VISIBILITY: hidden" name=13 DEType="78"

    FPKColumn="1" datatype="int"> <INPUT id=15 style="VISIBILITY: hidden" name=15 DEType="78"

    FPKColumn="1" datatype="int"> <INPUT id=4 style="VISIBILITY: hidden" name=4 DEType="78"

  • Can you be more specific, what text is the primary key, sequence number. What tables & columns and what do you want to join it with?

    Some example of required output would be helpful.

    Far away is close at hand in the images of elsewhere.
    Anon.

  • David,

    Thanks for responding so quickly.

    Example:FPKColumn="1" datatype="int"> <INPUT id=8 style="VISIBILITY: hidden" name=8 DEType="78"

    The FPKColumn references that is a Foriegn Key that is the primary for that table, Input ID=8 is the column in the table and DEType is the table sequence number.

    Select A.HTML-???, A.FORMTITLE, B.COLNAME

    from DBO.NAMSYSHTMLFORMS A, DBO.SMSYSBASEVIEWDATA B

    WHERE A.HTML??? DEType=B.COLNAME

  • A bit clearer but can u post ddl of NAMSYSHTMLFORMS and SMSYSBASEVIEWDATA tables with data that would match with your example

    Example:FPKColumn="1" datatype="int"> <INPUT id=8 style="VISIBILITY: hidden" name=8 DEType="78"

     

    Far away is close at hand in the images of elsewhere.
    Anon.

  •  

    From the NAMSYSHTMLFORMS

    0 78 Problem Management <INPUT id=50 style="VISIBILITY: hidden" maxLength=1 name=50 datatype="char" DEType="69">   <INPUT id=16 style="VISIBILITY: hidden" maxLength=1 name=16 datatype="datetime" DEType="21319">   <INPUT id=11 style="VISIBILITY: hidden" maxLength=5 name=11 datatype="varchar" DEType="85" FKColumn="6">   <INPUT id=4 style="VISIBILITY: hidden" name=4 datatype="int" DEType="78">   <INPUT id=12 style="VISIBILITY: hidden" name=12 datatype="int" DEType="78">   <INPUT id=42 style="VISIBILITY: hidden" maxLength=15 name=42 datatype="varchar" DEType="85" FKColumn="41">   <INPUT id=6 style="VISIBILITY: hidden" name=6 datatype="int" DEType="78">   <INPUT id=32 style="VISIBILITY: hidden" name=32 datatype="int" DEType="78">   <INPUT id=38 style="VISIBILITY: hidden" name=38 datatype="int" DEType="78">   <INPUT id=45 style="VISIBILITY: hidden" name=45 datatype="int" DEType="78">   <INPUT id=47 style="VISIBILITY: hidden" name=47 datatype="int" DEType="78">   <INPUT id=26 style="VISIBILITY: hidden" name=26 datatype="int" DEType="78">   <INPUT id=61 name=61 datatype="datetime" style="VISIBILITY: hidden">  <INPUT id=62 name=62 datatype="float" style="VISIBILITY: hidden">  <FIELDSET class=FieldSetGeneral id=FLDSET2 style="BORDER-RIGHT: thin solid; BORDER-TOP: thin solid; LEFT: 6px; BACKGROUND-IMAGE: none; BORDER-LEFT: thin solid; WIDTH: 708px; BORDER-BOTTOM: thin solid; POSITION: absolute; TOP: 2px; HEIGHT: 34px; BACKGROUND-COLOR: silver" moveable="true" isselected="false"></FIELDSET>  <IMG id="TOOLBUTTON_Find All" Alt="Find All" title="Find All" style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; Z-INDEX: 2; LEFT: 12px; BORDER-LEFT: medium none; WIDTH: 22px; CURSOR: hand; BORDER-BOTTOM: medium none; POSITION: absolute; TOP: 5px; HEIGHT: 20px" accessKey=F onclick=FindAll() tabIndex=16 src="images/open.gif" moveable="true" isselected="false">  <IMG id=TOOLBUTTON_Clear Alt="Clear" title=Clear style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; Z-INDEX: 2; LEFT: 41px; BORDER-LEFT: medium none; WIDTH: 22px; CURSOR: hand; BORDER-BOTTOM: medium none; POSITION: absolute; TOP: 6px; HEIGHT: 20px" accessKey=C onclick=Clear() tabIndex=17 src="images/clear.gif" moveable="true" isselected="false">  <IMG id=TOOLBUTTON_Save Alt="Save" title=Save style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; Z-INDEX: 2; LEFT: 73px; BORDER-LEFT: medium none; WIDTH: 22px; CURSOR: hand; BORDER-BOTTOM: medium none; POSITION: absolute; TOP: 8px; HEIGHT: 20px" accessKey=V onclick=Save() tabIndex=18 src="images/save.gif" moveable="true" isselected="false">  <IMG id=TOOLBUTTON_Delete Alt="Delete" title=Delete style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; Z-INDEX: 2; LEFT: 102px; BORDER-LEFT: medium none; WIDTH: 22px; CURSOR: hand; BORDER-BOTTOM: medium none; POSITION: absolute; TOP: 8px; HEIGHT: 20px" accessKey="" onclick=Delete() tabIndex=19 src="images/delete.gif" moveable="true" isselected="false">  <IMG id="TOOLBUTTON_Query By" Alt="Query By" title="Query By" style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; Z-INDEX: 2; LEFT: 131px; BORDER-LEFT: medium none; WIDTH: 22px; CURSOR: hand; BORDER-BOTTOM: medium none; POSITION: absolute; TOP: 8px; HEIGHT: 20px" accessKey="" onclick=OpenQueryBy() tabIndex=20 src="images/query.gif" moveable="true" isselected="false">  <IMG id=TOOLBUTTON_Copy Alt="Copy" title=Copy style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; Z-INDEX: 2; LEFT: 162px; BORDER-LEFT: medium none; WIDTH: 22px; CURSOR: hand; BORDER-BOTTOM: medium none; POSITION: absolute; TOP: 8px; HEIGHT: 20px" accessKey="" onclick=Copy() tabIndex=21 src="images/copy.gif" moveable="true" isselected="false">  <IMG id="TOOLBUTTON_Previous ToolButton" Alt="Previous ToolButton" title="Previous ToolButton" style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; Z-INDEX: 2; LEFT: 605px; BORDER-LEFT: medium none; WIDTH: 22px; CURSOR: hand; BORDER-BOTTOM: medium none; POSITION: absolute; TOP: 8px; HEIGHT: 20px" onclick="PrevNextSeq('PREV')" tabIndex=23 src="images/page_prev.gif" moveable="true" isselected="false" accesskey?P?>  <IMG id="TOOLBUTTON_Next ToolButton" Alt="Next ToolButton" title="Next ToolButton" style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; Z-INDEX: 2; LEFT: 630px; BORDER-LEFT: medium none; WIDTH: 22px; CURSOR: hand; BORDER-BOTTOM: medium none; POSITION: absolute; TOP: 8px; HEIGHT: 20px" onclick="PrevNextSeq('NEXT')" tabIndex=24 src="images/page_next.gif" moveable="true" isselected="false" accesskey?N?>  <IMG id="TOOLBUTTON_Print Preview" Alt="Print Preview" title="Print Preview" style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; Z-INDEX: 2; LEFT: 660px; BORDER-LEFT: medium none; WIDTH: 22px; CURSOR: hand; BORDER-BOTTOM: medium none; POSITION: absolute; TOP: 8px; HEIGHT: 20px" accessKey="" onclick='OpenReport("ProbMgmtPP.rpt","103","1","78")' tabIndex=25 src="images/Preview.gif" moveable="true" isselected="false">  <IMG id=TOOLBUTTON_Help Alt="Help" title=Help style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; Z-INDEX: 2; LEFT: 687px; BORDER-LEFT: medium none; WIDTH: 22px; CURSOR: hand; BORDER-BOTTOM: medium none; POSITION: absolute; TOP: 9px; HEIGHT: 20px" onclick=OpenHelp() tabIndex=26 src="images/help.gif" moveable="true" isselected="false" accesskey??>   <IMG id=TOOLBUTTON_DisplayLink title=DisplayLink style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; Z-INDEX: 2; LEFT: 191px; BORDER-LEFT: medium none; WIDTH: 22px; CURSOR: hand; BORDER-BOTTOM: medium none; POSITION: absolute; TOP: 8px; HEIGHT: 20px" onclick=DisplayLink() alt=DisplayLink tabIndex=22 src="images/url.gif" moveable="true" isselected="false">   <FIELDSET class=FieldSetGeneral id=FLDSET1 style="BORDER-RIGHT: thin solid; BORDER-TOP: thin solid; LEFT: 6px; BACKGROUND-IMAGE: none; BORDER-LEFT: thin solid; WIDTH: 708px; BORDER-BOTTOM: thin solid; POSITION: absolute; TOP: 33px; HEIGHT: 53px; BACKGROUND-COLOR: ivory" moveable="true" isselected="false"></FIELDSET>   <DIV id=MNUTABLE_MAssignTo onmouseover="bOverMenuItem=true;MouseOver('MAssignTo')" style="FONT-SIZE: 9pt; LEFT: 360px; WIDTH: 50px; CURSOR: hand; POSITION: absolute; TOP: 7px; HEIGHT: 23px" onmouseout="bOverMenuItem=false;menutimeout('MAssignTo')" align=center moveable="true" isselected="false"><LABEL for="MNUTABLE_MAssignTo" id=MNULBL_MAssignTo style="FONT-WEIGHT: normal; COLOR: black">Assign <U>T</U>o</LABEL> <IMG id=IMGActions height=5 src="images/menudown.gif" width=10 align=textTop> <INPUT id=inpMAssignTo onkeydown="shortcutkeys('MAssignTo')" onblur="bOverMenuItem=false;if(bSCKeys)MouseOut('MAssignTo')" style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; FONT-SIZE: 9pt; BORDER-LEFT: medium none; WIDTH: 0px; CURSOR: hand; BORDER-BOTTOM: medium none; BACKGROUND-COLOR: transparent" onfocus="bOverMenuItem=true;MouseOver('MAssignTo')" accessKey=T readOnly> </DIV>  <DIV id=MNUTABLE_MActions onmouseover="bOverMenuItem=true;MouseOver('MActions')" style="FONT-SIZE: 9pt; LEFT: 420px; WIDTH: 43px; CURSOR: hand; POSITION: absolute; TOP: 7px; HEIGHT: 23px" onmouseout="bOverMenuItem=false;menutimeout('MActions')" align=center moveable="true" isselected="false"><LABEL  for="MNUTABLE_MActions"   id=MNULBL_MActions style="FONT-WEIGHT: normal; COLOR: black"><U>A</U>ctions</LABEL> <IMG id=IMGActions height=5 src="images/menudown.gif" width=10 align=textTop> <INPUT id=inpMActions onblur="bOverMenuItem=false;if(bSCKeys)MouseOut('MActions')" onkeyup="shortcutkeys('MActions')" style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; FONT-SIZE: 9pt; BORDER-LEFT: medium none; WIDTH: 0px; CURSOR: hand; BORDER-BOTTOM: medium none; BACKGROUND-COLOR: transparent" onfocus="bOverMenuItem=true;MouseOver('MActions')" accessKey=A readOnly> </DIV>  <TABLE id=LBLTABLE_LBL1 style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; FONT-SIZE: 10pt; Z-INDEX: 2; LEFT: 298px; BORDER-LEFT: medium none; WIDTH: 100px; BORDER-BOTTOM: medium none; POSITION: absolute; TOP: 37px; HEIGHT: 20px; BACKGROUND-COLOR: transparent" borderColo __NONE__

    SMSYSBASEVIEWDATA

    78 7 28 Assigned To FName "ASSIGNEDTO"."_PERSONNEL_"."FNAME" 0 1 1 NULL NULL NULL 6 18 5 NULL

  • SELECT A.FORMTITLE, B.COLNAME, A.HTML

    FROM DBO.SMSYSBASEVIEWDATA B

    INNER JOIN DBO.NAMSYSHTMLFORMS A

    ON A.HTML LIKE '%<INPUT id=' +

      CAST(B.COLNAME as varchar) +

      ' % DEType="' +

      CAST(B.DEType as varchar) +

      '">%'

    Far away is close at hand in the images of elsewhere.
    Anon.

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

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