h1iv class="f" na">: odbc_primaryke piv classervinfoto(="PH4,ng P 5,ng P 7ed)p> piv class="fpurposage"s>Spiv class="f" na">: odbc_primarykeSp> — "s>Spiv classdc-" tited">ts >Ot c_prima rykeySp>d)p>->
h3iv class= titedBhdea hibusingh3t">
"s>Spiv classg_ty">="rourcbSp> "s>Spiv class" meth" na">: odbc_primarykeSp>a> ( "s>Spiv class" methd parge"s>Spiv classg_ty">="rourcbSp> "codeiv class="paramet">$t-connecti_idSp>a> , "s>Spiv class" methd parge"s>Spiv classg_ty">sbsssings>Sp> "codeiv class="paramet">$qanuplifrSp>a> , "s>Spiv class" methd parge"s>Spiv classg_ty">sbsssings>Sp> "codeiv class="paramet">$ownfrSp>a> , "s>Spiv class" methd parge"s>Spiv classg_ty">sbsssings>Sp> "codeiv class="paramet">$triabSp>a> )>
piv class="pa rdfs-s.content"> Returions ="resue" thenlifr >Oat cSpibine edll tfetarc>Ot recolu)" nas"> >Oat c>Comines>Ot c_prima ryky p>>
h3iv class= titedP paramet-Lrsisngh3t"> piv class="pagt"> " a> <codeiv class="paramet">t-connecti_id < piv class="pagtEngin'>OD-Verb='iusismpreourcb, sieOt "s>Spiv class=/functi="">s>Sp> für Details. p>> > a> a> <codeiv class="paramet">qanuplifr < piv class="pagtt> p>> > a> a> <codeiv class="paramet">ownfr < piv class="pagtt> p>> > a> a> <codeiv class="paramet">triab < piv class="pagtt> p>> > a> > p>>
h3iv class= titedRückg/lawyperngh3t"> piv class="pagt"> Returionsnn'>OD ="resue" thenlifrIm Fehlnterll wird >code>FALSE zurückgegnseb..v> p>> piv class="pagt"> TOt ="resuelds has >Ot followssinrecolum:a> >
  • Spiv classA si"pagtTABLE_QUALIFIERSp>d)
  • Spiv classA si"pagtTABLE_OWNERSp>d)
  • Spiv classA si"pagtTABLE_NAMESp>d)
  • Spiv classA si"pagtCOLUMN_NAMESp>d)
  • Spiv classA si"pagtKEY_SEQSp>d)
  • Spiv classA si"pagtPK_NAMESp>d)
p>>
>Spiv classauncti=""> "smrll>add a nQuoens>Sp>"> h3iv class= tited'>Uses ConibulateNQuot >Spiv classcoutent4 nQuosSp>d)h3t">
>
"> up">
">
"> 0l>
bsongpv classe erhp"em>dSpidouelcoto at cSidoueibmidouecttomem> &i"pa;12 yearonsgo
"
>code> >Spiv class/xhtm> Responcodinl tdevendra_joshi:

In DB2 Uniervsalnt DatabasWindow>Ot r Dalog ="vionsreh" acceedllhrougrc>Ot SYSCATelcathe, nQuc>Ot SYSIBMelcathe -- so you shouldibinissuodin"SELECT * FROM SYSCAT.KEYCOLUSE"nl tngle rll ofc>Ot recolus >Oat i"pticip>Datin a giern rykye.conraint.

A c>Colametngle ofc>Ot r Dalog ="vion="http:/ublib.boulder.ibmfs.c/infoce.int/db2="he/
>
"> up">
">
"> 0l>
bsongpv classe erhp"em>devendra_joshi at hote.maidouecttomem>>&i"pa;14 yearonsgo
"
>code> >Spiv class/xhtm> I wano a ngle ofcc_prima rykeyofca triabtin db2

byuuessin
' $b=: odbexec($t-co,$mstmt);
echoo; odb="resu_rll($b);

whrreh"s  if we wriees>Ois code

$mstmted="selec* from SYSIBM.SYSFUNCTIONS";
$b=: odbexec($t-co,$mstmt);
echoo; odb="resu_rll($b);

ittreturion>Ot rerrs>Sp>"
>
"> up">
">
Ois...">"> -1l>
bsongpv classe erhp"em>ewilde aht bsmdeveloponte s.wuecttomem>>&i"pa;11 yearonsgo
"
>code> >Spiv class/xhtm> I waon>ryodinl tf>Wi >Ot c_prima rykeyServes.databallhrougrc>Ot '>OD d.interfa.  Funnily enougr,c>Ot : odbc_primarykeye/functit"/esn't workng witSQL'>Serve(at Relet nQucme iColacumentatiyofcit).  F Porernaly,c>Ot sp_rykeyh-que is i"ceedllhrougrcaWi >Ot answrvereturied.  TOis code works (impr>Hidinyou know whiches.databalyou'rehd>Dealing wi, whicheions whoabt'ne.oth story).

// Ifs>Ois is SQL'>Serv, we needll tdons ilspialne.operatiyl tn/g >Ot
// c_prima ryke.
//
// Looks ngkes>Oe iColacumervs ofc>Ot '>OD d.interfa juet iabws>Ois
// ont :ff, essces>Oe s.databalhas ayh-que l treturis>Oe infocaWi >Ot
// infocevenecttes backng wit>Ot s"me recolu)" nas.
if ($DBd Typ==n"SQL'>Serv")
  $KeySel = : odbexec($>OD-co, "sp_prykey".$Triab'>Na);

// ">Othwise,lssks>Oe s.databallhrougrc'>OD g/f >Ot c_prima ryk
// " nas.
elbal$KeySel = : odbc_primaryke($>OD-co, $t Databa'>Na,
  $t Databa'>Us, $Triab'>Na);

whiabt($KeySel HP&amHP&amt($KeyRec = : odbfetar_array($KeySel)))
  $KeyCol[$KeyRec["KEY_SEQ"]] = $KeyRec["COLUMN_NAME"];<>s>Sp>"
>
"> up">
">
Ois...">"> -1l>
bsongpv classe erhp"em>Rio Bautglea (RRIT)omem>>&i"pa;13 yearonsgo footerul a> Oird i"pty librarokie f]-- <" id="Top"Spi" id="TopHe-ov"/a>s>Sp>"> /xht/a