WsSQL_ESPWebServiceGuide.xml 128 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
  3. "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
  4. <book lang="en_US" xml:base="../">
  5. <bookinfo>
  6. <title>WsSQL ESP Web Service Guide</title>
  7. <mediaobject>
  8. <imageobject>
  9. <imagedata fileref="images/redswooshWithLogo3.jpg" />
  10. </imageobject>
  11. </mediaobject>
  12. <author>
  13. <surname>Boca Raton Documentation Team</surname>
  14. </author>
  15. <legalnotice>
  16. <para>We welcome your comments and feedback about this document via
  17. email to <email>docfeedback@hpccsystems.com</email> Please include
  18. <emphasis role="bold">Documentation Feedback</emphasis> in the subject
  19. line and reference the document name, page numbers, and current Version
  20. Number in the text of the message.</para>
  21. <para>LexisNexis and the Knowledge Burst logo are registered trademarks
  22. of Reed Elsevier Properties Inc., used under license. Other products,
  23. logos, and services may be trademarks or registered trademarks of their
  24. respective companies. All names and example data used in this manual are
  25. fictitious. Any similarity to actual persons, living or dead, is purely
  26. coincidental.</para>
  27. <para></para>
  28. </legalnotice>
  29. <xi:include href="common/Version.xml" xpointer="xpointer(//*[@id='FooterInfo'])"
  30. xmlns:xi="http://www.w3.org/2001/XInclude" />
  31. <xi:include href="common/Version.xml" xpointer="xpointer(//*[@id='DateVer'])"
  32. xmlns:xi="http://www.w3.org/2001/XInclude" />
  33. <corpname>HPCC Systems</corpname>
  34. <xi:include href="common/Version.xml" xpointer="xpointer(//*[@id='Copyright'])"
  35. xmlns:xi="http://www.w3.org/2001/XInclude" />
  36. <mediaobject role="logo">
  37. <imageobject>
  38. <imagedata fileref="images/LN_Rightjustified.jpg" />
  39. </imageobject>
  40. </mediaobject>
  41. </bookinfo>
  42. <chapter>
  43. <title>Introduction</title>
  44. <para>The WsSQL Web service is an add-on service that provides an SQL
  45. interface into HPCC Systems. The Web service accepts a subset of prepared
  46. and standard SQL queries. This provides access to most HPCC data and
  47. published queries over HTTP or HTTPS using SOAP or REST interfaces.</para>
  48. <para>The WsSQL service maps HPCC logical files to RDBMS tables. HPCC
  49. Published Queries are exposed as RDBMS Stored Procedures.</para>
  50. <para>The WsSQL service also provides convenient methods to obtain system
  51. information, metadata, and results from previously run queries.</para>
  52. <para>This service is intended to be used in a programmatic fashion (for
  53. example, via database drivers), but can also be used in an interactive
  54. fashion by users who are more comfortable using SQL than ECL. This makes
  55. it possible to submit ad-hoc queries without learning ECL.</para>
  56. <para>The service exposes HPCC logical files as RDB tables.</para>
  57. <para><itemizedlist mark="bullet">
  58. <listitem>
  59. <para>HPCC Logical File &lt;-&gt; RDB Table</para>
  60. </listitem>
  61. <listitem>
  62. <para>HPCC Record Fields &lt;-&gt; RDB Table Columns</para>
  63. </listitem>
  64. <listitem>
  65. <para>HPCC Published query &lt;-&gt; RDB Stored Procedure</para>
  66. </listitem>
  67. <listitem>
  68. <para>Provides HPCC system and data RDB metadata</para>
  69. </listitem>
  70. <listitem>
  71. <para>Supports subset of SQL syntax</para>
  72. </listitem>
  73. <listitem>
  74. <para>Non-transactional</para>
  75. </listitem>
  76. <listitem>
  77. <para>Provides means for utilizing HPCC index files for faster
  78. reads.</para>
  79. <para></para>
  80. </listitem>
  81. </itemizedlist></para>
  82. <sect1>
  83. <title>Supported File Types</title>
  84. <para>The WsSQL service supports all HPCC file types except :</para>
  85. <para><itemizedlist>
  86. <listitem>
  87. <para>XML</para>
  88. </listitem>
  89. <listitem>
  90. <para>Files with Nested Child Datasets</para>
  91. </listitem>
  92. <listitem>
  93. <para>Files without record layout in its metadata.</para>
  94. <para>The WsSQL service <emphasis role="bold">only supports files
  95. which contain the record definition in the logical file's
  96. metadata.</emphasis> Sprayed files do not contain this metadata.
  97. This metadata exists on any file or index which is written to the
  98. HPCC Distributed File System (DFS). Sprayed data files typically
  99. undergo some processing and an OUTPUT of the transformed data to
  100. disk before use, so this should not interfere with the service's
  101. usefulness. You can use the
  102. <emphasis>CreateTableAndLoad</emphasis> method to produce a usable
  103. file from a sprayed file or one on a landing zone. See <link
  104. linkend="CreateTableAndLoad">CreateTableAndLoad</link> for
  105. details.</para>
  106. </listitem>
  107. </itemizedlist></para>
  108. </sect1>
  109. </chapter>
  110. <chapter>
  111. <title>Setup</title>
  112. <para>The WsSQL service is included in the HPCC Platform. </para>
  113. <sidebar>
  114. <para>Prior to version 7.0, WsSQL was an add-on product and was
  115. installed separately. If you have a system configured with WsSQL prior
  116. to version 7.0, you should uninstall WsSQL before upgrading the
  117. platform.</para>
  118. </sidebar>
  119. <sect1 id="Quick_Start" role="nobrk">
  120. <title>Configuration </title>
  121. <para>We recommend taking the time to read this manual in its entirety;
  122. however, the following is a quick start summary of steps.</para>
  123. <para></para>
  124. <sect2>
  125. <title>Configure Using Wizard</title>
  126. <para><orderedlist>
  127. <listitem>
  128. <para>Once Configuration Manager is running:</para>
  129. </listitem>
  130. <listitem>
  131. <para>Create a new environment using the wizard.</para>
  132. <para>The WsSQL service is automatically added and its service
  133. binding is created in the ESP Server's configuration.</para>
  134. </listitem>
  135. <listitem>
  136. <para>Save the environment file.</para>
  137. </listitem>
  138. <listitem>
  139. <para>Copy your environment.xml file to all servers.</para>
  140. <para><programlisting># for example
  141. sudo -u hpcc cp /etc/HPCCSystems/source/NewEnvironment.xml /etc/HPCCSystems/environment.xml</programlisting></para>
  142. </listitem>
  143. <listitem>
  144. <para>Exit Configuration manager.</para>
  145. </listitem>
  146. <listitem>
  147. <para>Restart the system.</para>
  148. </listitem>
  149. <listitem>
  150. <para>Access the WsSQL interface in your browser (port
  151. 8510).</para>
  152. </listitem>
  153. <listitem>
  154. <para>Run the Echo method to confirm connectivity. See
  155. <citebiblioid><link
  156. linkend="echotest">Echo</link></citebiblioid>.</para>
  157. </listitem>
  158. </orderedlist></para>
  159. </sect2>
  160. <sect2>
  161. <title>Configure Manually</title>
  162. <para>This method is useful when adding the WsSQL service to an
  163. existing system that did not have a service configured or to add an
  164. additional WsSql service.</para>
  165. <para><orderedlist>
  166. <listitem>
  167. <para>Once Configuration Manager is running:</para>
  168. </listitem>
  169. <listitem>
  170. <para>Open an environment file (*.xml) in Advanced Mode.</para>
  171. <para>If you are adding WsSQL to an existing system, open an
  172. environment file that matches the live environment.xml. It is
  173. highlighted.</para>
  174. </listitem>
  175. <listitem>
  176. <para>Check the Write Access box.</para>
  177. </listitem>
  178. <listitem>
  179. <para>Right-click on the <emphasis
  180. role="bold">Software</emphasis> portion of the tree in the left
  181. panel, and select <emphasis role="bold">New ESP
  182. Service</emphasis> &gt; <emphasis role="bold">ws_sql</emphasis>
  183. .</para>
  184. <para><graphic fileref="images/AddWsSQLService.jpg" /></para>
  185. <para>This adds a definition for the service.</para>
  186. </listitem>
  187. <listitem>
  188. <para>Select the <emphasis role="bold">ESP</emphasis> component,
  189. then select the ESP Service Bindings tab.</para>
  190. <para><graphic
  191. fileref="images/WsSQLServiceBinding2.jpg" /></para>
  192. </listitem>
  193. <listitem>
  194. <para>Provide the name of the service to bind and the port.
  195. (Default port is 8510)</para>
  196. </listitem>
  197. <listitem>
  198. <para>Save the environment file.</para>
  199. </listitem>
  200. <listitem>
  201. <para>Copy your environment.xml file to all servers</para>
  202. <programlisting># for example
  203. sudo -u hpcc cp /etc/HPCCSystems/source/NewEnvironment.xml /etc/HPCCSystems/environment.xml</programlisting>
  204. </listitem>
  205. <listitem>
  206. <para>Exit Configuration manager.</para>
  207. </listitem>
  208. <listitem>
  209. <para>Restart the system.</para>
  210. </listitem>
  211. <listitem>
  212. <para>Access the WsSQL interface in your browser:</para>
  213. <para>Using <emphasis>http://nnn.nnn.nnn.nnn:pppp</emphasis>
  214. (where nnn.nnn.nnn.nnn is your ESP Server's IP Address and pppp
  215. is the WsSQL service port. The default port is 8510)</para>
  216. </listitem>
  217. <listitem>
  218. <para>Run the Echo method to confirm connectivity. See
  219. <citebiblioid><link
  220. linkend="echotest">Echo</link></citebiblioid>.</para>
  221. </listitem>
  222. </orderedlist></para>
  223. </sect2>
  224. </sect1>
  225. </chapter>
  226. <chapter>
  227. <title>Using HPCC Files as a data source</title>
  228. <para>Once installed and configured, the WsSQL service will process
  229. submitted SQL statements and generate dynamic ECL code. The code is
  230. submitted to and executed by your HPCC Platform. The result set is
  231. returned to your application.</para>
  232. <para><variablelist>
  233. <varlistentry>
  234. <term>Note:</term>
  235. <listitem>
  236. <para>The WsSQL service <emphasis role="bold">only supports files
  237. which contain the record definition in the logical file's
  238. metadata.</emphasis> Sprayed files do not contain this metadata.
  239. This metadata exists on any file or index which is written to the
  240. HPCC Distributed File System (DFS). Sprayed data files typically
  241. undergo some processing and an OUTPUT of the transformed data to
  242. disk before use, so this should not interfere with the service's
  243. usefulness. You can use the
  244. <emphasis>CreateTableAndLoad</emphasis> method to produce a usable
  245. file from a sprayed file or one on a landing zone. See <link
  246. linkend="CreateTableAndLoad">CreateTableAndLoad</link> for
  247. details.</para>
  248. </listitem>
  249. </varlistentry>
  250. </variablelist></para>
  251. <para>In addition, you can utilize indexes on the HPCC in one of two
  252. ways:</para>
  253. <orderedlist numeration="arabic">
  254. <listitem>
  255. <para>Provide SQL hints to tell service to use a specific index for
  256. your query.</para>
  257. <para>For example:</para>
  258. <programlisting>USEINDEX(TutorialPersonByZipIndex)</programlisting>
  259. </listitem>
  260. <listitem>
  261. <para>Specify the related indexes in the HPCC logical file
  262. description.</para>
  263. </listitem>
  264. </orderedlist>
  265. <sect1 role="nobrk">
  266. <title>Index Annotations</title>
  267. <para>The WsSQL service attempts to perform index based reads whenever
  268. possible. However, in order to take advantage of index reads, the target
  269. HPCC files need to be annotated with the pertinent index file names.
  270. This is accomplished by adding the following key/value entry on the
  271. file's description using ECL Watch.</para>
  272. <para>From a logical file's details page, enter the information in the
  273. Description entry box, then press the <emphasis role="bold">Save
  274. Description</emphasis> button.</para>
  275. <para>This information is used by the service to decide if an index
  276. fetch is possible for a query on the base file.</para>
  277. <sect2>
  278. <title><emphasis role="bold">On source file:</emphasis></title>
  279. <para><emphasis role="bold">XDBC:RelIndexes=
  280. [</emphasis><emphasis><emphasis
  281. role="bold"><emphasis>fullLogicalFilename1</emphasis></emphasis></emphasis><emphasis
  282. role="bold">;<emphasis>
  283. fullLogicalFilename2</emphasis></emphasis><emphasis
  284. role="bold">]</emphasis></para>
  285. <para></para>
  286. <para>Example:</para>
  287. <programlisting>XDBC:RelIndexes=[tutorial::yn::peoplebyzipindex;
  288. tutorial::yn::peoplebyzipindex2;
  289. tutorial::yn::peoplebyzipindex3]</programlisting>
  290. <para>In this example, the source file has three indexes
  291. available.</para>
  292. <para>You can add annotations using the <link
  293. linkend="SetRelatedIndexes">SetRelatedIndexes</link> method.</para>
  294. </sect2>
  295. <sect2 role="brk">
  296. <title><emphasis role="bold">On the index file:</emphasis></title>
  297. <para><emphasis
  298. role="bold">XDBC:PosField=[</emphasis><emphasis>indexPositionFieldName</emphasis><emphasis
  299. role="bold">]</emphasis></para>
  300. <para></para>
  301. <para>Example:</para>
  302. <programlisting>XDBC:PosField=[fpos]</programlisting>
  303. <para>The FilePosition field (fpos) can have any name, so it must be
  304. specified in the metadata so the service knows which field is the
  305. fileposition.</para>
  306. <para>Simply enter the information in the description entry box, then
  307. press the <emphasis role="bold">Save Description</emphasis>
  308. button.</para>
  309. <variablelist>
  310. <varlistentry>
  311. <term>Note:</term>
  312. <listitem>
  313. <para>You should enter this information BEFORE publishing any
  314. query using the data file or indexes. Published queries lock the
  315. file and would prevent editing the metadata.</para>
  316. </listitem>
  317. </varlistentry>
  318. </variablelist>
  319. <para></para>
  320. </sect2>
  321. </sect1>
  322. </chapter>
  323. <chapter>
  324. <title>Methods</title>
  325. <para>These methods are included in the WsSQL service interface:</para>
  326. <para></para>
  327. <itemizedlist>
  328. <listitem>
  329. <para><emphasis role="bold">Echo</emphasis></para>
  330. <para>This method is provided to test end-to-end communication. The
  331. Input string is echoed in response.</para>
  332. </listitem>
  333. <listitem>
  334. <para><emphasis role="bold">GetDBSystemInfo</emphasis></para>
  335. <para>You can use this method to gather version information from the
  336. HPCC Platform.</para>
  337. </listitem>
  338. <listitem>
  339. <para><emphasis role="bold">GetMetadata</emphasis></para>
  340. <para>This method provides metadata you can use to create a view or
  341. model of the target HPCC system as a SQL accessible DB. You can
  342. request Tables, Stored Procedures, and/or Targetclusters.</para>
  343. </listitem>
  344. <listitem>
  345. <para><emphasis role="bold">ExecuteSQL</emphasis></para>
  346. <para>Use this method to submit standard (non-prepared) SQL queries.
  347. This method accepts free-hand SQL text (see supported grammar
  348. below).</para>
  349. </listitem>
  350. <listitem>
  351. <para><emphasis role="bold">GetRelatedIndexes</emphasis></para>
  352. <para>This method retrieves information from a logical file's
  353. description about related indexes.</para>
  354. </listitem>
  355. <listitem>
  356. <para><emphasis role="bold">GetResults</emphasis></para>
  357. <para>This method provides results from previously executed
  358. queries.</para>
  359. </listitem>
  360. <listitem>
  361. <para><emphasis role="bold">PrepareSQL</emphasis></para>
  362. <para>This method provides the ability to submit a free-hand SQL
  363. request for later use as a parameterized query. It compiles the query
  364. and returns the Workunit ID (WUID). This WUID is later used to execute
  365. the query with provided input parameters using the ExecutePreparedSQL
  366. method. This is ideal for queries which are executed many times with
  367. different values.</para>
  368. </listitem>
  369. <listitem>
  370. <para><emphasis role="bold">ExecutePreparedSQL</emphasis></para>
  371. <para>This method executes a previously created parameterized SQL
  372. query. The query is referenced using a Workunit ID (WUID), which is
  373. returned from the PrepareSQL method. The caller can specify sequence
  374. of input parameters as key-value pairs, which are bound to the
  375. precompiled query.</para>
  376. </listitem>
  377. <listitem>
  378. <para><emphasis role="bold">CreateTableAndLoad</emphasis></para>
  379. <para>This method reads a logical file or a file on a landing zone and
  380. creates a new table and loads the data from the source file creating a
  381. table (logical file) that WsSQL can use. This function is intended to
  382. use when you have a logical file without metadata or to import a new
  383. file into an HPCC platform.</para>
  384. </listitem>
  385. <listitem>
  386. <para><emphasis role="bold">SetRelatedIndexes</emphasis></para>
  387. <para>This method adds information to a logical file's description
  388. that WsSQL uses as an annotation of a related index.</para>
  389. </listitem>
  390. </itemizedlist>
  391. <sect1 id="echotest">
  392. <title>Echo</title>
  393. <para>This function takes an input string and "echoes" the value in its
  394. result.</para>
  395. <para>This function is intended for end-to-end connectivity testing. A
  396. successful response indicates a good connection to the server hosting
  397. the Ws-SQL Web service. This function is designed for connectivity
  398. testing.</para>
  399. <para>We recommend using this function as a first step of the
  400. application development process.</para>
  401. <sect2>
  402. <title>Sample Input XML</title>
  403. <para><programlisting>&lt;soap:Envelope&gt;
  404. &lt;soap:Body&gt;
  405. &lt;EchoRequest&gt;
  406. &lt;Request&gt;<emphasis role="bluebold">StringToEcho</emphasis>&lt;/Request&gt;
  407. &lt;/EchoRequest&gt;
  408. &lt;/soap:Body&gt;
  409. &lt;/soap:Envelope&gt;
  410. </programlisting></para>
  411. </sect2>
  412. <sect2>
  413. <title>Request Tag Descriptions</title>
  414. <para><informaltable colsep="1" frame="all" rowsep="1">
  415. <tgroup cols="3">
  416. <colspec colwidth="200pt" />
  417. <colspec colwidth="40 pt" />
  418. <colspec />
  419. <tbody>
  420. <row>
  421. <entry><?dbfo bgcolor="LightCyan"?>Tag Name</entry>
  422. <entry><?dbfo bgcolor="LightCyan"?>Req?</entry>
  423. <entry><?dbfo bgcolor="LightCyan"?>Description</entry>
  424. </row>
  425. <row>
  426. <entry><programlisting role="wsig">EchoRequest</programlisting></entry>
  427. <entry>N</entry>
  428. <entry>Structure containing the request</entry>
  429. </row>
  430. <row>
  431. <entry><programlisting role="wsig"> Request</programlisting></entry>
  432. <entry>N</entry>
  433. <entry>String to echo in result</entry>
  434. </row>
  435. </tbody>
  436. </tgroup>
  437. </informaltable></para>
  438. </sect2>
  439. <sect2>
  440. <title>Response Tag Descriptions</title>
  441. <para><informaltable colsep="1" frame="all" rowsep="1">
  442. <tgroup cols="2">
  443. <colspec colwidth="200 pt" />
  444. <colspec />
  445. <tbody>
  446. <row>
  447. <entry><?dbfo bgcolor="LightCyan"?>Tag Name</entry>
  448. <entry><?dbfo bgcolor="LightCyan"?>Description</entry>
  449. </row>
  450. <row>
  451. <entry><programlisting role="wsig">EchoResponse</programlisting></entry>
  452. <entry>Structure containing response</entry>
  453. </row>
  454. <row>
  455. <entry><programlisting role="wsig"> Response</programlisting></entry>
  456. <entry>Response</entry>
  457. </row>
  458. </tbody>
  459. </tgroup>
  460. </informaltable></para>
  461. </sect2>
  462. </sect1>
  463. <sect1>
  464. <title>GetDBSystemInfo</title>
  465. <para>This method allows you to get HPCC System version
  466. information.</para>
  467. <sect2>
  468. <title>Sample Input XML</title>
  469. <para><programlisting>&lt;soap:Envelope&gt;
  470. &lt;soap:Body&gt;
  471. &lt;GetDBSystemInfoRequest&gt;
  472. &lt;IncludeAll&gt;<emphasis role="bluebold">1</emphasis>&lt;/IncludeAll&gt;
  473. &lt;/GetDBSystemInfoRequest&gt;
  474. &lt;/soap:Body&gt;
  475. &lt;/soap:Envelope&gt;
  476. </programlisting></para>
  477. </sect2>
  478. <sect2>
  479. <title>Request Tag Descriptions</title>
  480. <para><informaltable colsep="1" frame="all" rowsep="1">
  481. <tgroup cols="3">
  482. <colspec colwidth="200pt" />
  483. <colspec colwidth="40 pt" />
  484. <colspec />
  485. <tbody>
  486. <row>
  487. <entry><?dbfo bgcolor="LightCyan"?>Tag Name</entry>
  488. <entry><?dbfo bgcolor="LightCyan"?>Req?</entry>
  489. <entry><?dbfo bgcolor="LightCyan"?>Description</entry>
  490. </row>
  491. <row>
  492. <entry><programlisting role="wsig">GetDBSystemInfoRequest</programlisting></entry>
  493. <entry>Y</entry>
  494. <entry>Structure containing the request</entry>
  495. </row>
  496. <row>
  497. <entry><programlisting role="wsig"> IncludeAll</programlisting></entry>
  498. <entry>N</entry>
  499. <entry>If set to 1 or true, all available information is
  500. returned</entry>
  501. </row>
  502. </tbody>
  503. </tgroup>
  504. </informaltable></para>
  505. </sect2>
  506. <sect2>
  507. <title>Response Tag Descriptions</title>
  508. <para><informaltable colsep="1" frame="all" rowsep="1">
  509. <tgroup cols="2">
  510. <colspec colwidth="200pt" />
  511. <colspec />
  512. <tbody>
  513. <row>
  514. <entry><?dbfo bgcolor="LightCyan"?>Tag Name</entry>
  515. <entry><?dbfo bgcolor="LightCyan"?>Description</entry>
  516. </row>
  517. <row>
  518. <entry><programlisting role="wsig">GetDBSystemInfoResponse</programlisting></entry>
  519. <entry>Structure containing response</entry>
  520. </row>
  521. <row>
  522. <entry><programlisting role="wsig"> Exceptions</programlisting></entry>
  523. <entry>Structure containing exceptions. See <link
  524. linkend="ExceptionStructure">Exceptions Structure</link> in
  525. Common Structures</entry>
  526. </row>
  527. <row>
  528. <entry><programlisting role="wsig"> Name</programlisting></entry>
  529. <entry>Name.</entry>
  530. </row>
  531. <row>
  532. <entry><programlisting role="wsig"> FullVersion</programlisting></entry>
  533. <entry>Full Version of HPCC Platform</entry>
  534. </row>
  535. <row>
  536. <entry><programlisting role="wsig"> Major</programlisting></entry>
  537. <entry>Major of HPCC Platform</entry>
  538. </row>
  539. <row>
  540. <entry><programlisting role="wsig"> Minor</programlisting></entry>
  541. <entry>Minor of HPCC Platform</entry>
  542. </row>
  543. <row>
  544. <entry><programlisting role="wsig"> Point</programlisting></entry>
  545. <entry>Point of HPCC Platform</entry>
  546. </row>
  547. <row>
  548. <entry><programlisting role="wsig"> Project</programlisting></entry>
  549. <entry>Project of HPCC Platform</entry>
  550. </row>
  551. <row>
  552. <entry><programlisting role="wsig"> Maturity</programlisting></entry>
  553. <entry>Maturity of HPCC Platform</entry>
  554. </row>
  555. <row>
  556. <entry><programlisting role="wsig"> WsSQLFullVersion</programlisting></entry>
  557. <entry>Full Version of WsSQL</entry>
  558. </row>
  559. <row>
  560. <entry><programlisting role="wsig"> WsSQLMajor </programlisting></entry>
  561. <entry>Major of WsSQL</entry>
  562. </row>
  563. <row>
  564. <entry><programlisting role="wsig"> WsSQLMinor </programlisting></entry>
  565. <entry>Minor of WsSQL</entry>
  566. </row>
  567. <row>
  568. <entry><programlisting role="wsig"> WsSQLPoint </programlisting></entry>
  569. <entry>Point of WsSQL</entry>
  570. </row>
  571. <row>
  572. <entry><programlisting role="wsig"> WsSQLProject </programlisting></entry>
  573. <entry>Project of WsSQL</entry>
  574. </row>
  575. <row>
  576. <entry><programlisting role="wsig"> WsSQLMaturity</programlisting></entry>
  577. <entry>Maturity of WsSQL</entry>
  578. </row>
  579. </tbody>
  580. </tgroup>
  581. </informaltable></para>
  582. </sect2>
  583. </sect1>
  584. <sect1>
  585. <title>GetDBMetaData</title>
  586. <para>This methods allows you to query the HPCC Platform and get
  587. metadata to use to create a view or model of the target HPCC system as a
  588. SQL accessible DB.</para>
  589. <para>You can request one or more of the followinfg:</para>
  590. <itemizedlist>
  591. <listitem>
  592. <para>Tables (Logical files in the HPCC Cluster)</para>
  593. </listitem>
  594. <listitem>
  595. <para>Stored Procedures (Published Queries)</para>
  596. </listitem>
  597. <listitem>
  598. <para>TargetClusters</para>
  599. </listitem>
  600. </itemizedlist>
  601. <sect2>
  602. <title>Sample Input XML</title>
  603. <para><programlisting>&lt;soap:Envelope&gt;
  604. &lt;soap:Body&gt;
  605. &lt;GetDBMetaDataRequest&gt;
  606. &lt;IncludeTables&gt;<emphasis role="bluebold">1</emphasis>&lt;/IncludeTables&gt;
  607. &lt;TableFilter/&gt;
  608. &lt;IncludeStoredProcedures&gt;<emphasis role="bluebold">1</emphasis>&lt;/IncludeStoredProcedures&gt;
  609. &lt;QuerySet/&gt;
  610. &lt;IncludeTargetClusters&gt;<emphasis role="bluebold">1</emphasis>&lt;/IncludeTargetClusters&gt;
  611. &lt;ClusterType/&gt;
  612. &lt;/GetDBMetaDataRequest&gt;
  613. &lt;/soap:Body&gt;
  614. &lt;/soap:Envelope&gt;</programlisting></para>
  615. </sect2>
  616. <sect2>
  617. <title>Request Tag Descriptions</title>
  618. <para><informaltable colsep="1" frame="all" rowsep="1">
  619. <tgroup cols="3">
  620. <colspec colwidth="200pt" />
  621. <colspec colwidth="40 pt" />
  622. <colspec />
  623. <tbody>
  624. <row>
  625. <entry><?dbfo bgcolor="LightCyan"?>Tag Name</entry>
  626. <entry><?dbfo bgcolor="LightCyan"?>Req?</entry>
  627. <entry><?dbfo bgcolor="LightCyan"?>Description</entry>
  628. </row>
  629. <row>
  630. <entry><programlisting role="wsig">GetDBMetaDataRequest</programlisting></entry>
  631. <entry>Y</entry>
  632. <entry>Structure containing the request</entry>
  633. </row>
  634. <row>
  635. <entry><programlisting role="wsig"> IncludeTables</programlisting></entry>
  636. <entry>N</entry>
  637. <entry>If set to 1 or true, available tables are included in
  638. response</entry>
  639. </row>
  640. <row>
  641. <entry><programlisting role="wsig"> TableFilter</programlisting></entry>
  642. <entry>N</entry>
  643. <entry>Filter for table results</entry>
  644. </row>
  645. <row>
  646. <entry><programlisting role="wsig"> IncludeStoredProcedures</programlisting></entry>
  647. <entry>N</entry>
  648. <entry>If set to 1 or true, available Stored Procedures are
  649. included in response</entry>
  650. </row>
  651. <row>
  652. <entry><programlisting role="wsig"> QuerySet</programlisting></entry>
  653. <entry>N</entry>
  654. <entry>QuerySet to use as filter for Stored procedures to
  655. return</entry>
  656. </row>
  657. <row>
  658. <entry><programlisting role="wsig"> IncludeTargetClusters</programlisting></entry>
  659. <entry>N</entry>
  660. <entry>If set to 1 or true, available Target Clusters are
  661. included in response</entry>
  662. </row>
  663. <row>
  664. <entry><programlisting role="wsig"> ClusterType</programlisting></entry>
  665. <entry>N</entry>
  666. <entry>Cluster type to use as filter</entry>
  667. </row>
  668. </tbody>
  669. </tgroup>
  670. </informaltable></para>
  671. </sect2>
  672. <sect2 role="brk">
  673. <title>Response Tag Descriptions</title>
  674. <para><informaltable colsep="1" frame="all" rowsep="1">
  675. <tgroup cols="2">
  676. <colspec colwidth="200pt" />
  677. <colspec />
  678. <tbody>
  679. <row>
  680. <entry><?dbfo bgcolor="LightCyan"?>Tag Name</entry>
  681. <entry><?dbfo bgcolor="LightCyan"?>Description</entry>
  682. </row>
  683. <row>
  684. <entry><programlisting role="wsig">GetDBMetaDataResponse</programlisting></entry>
  685. <entry>Structure containing response</entry>
  686. </row>
  687. <row>
  688. <entry><programlisting role="wsig"> Exceptions</programlisting></entry>
  689. <entry>Structure containing exceptions. See <link
  690. linkend="ExceptionStructure">Exceptions Structure</link> in
  691. Common Structures</entry>
  692. </row>
  693. <row>
  694. <entry><programlisting role="wsig"> TableCount</programlisting></entry>
  695. <entry>Count of available tables</entry>
  696. </row>
  697. <row>
  698. <entry><programlisting role="wsig"> Tables</programlisting></entry>
  699. <entry>Structure containing one or more tables</entry>
  700. </row>
  701. <row>
  702. <entry><programlisting role="wsig"> Table</programlisting></entry>
  703. <entry>Structure containing one table</entry>
  704. </row>
  705. <row>
  706. <entry><programlisting role="wsig"> Name</programlisting></entry>
  707. <entry>Table name</entry>
  708. </row>
  709. <row>
  710. <entry><programlisting role="wsig"> Columns</programlisting></entry>
  711. <entry>Structure containing one or more columns</entry>
  712. </row>
  713. <row>
  714. <entry><programlisting role="wsig"> Column</programlisting></entry>
  715. <entry>Column</entry>
  716. </row>
  717. <row>
  718. <entry><programlisting role="wsig"> Name</programlisting></entry>
  719. <entry>Column name</entry>
  720. </row>
  721. <row>
  722. <entry><programlisting role="wsig"> Type</programlisting></entry>
  723. <entry>Column data type (e.g., unsigned8, string3)</entry>
  724. </row>
  725. <row>
  726. <entry><programlisting role="wsig"> ECL</programlisting></entry>
  727. <entry>ECL Definition for the table</entry>
  728. </row>
  729. <row>
  730. <entry><programlisting role="wsig"> Format</programlisting></entry>
  731. <entry>Table format (e.g., FLAT, KEYED, etc)</entry>
  732. </row>
  733. <row>
  734. <entry><programlisting role="wsig"> ContentType</programlisting></entry>
  735. <entry>Content Type</entry>
  736. </row>
  737. <row>
  738. <entry><programlisting role="wsig"> Description</programlisting></entry>
  739. <entry>Description</entry>
  740. </row>
  741. <row>
  742. <entry><programlisting role="wsig"> IsKeyed</programlisting></entry>
  743. <entry>Boolean indicator: Is this an index?</entry>
  744. </row>
  745. <row>
  746. <entry><programlisting role="wsig"> IsSuper</programlisting></entry>
  747. <entry>Boolean indicator: Is this a superfile?</entry>
  748. </row>
  749. <row>
  750. <entry><programlisting role="wsig"> CsvQuote</programlisting></entry>
  751. <entry>Quote character (only valid for CSV files)</entry>
  752. </row>
  753. <row>
  754. <entry><programlisting role="wsig"> CsvSeparate</programlisting></entry>
  755. <entry>Separator character (only valid for CSV
  756. files)</entry>
  757. </row>
  758. <row>
  759. <entry><programlisting role="wsig"> CsvTerminate</programlisting></entry>
  760. <entry>Record terminator character (only valid for CSV
  761. files)</entry>
  762. </row>
  763. <row>
  764. <entry><programlisting role="wsig"> Group</programlisting></entry>
  765. <entry>Group</entry>
  766. </row>
  767. <row>
  768. <entry><programlisting role="wsig"> MaxRecordSize</programlisting></entry>
  769. <entry>Maximum record size</entry>
  770. </row>
  771. <row>
  772. <entry><programlisting role="wsig"> Modified</programlisting></entry>
  773. <entry>Date modified</entry>
  774. </row>
  775. <row>
  776. <entry><programlisting role="wsig"> NumParts</programlisting></entry>
  777. <entry>Number of file parts</entry>
  778. </row>
  779. <row>
  780. <entry><programlisting role="wsig"> Owner</programlisting></entry>
  781. <entry>Owner name</entry>
  782. </row>
  783. <row>
  784. <entry><programlisting role="wsig"> QuerySets</programlisting></entry>
  785. <entry>Structure containing one or more Query Sets</entry>
  786. </row>
  787. <row>
  788. <entry><programlisting role="wsig"> QuerySet</programlisting></entry>
  789. <entry>Structure containing one Query Set</entry>
  790. </row>
  791. <row>
  792. <entry><programlisting role="wsig"> Name</programlisting></entry>
  793. <entry>Query Name</entry>
  794. </row>
  795. <row>
  796. <entry><programlisting role="wsig"> QuerySetQueries</programlisting></entry>
  797. <entry>Structure containing one or more
  798. QuerySetQueries</entry>
  799. </row>
  800. <row>
  801. <entry><programlisting role="wsig"> QuerySetQuery</programlisting></entry>
  802. <entry>Structure containing one QuerySetQuery</entry>
  803. </row>
  804. <row>
  805. <entry><programlisting role="wsig"> Name</programlisting></entry>
  806. <entry>Query Name</entry>
  807. </row>
  808. <row>
  809. <entry><programlisting role="wsig"> Id</programlisting></entry>
  810. <entry>Query ID (for internal use and informational purposes
  811. only)</entry>
  812. </row>
  813. <row>
  814. <entry><programlisting role="wsig"> Wuid</programlisting></entry>
  815. <entry>Workunit ID</entry>
  816. </row>
  817. <row>
  818. <entry><programlisting role="wsig"> Suspended</programlisting></entry>
  819. <entry>Boolean indicator: Is the query suspended?</entry>
  820. </row>
  821. <row>
  822. <entry><programlisting role="wsig"> Signature</programlisting></entry>
  823. <entry>Query Signature</entry>
  824. </row>
  825. <row>
  826. <entry><programlisting role="wsig"> InParams</programlisting></entry>
  827. <entry>Structure containing one or more Input
  828. parameters</entry>
  829. </row>
  830. <row>
  831. <entry><programlisting role="wsig"> InParam</programlisting></entry>
  832. <entry>Structure containing one Input parameter</entry>
  833. </row>
  834. <row>
  835. <entry><programlisting role="wsig"> Name</programlisting></entry>
  836. <entry>Parameter name</entry>
  837. </row>
  838. <row>
  839. <entry><programlisting role="wsig"> Type</programlisting></entry>
  840. <entry>Parameter data type (e.g., string)</entry>
  841. </row>
  842. <row>
  843. <entry><programlisting role="wsig"> ResultSets</programlisting></entry>
  844. <entry>Structure containing one or more Result Sets (Only
  845. the first result set is returned from a WsSQL service
  846. request)</entry>
  847. </row>
  848. <row>
  849. <entry><programlisting role="wsig"> ResultSet</programlisting></entry>
  850. <entry>Structure containing one Result Set</entry>
  851. </row>
  852. <row>
  853. <entry><programlisting role="wsig"> Name</programlisting></entry>
  854. <entry>Result set name</entry>
  855. </row>
  856. <row>
  857. <entry><programlisting role="wsig"> OutParams</programlisting></entry>
  858. <entry>Structure containing one or more output
  859. parameters</entry>
  860. </row>
  861. <row>
  862. <entry><programlisting role="wsig"> OutParam</programlisting></entry>
  863. <entry>Structure containing one output parameter</entry>
  864. </row>
  865. <row>
  866. <entry><programlisting role="wsig"> Name</programlisting></entry>
  867. <entry>Parameter name</entry>
  868. </row>
  869. <row>
  870. <entry><programlisting role="wsig"> Type</programlisting></entry>
  871. <entry>Parameter data type (e.g., string)</entry>
  872. </row>
  873. <row>
  874. <entry><programlisting role="wsig"> QuerySetAliases</programlisting></entry>
  875. <entry>Structure containing one or more
  876. QuerySetAliases</entry>
  877. </row>
  878. <row>
  879. <entry><programlisting role="wsig"> QuerySetAlias</programlisting></entry>
  880. <entry>Structure containing one QuerySetAlias</entry>
  881. </row>
  882. <row>
  883. <entry><programlisting role="wsig"> Name</programlisting></entry>
  884. <entry>Query name</entry>
  885. </row>
  886. <row>
  887. <entry><programlisting role="wsig"> Id</programlisting></entry>
  888. <entry>Query Id</entry>
  889. </row>
  890. <row>
  891. <entry><programlisting role="wsig"> ClusterNames</programlisting></entry>
  892. <entry>Structure containing one or more
  893. TargetClusters</entry>
  894. </row>
  895. <row>
  896. <entry><programlisting role="wsig"> ClusterName</programlisting></entry>
  897. <entry>Structure containing one TargetCluster</entry>
  898. </row>
  899. </tbody>
  900. </tgroup>
  901. </informaltable></para>
  902. </sect2>
  903. </sect1>
  904. <sect1>
  905. <title>ExecuteSQL</title>
  906. <para>Use this method to submit standard (non-prepared) SQL queries. The
  907. <emphasis role="bold">SqlText</emphasis> input tag accepts free hand SQL
  908. text (see Supported SQL grammar below).</para>
  909. <para>If you are executing SQL using a SELECT or SELECT JOIN, you must
  910. specify the <emphasis role="bold">TargetCluster</emphasis>.</para>
  911. <para>If you are executing SQL that uses a CALL to a stored procedure,
  912. you must either fully qualify the procedure name (For example:
  913. Roxie.FindPeopleByZip) or specify the <emphasis
  914. role="bold">TargetQuerySet</emphasis> here. Parameters must be passed in
  915. order, not by name. You can retrieve the order using
  916. GetDBMetaData.</para>
  917. <para>To exclude the result schema in the result, set the <emphasis
  918. role="bold">SuppressXmlSchema</emphasis> option to 1 or true.</para>
  919. <para>For result set paging, you can limit the total query results and
  920. the initial page returned (<emphasis
  921. role="bold">ResultWindowStart</emphasis>, <emphasis
  922. role="bold">ResultWindowCount</emphasis>).</para>
  923. <sect2>
  924. <title>Sample Input XML</title>
  925. <para><programlisting>&lt;soap:Envelope&gt;
  926. &lt;ExecuteSQLRequest&gt;
  927. &lt;SqlText&gt;<emphasis role="bluebold">SELECT * from tutorial::yn::tutorialperson where lastname='JONES'</emphasis>&lt;/SqlText&gt;
  928. &lt;UserName&gt;<emphasis role="bluebold">Emily</emphasis>&lt;/UserName&gt;
  929. <emphasis role="greenbold">&lt;!-- Use either TargetCluster or TargetQuerySet, not both --&gt;</emphasis>
  930. <emphasis role="greenbold">&lt;!-- If stored procedure was fully qualified, you can omit TargetQuerySet --&gt;</emphasis>
  931. &lt;TargetCluster&gt;<emphasis role="bluebold">thor</emphasis>&lt;/TargetCluster&gt;
  932. &lt;TargetQuerySet&gt;<emphasis role="bluebold"></emphasis>&lt;/TargetQuerySet&gt;
  933. &lt;SuppressResults&gt;<emphasis role="bluebold">1</emphasis>&lt;/SuppressResults&gt;
  934. &lt;SuppressXmlSchema&gt;<emphasis role="bluebold">0</emphasis>&lt;/SuppressXmlSchema&gt;
  935. &lt;resultLimit&gt;<emphasis role="bluebold">100</emphasis>&lt;/resultLimit&gt;
  936. <emphasis role="greenbold">&lt;!-- For page loading --&gt;</emphasis>
  937. &lt;ResultWindowStart&gt;<emphasis role="bluebold">0</emphasis>&lt;/ResultWindowStart&gt;
  938. &lt;ResultWindowCount&gt;<emphasis role="bluebold">50</emphasis>&lt;/ResultWindowCount&gt;
  939. &lt;/ExecuteSQLRequest&gt;
  940. &lt;/soap:Envelope&gt;
  941. </programlisting></para>
  942. </sect2>
  943. <sect2 role="brk">
  944. <title>Request Tag Descriptions</title>
  945. <para><informaltable colsep="1" frame="all" rowsep="1">
  946. <tgroup cols="3">
  947. <colspec colwidth="200pt" />
  948. <colspec colwidth="40 pt" />
  949. <colspec />
  950. <tbody>
  951. <row>
  952. <entry><?dbfo bgcolor="LightCyan"?>Tag Name</entry>
  953. <entry><?dbfo bgcolor="LightCyan"?>Req?</entry>
  954. <entry><?dbfo bgcolor="LightCyan"?>Description</entry>
  955. </row>
  956. <row>
  957. <entry><programlisting role="wsig">ExecuteSQLRequest</programlisting></entry>
  958. <entry>Y</entry>
  959. <entry>Structure containing the request</entry>
  960. </row>
  961. <row>
  962. <entry><programlisting role="wsig"> SqlText</programlisting></entry>
  963. <entry>Y</entry>
  964. <entry>Free-hand SQL text (see Supported SQL grammar
  965. below)</entry>
  966. </row>
  967. <row>
  968. <entry><programlisting role="wsig"> UserName</programlisting></entry>
  969. <entry>N</entry>
  970. <entry>User Name to pass to HPCC. This is used as the job
  971. owner name in HPCC</entry>
  972. </row>
  973. <row>
  974. <entry><programlisting role="wsig"> TargetCluster</programlisting></entry>
  975. <entry>Y *</entry>
  976. <entry>If you are executing prepared SQL using a SELECT or
  977. SELECT JOIN, you must specify the TargetCluster.</entry>
  978. </row>
  979. <row>
  980. <entry><programlisting role="wsig"> TargetQuerySet</programlisting></entry>
  981. <entry>Y *</entry>
  982. <entry>If you are executing prepared SQL that uses a CALL to
  983. a stored procedure, you must either fully qualify the
  984. procedure name in the prepared SQL (For example:
  985. Roxie.FindPeopleByZip) or specify the TargetCluster
  986. here.</entry>
  987. </row>
  988. <row>
  989. <entry><programlisting role="wsig"> SuppressResults</programlisting></entry>
  990. <entry>N</entry>
  991. <entry>If set to 1 or true, query results are not included
  992. in response</entry>
  993. </row>
  994. <row>
  995. <entry><programlisting role="wsig"> SuppressXmlSchema</programlisting></entry>
  996. <entry>N</entry>
  997. <entry>If set to 1 or true, the query result schema is not
  998. included in response</entry>
  999. </row>
  1000. <row>
  1001. <entry><programlisting role="wsig"> Wait</programlisting></entry>
  1002. <entry>N</entry>
  1003. <entry>Timeout value in milliseconds. Use -1 for no
  1004. timeout</entry>
  1005. </row>
  1006. <row>
  1007. <entry><programlisting role="wsig"> resultLimit</programlisting></entry>
  1008. <entry>N</entry>
  1009. <entry>If set, the results can contain as many records as
  1010. this limit</entry>
  1011. </row>
  1012. <row>
  1013. <entry><programlisting role="wsig"> ResultWindowStart</programlisting></entry>
  1014. <entry>N</entry>
  1015. <entry>For use with page-loading, the starting record to
  1016. return</entry>
  1017. </row>
  1018. <row>
  1019. <entry><programlisting role="wsig"> ResultWindowCount</programlisting></entry>
  1020. <entry>N</entry>
  1021. <entry>For use with page-loading, the number of records to
  1022. include from the ResultWindowStart</entry>
  1023. </row>
  1024. </tbody>
  1025. </tgroup>
  1026. </informaltable><parameter>* One or the other is
  1027. required</parameter></para>
  1028. </sect2>
  1029. <sect2>
  1030. <title>Response Tag Descriptions</title>
  1031. <para><informaltable colsep="1" frame="all" rowsep="1">
  1032. <tgroup cols="2">
  1033. <colspec colwidth="200pt" />
  1034. <colspec />
  1035. <tbody>
  1036. <row>
  1037. <entry><?dbfo bgcolor="LightCyan"?>Tag Name</entry>
  1038. <entry><?dbfo bgcolor="LightCyan"?>Description</entry>
  1039. </row>
  1040. <row>
  1041. <entry><programlisting role="wsig">ExecuteSQLResponse</programlisting></entry>
  1042. <entry>Structure containing response</entry>
  1043. </row>
  1044. <row>
  1045. <entry><programlisting role="wsig"> Exceptions</programlisting></entry>
  1046. <entry>Structure containing exceptions. See <link
  1047. linkend="ExceptionStructure">Exceptions Structure</link> in
  1048. Common Structures</entry>
  1049. </row>
  1050. <row>
  1051. <entry><programlisting role="wsig"> ParentWuId</programlisting></entry>
  1052. <entry>The Workunit Id for the parent workunit (the one with
  1053. the prepared SQL)</entry>
  1054. </row>
  1055. <row>
  1056. <entry><programlisting role="wsig"> Result</programlisting></entry>
  1057. <entry>The query result</entry>
  1058. </row>
  1059. <row>
  1060. <entry><programlisting role="wsig"> Workunit</programlisting></entry>
  1061. <entry>Structure containing Workunit details. See <link
  1062. linkend="WUStructure">Workunit Structure</link> in Common
  1063. Structures</entry>
  1064. </row>
  1065. <row>
  1066. <entry><programlisting role="wsig"> resultLimit</programlisting></entry>
  1067. <entry>The submitted resultLimit</entry>
  1068. </row>
  1069. <row>
  1070. <entry><programlisting role="wsig"> ResultWindowStart</programlisting></entry>
  1071. <entry>The submitted ReslutWindowStart</entry>
  1072. </row>
  1073. <row>
  1074. <entry><programlisting role="wsig"> ResultWindowCount</programlisting></entry>
  1075. <entry>The submitted ResultWindowCount</entry>
  1076. </row>
  1077. </tbody>
  1078. </tgroup>
  1079. </informaltable></para>
  1080. </sect2>
  1081. </sect1>
  1082. <sect1>
  1083. <title>GetResults</title>
  1084. <para>This method allows you to get results from previously executed
  1085. queries. Use the <emphasis role="bold">Wuid</emphasis> returned from
  1086. <emphasis role="bold">ExecuteSQL</emphasis> or <emphasis
  1087. role="bold">PrepareSQL</emphasis>. This method is ideal for results
  1088. paging.</para>
  1089. <sect2>
  1090. <title>Sample Input XML</title>
  1091. <para><programlisting>&lt;soap:Envelope&gt;
  1092. &lt;soap:Body&gt;
  1093. &lt;GetResultsRequest&gt;
  1094. &lt;WuId&gt;<emphasis role="bluebold">W20140529-161930</emphasis>&lt;/WuId&gt;
  1095. &lt;SuppressXmlSchema&gt;<emphasis role="bluebold">1</emphasis>&lt;/SuppressXmlSchema&gt;
  1096. &lt;ResultWindowStart&gt;<emphasis role="bluebold">0</emphasis>&lt;/ResultWindowStart&gt;
  1097. &lt;ResultWindowCount&gt;<emphasis role="bluebold">0</emphasis>&lt;/ResultWindowCount&gt;
  1098. &lt;/GetResultsRequest&gt;
  1099. &lt;/soap:Body&gt;
  1100. &lt;/soap:Envelope&gt;</programlisting></para>
  1101. </sect2>
  1102. <sect2>
  1103. <title>Request Tag Descriptions</title>
  1104. <para><informaltable colsep="1" frame="all" rowsep="1">
  1105. <tgroup cols="3">
  1106. <colspec colwidth="200pt" />
  1107. <colspec colwidth="40 pt" />
  1108. <colspec />
  1109. <tbody>
  1110. <row>
  1111. <entry><?dbfo bgcolor="LightCyan"?>Tag Name</entry>
  1112. <entry><?dbfo bgcolor="LightCyan"?>Req?</entry>
  1113. <entry><?dbfo bgcolor="LightCyan"?>Description</entry>
  1114. </row>
  1115. <row>
  1116. <entry><programlisting role="wsig">GetResultsRequest</programlisting></entry>
  1117. <entry>Y</entry>
  1118. <entry>Structure containing the request</entry>
  1119. </row>
  1120. <row>
  1121. <entry><programlisting role="wsig"> WuId</programlisting></entry>
  1122. <entry>Y</entry>
  1123. <entry>Workunit Id (WUID)</entry>
  1124. </row>
  1125. <row>
  1126. <entry><programlisting role="wsig"> SuppressXmlSchema</programlisting></entry>
  1127. <entry>N</entry>
  1128. <entry>If set to 1 or true, the query result schema is not
  1129. included in response</entry>
  1130. </row>
  1131. <row>
  1132. <entry><programlisting role="wsig"> ResultWindowStart</programlisting></entry>
  1133. <entry>N</entry>
  1134. <entry>For use with page-loading, the starting record to
  1135. return</entry>
  1136. </row>
  1137. <row>
  1138. <entry><programlisting role="wsig"> ResultWindowCount</programlisting></entry>
  1139. <entry>N</entry>
  1140. <entry>For use with page-loading, the number of records to
  1141. include from the ResultWindowStart</entry>
  1142. </row>
  1143. </tbody>
  1144. </tgroup>
  1145. </informaltable></para>
  1146. </sect2>
  1147. <sect2>
  1148. <title>Response Tag Descriptions</title>
  1149. <para><informaltable colsep="1" frame="all" rowsep="1">
  1150. <tgroup cols="2">
  1151. <colspec colwidth="200pt" />
  1152. <colspec />
  1153. <tbody>
  1154. <row>
  1155. <entry><?dbfo bgcolor="LightCyan"?>Tag Name</entry>
  1156. <entry><?dbfo bgcolor="LightCyan"?>Description</entry>
  1157. </row>
  1158. <row>
  1159. <entry><programlisting role="wsig">GetResultsResponse</programlisting></entry>
  1160. <entry>Structure containing response</entry>
  1161. </row>
  1162. <row>
  1163. <entry><programlisting role="wsig"> Exceptions</programlisting></entry>
  1164. <entry>Structure containing exceptions. See <link
  1165. linkend="ExceptionStructure">Exceptions Structure</link> in
  1166. Common Structures</entry>
  1167. </row>
  1168. <row>
  1169. <entry><programlisting role="wsig"> Result</programlisting></entry>
  1170. <entry>The query result</entry>
  1171. </row>
  1172. <row>
  1173. <entry><programlisting role="wsig"> ResultWindowStart</programlisting></entry>
  1174. <entry>The submitted starting record</entry>
  1175. </row>
  1176. <row>
  1177. <entry><programlisting role="wsig"> ResultWindowCount</programlisting></entry>
  1178. <entry>The submitted record count</entry>
  1179. </row>
  1180. <row>
  1181. <entry><programlisting role="wsig"> Workunit</programlisting></entry>
  1182. <entry>Structure containing Workunit details. See <link
  1183. linkend="WUStructure">Workunit Structure</link> in Common
  1184. Structures</entry>
  1185. </row>
  1186. </tbody>
  1187. </tgroup>
  1188. </informaltable></para>
  1189. </sect2>
  1190. </sect1>
  1191. <sect1>
  1192. <title>PrepareSQL</title>
  1193. <para>Use this method to submit a free-hand SQL request for later use as
  1194. a parameterized query. This compiles the query and returns the <emphasis
  1195. role="bold">Wuid</emphasis>. This <emphasis role="bold">Wuid</emphasis>
  1196. is later used to execute the query with provided input parameters using
  1197. the <emphasis role="bold">ExecutePreparedSQL</emphasis> method.</para>
  1198. <para>This is ideal for queries which are executed many times with
  1199. different values.</para>
  1200. <para>The prepared SQL can contain any supported SQL grammar.</para>
  1201. <para>If you are executing SQL using a SELECT or SELECT JOIN, you must
  1202. specify the <emphasis role="bold">TargetCluster</emphasis>.</para>
  1203. <para>If you using a CALL to a stored procedure, you must either fully
  1204. qualify the procedure name in the SQL (For example:
  1205. Roxie.FindPeopleByZip) or specify the <emphasis
  1206. role="bold">TargetQuerySet</emphasis> here. Parameters must be passed in
  1207. order, not by name. You can retrieve the order using
  1208. GetDBMetaData.</para>
  1209. <para>Create parameters using a ? as a placeholder.</para>
  1210. <para><emphasis role="bold">Example:</emphasis></para>
  1211. <para><programlisting>select * from tutorial::yn::tutorialperson where lastname=?</programlisting>Later
  1212. you would submit a request to <emphasis
  1213. role="bold">ExecutePreparedSQL</emphasis> providing a value to use for
  1214. <emphasis>lastname</emphasis> as shown in the following example:</para>
  1215. <para><programlisting>&lt;soap:Envelope &gt;
  1216. &lt;soap:Body&gt;
  1217. &lt;ExecutePreparedSQLRequest&gt;
  1218. &lt;WuId&gt;<emphasis role="bluebold">W20140724-135811</emphasis>&lt;/WuId&gt;
  1219. &lt;TargetCluster&gt;<emphasis role="bluebold">thor</emphasis>&lt;/TargetCluster&gt;
  1220. &lt;SuppressResults&gt;<emphasis role="bluebold">0</emphasis>&lt;/SuppressResults&gt;
  1221. &lt;SuppressXmlSchema&gt;<emphasis role="bluebold">1</emphasis>&lt;/SuppressXmlSchema&gt;
  1222. &lt;resultLimit&gt;<emphasis role="bluebold">100</emphasis>&lt;/resultLimit&gt;
  1223. &lt;Variables&gt;
  1224. &lt;NamedValue&gt;
  1225. &lt;Name&gt;<emphasis role="bluebold">lastname</emphasis>&lt;/Name&gt;
  1226. &lt;Value&gt;<emphasis role="bluebold">JONES</emphasis>&lt;/Value&gt;
  1227. &lt;/NamedValue&gt;
  1228. &lt;/Variables&gt;
  1229. &lt;/ExecutePreparedSQLRequest&gt;
  1230. &lt;/soap:Body&gt;
  1231. &lt;/soap:Envelope&gt;</programlisting></para>
  1232. <sect2>
  1233. <title>Sample Input XML</title>
  1234. <para><programlisting>&lt;soap:Envelope &gt;
  1235. &lt;soap:Body&gt;
  1236. &lt;PrepareSQLRequest&gt;
  1237. &lt;SqlText&gt;<emphasis role="bluebold">select * from tutorial::yn::tutorialperson where lastname=?</emphasis>&lt;/SqlText&gt;
  1238. <emphasis role="greenbold">&lt;!-- Use either TargetCluster or TargetQuerySet, not both --&gt;</emphasis>
  1239. <emphasis role="greenbold">&lt;!-- If stored procedure is fully qualified, you can omit TargetQuerySet --&gt;</emphasis>
  1240. &lt;TargetCluster&gt;<emphasis role="bluebold">thor</emphasis>&lt;/TargetCluster&gt;
  1241. &lt;/PrepareSQLRequest&gt;
  1242. &lt;/soap:Body&gt;
  1243. &lt;/soap:Envelope&gt;</programlisting></para>
  1244. </sect2>
  1245. <sect2 role="brk">
  1246. <title>Request Tag Descriptions</title>
  1247. <para><informaltable colsep="1" frame="all" rowsep="1">
  1248. <tgroup cols="3">
  1249. <colspec colwidth="200pt" />
  1250. <colspec colwidth="40 pt" />
  1251. <colspec />
  1252. <tbody>
  1253. <row>
  1254. <entry><?dbfo bgcolor="LightCyan"?>Tag Name</entry>
  1255. <entry><?dbfo bgcolor="LightCyan"?>Req?</entry>
  1256. <entry><?dbfo bgcolor="LightCyan"?>Description</entry>
  1257. </row>
  1258. <row>
  1259. <entry><programlisting role="wsig">PrepareSQLRequest</programlisting></entry>
  1260. <entry>N</entry>
  1261. <entry>Structure containing request</entry>
  1262. </row>
  1263. <row>
  1264. <entry><programlisting role="wsig"> SqlText</programlisting></entry>
  1265. <entry>Y</entry>
  1266. <entry>Free-hand SQL text (see Supported SQL grammar
  1267. below)</entry>
  1268. </row>
  1269. <row>
  1270. <entry><programlisting role="wsig"> TargetCluster</programlisting></entry>
  1271. <entry>Y *</entry>
  1272. <entry>If you are executing prepared SQL using a SELECT or
  1273. SELECT JOIN, you must specify the TargetCluster</entry>
  1274. </row>
  1275. <row>
  1276. <entry><programlisting role="wsig"> TargetQuerySet</programlisting></entry>
  1277. <entry>Y *</entry>
  1278. <entry>If you are executing prepared SQL that uses a CALL to
  1279. a stored procedure, you must either fully qualify the
  1280. procedure name in the prepared SQL (For example:
  1281. Roxie.FindPeopleByZip) or specify the TargetCluster
  1282. here</entry>
  1283. </row>
  1284. <row>
  1285. <entry><programlisting role="wsig"> Wait</programlisting></entry>
  1286. <entry>N</entry>
  1287. <entry>Timeout value in milliseconds. Use -1 for no
  1288. timeout</entry>
  1289. </row>
  1290. </tbody>
  1291. </tgroup>
  1292. </informaltable><parameter>* One or the other is
  1293. required</parameter></para>
  1294. </sect2>
  1295. <sect2>
  1296. <title>Response Tag Descriptions</title>
  1297. <para><informaltable colsep="1" frame="all" rowsep="1">
  1298. <tgroup cols="2">
  1299. <colspec colwidth="200pt" />
  1300. <colspec />
  1301. <tbody>
  1302. <row>
  1303. <entry><?dbfo bgcolor="LightCyan"?>Tag Name</entry>
  1304. <entry><?dbfo bgcolor="LightCyan"?>Description</entry>
  1305. </row>
  1306. <row>
  1307. <entry><programlisting role="wsig">PrepareSQLResponse</programlisting></entry>
  1308. <entry>Structure containing response</entry>
  1309. </row>
  1310. <row>
  1311. <entry><programlisting role="wsig"> Exceptions</programlisting></entry>
  1312. <entry>Structure containing exceptions. See <link
  1313. linkend="ExceptionStructure">Exceptions Structure</link> in
  1314. Common Structures</entry>
  1315. </row>
  1316. <row>
  1317. <entry><programlisting role="wsig"> Workunit</programlisting></entry>
  1318. <entry>Structure containing Workunit details. See <link
  1319. linkend="WUStructure">Workunit Structure</link> in Common
  1320. Structures</entry>
  1321. </row>
  1322. <row>
  1323. <entry><programlisting role="wsig"> Result</programlisting></entry>
  1324. <entry>Structure containing result (if any)</entry>
  1325. </row>
  1326. </tbody>
  1327. </tgroup>
  1328. </informaltable></para>
  1329. </sect2>
  1330. </sect1>
  1331. <sect1>
  1332. <title>ExecutePreparedSQL</title>
  1333. <para>This method executes a previously created parameterized SQL
  1334. query.</para>
  1335. <para>The target compiled query is referenced using a Workunit ID
  1336. (<emphasis role="bold">Wuid</emphasis>), which is returned from the
  1337. <emphasis role="bold">PrepareSQL</emphasis> method. The caller can
  1338. specify sequence of input parameters as key-value pairs, which are bound
  1339. to the precompiled query.</para>
  1340. <para>The prepared SQL can contain any supported SQL grammar.</para>
  1341. <para>If you are executing prepared SQL using a SELECT or SELECT JOIN,
  1342. you can supply a <emphasis role="bold">TargetCluster</emphasis> to
  1343. override the one specified when you submitted the PrepareSQL request;
  1344. however, it must be a cluster of the same type.</para>
  1345. <para>If you want to limit the number of results, you must use a LIMIT
  1346. clause in you SQL query.</para>
  1347. <para>For result set paging, you can limit the total query results and
  1348. the initial page returned (<emphasis
  1349. role="bold">ResultWindowStart</emphasis>, <emphasis
  1350. role="bold">ResultWindowCount</emphasis>).</para>
  1351. <sect2>
  1352. <title>Sample Input XML</title>
  1353. <para><programlisting>&lt;soap:Envelope&gt;
  1354. &lt;soap:Body&gt;
  1355. &lt;ExecutePreparedSQLRequest&gt;
  1356. &lt;WuId&gt;<emphasis role="bluebold">W20140529-161930</emphasis>&lt;/WuId&gt;
  1357. &lt;UserName&gt;<emphasis role="bluebold">EmilyKate</emphasis>&lt;/UserName&gt;
  1358. <emphasis role="greenbold">&lt;!-- You can override the TargetCluster used in original PrepareSQL query, <emphasis
  1359. role="greenbold">--&gt;</emphasis>
  1360. &lt;!-- but it must be of the same type --&gt;</emphasis>
  1361. &lt;TargetCluster&gt;<emphasis role="bluebold">Thor</emphasis>&lt;/TargetCluster&gt;
  1362. &lt;SuppressResults&gt;<emphasis role="bluebold">0</emphasis>&lt;/SuppressResults&gt;
  1363. &lt;SuppressXmlSchema&gt;<emphasis role="bluebold">1</emphasis>&lt;/SuppressXmlSchema&gt;
  1364. &lt;Wait&gt;<emphasis role="bluebold">-1</emphasis>&lt;/Wait&gt;
  1365. <emphasis role="greenbold">&lt;!-- For page loading --&gt;</emphasis>
  1366. &lt;ResultWindowStart&gt;<emphasis role="bluebold">0</emphasis>&lt;/ResultWindowStart&gt;
  1367. &lt;ResultWindowCount&gt;<emphasis role="bluebold">50</emphasis>&lt;/ResultWindowCount&gt;
  1368. <emphasis role="greenbold">&lt;!-- Paramaters using name/value pairs --&gt;</emphasis>
  1369. &lt;Variables&gt;
  1370. &lt;NamedValue&gt;
  1371. &lt;Name&gt;<emphasis role="bluebold">firstname</emphasis>&lt;/Name&gt;
  1372. &lt;Value&gt;<emphasis role="bluebold">Jim</emphasis>&lt;/Value&gt;
  1373. &lt;/NamedValue&gt;
  1374. &lt;NamedValue&gt;
  1375. &lt;Name&gt;<emphasis role="bluebold">lastname</emphasis>&lt;/Name&gt;
  1376. &lt;Value&gt;JONES&lt;/Value&gt;
  1377. &lt;/NamedValue&gt;
  1378. &lt;/Variables&gt;
  1379. &lt;/ExecutePreparedSQLRequest&gt;
  1380. &lt;/soap:Body&gt;
  1381. &lt;/soap:Envelope&gt;
  1382. </programlisting></para>
  1383. </sect2>
  1384. <sect2 role="brk">
  1385. <title>Request Tag Descriptions</title>
  1386. <para><informaltable colsep="1" frame="all" rowsep="1">
  1387. <tgroup cols="3">
  1388. <colspec colwidth="200 pt" />
  1389. <colspec colwidth="40 pt" />
  1390. <colspec />
  1391. <tbody>
  1392. <row>
  1393. <entry><?dbfo bgcolor="LightCyan"?>Tag Name</entry>
  1394. <entry><?dbfo bgcolor="LightCyan"?>Req?</entry>
  1395. <entry><?dbfo bgcolor="LightCyan"?>Description</entry>
  1396. </row>
  1397. <row>
  1398. <entry><programlisting role="wsig">ExecutePreparedSQLRequest</programlisting></entry>
  1399. <entry>N</entry>
  1400. <entry>Structure containing the request</entry>
  1401. </row>
  1402. <row>
  1403. <entry><programlisting role="wsig"> WuId</programlisting></entry>
  1404. <entry>Y</entry>
  1405. <entry>The Workunit ID (WUID)</entry>
  1406. </row>
  1407. <row>
  1408. <entry><programlisting role="wsig"> UserName</programlisting></entry>
  1409. <entry>N</entry>
  1410. <entry>The username to use as the job's ownername in the
  1411. HPCC platform</entry>
  1412. </row>
  1413. <row>
  1414. <entry><programlisting role="wsig"> TargetCluster</programlisting></entry>
  1415. <entry>Y</entry>
  1416. <entry>If you are executing prepared SQL using a SELECT or
  1417. SELECT JOIN, you can specify the TargetCluster, but it must
  1418. be the same type as the one on which it was prepared</entry>
  1419. </row>
  1420. <row>
  1421. <entry><programlisting role="wsig"> SuppressResults</programlisting></entry>
  1422. <entry>N</entry>
  1423. <entry>If set to 1 or true, query results are not included
  1424. in response</entry>
  1425. </row>
  1426. <row>
  1427. <entry><programlisting role="wsig"> SuppressXmlSchema</programlisting></entry>
  1428. <entry>N</entry>
  1429. <entry>If set to 1 or true, the query result schema is not
  1430. included in response</entry>
  1431. </row>
  1432. <row>
  1433. <entry><programlisting role="wsig"> Wait</programlisting></entry>
  1434. <entry>N</entry>
  1435. <entry>Timeout value in milliseconds. Use -1 for no
  1436. timeout.</entry>
  1437. </row>
  1438. <row>
  1439. <entry><programlisting role="wsig"> ResultWindowStart</programlisting></entry>
  1440. <entry>N</entry>
  1441. <entry>For use with page-loading, the starting record to
  1442. return</entry>
  1443. </row>
  1444. <row>
  1445. <entry><programlisting role="wsig"> ResultWindowCount</programlisting></entry>
  1446. <entry>N</entry>
  1447. <entry>For use with page-loading, the number of records to
  1448. include from the ResultWindowStart</entry>
  1449. </row>
  1450. <row>
  1451. <entry><programlisting role="wsig"> Variables</programlisting></entry>
  1452. <entry>N</entry>
  1453. <entry>If your prepared SQL has parameters, supply them as
  1454. name/value pairs inside this structure</entry>
  1455. </row>
  1456. <row>
  1457. <entry><programlisting role="wsig"> NamedValue</programlisting></entry>
  1458. <entry>N</entry>
  1459. <entry>A structure containing one Name/Value pair</entry>
  1460. </row>
  1461. <row>
  1462. <entry><programlisting role="wsig"> Name</programlisting></entry>
  1463. <entry>N</entry>
  1464. <entry>Name</entry>
  1465. </row>
  1466. <row>
  1467. <entry><programlisting role="wsig"> Value</programlisting></entry>
  1468. <entry>N</entry>
  1469. <entry>Value</entry>
  1470. </row>
  1471. </tbody>
  1472. </tgroup>
  1473. </informaltable></para>
  1474. </sect2>
  1475. <sect2>
  1476. <title>Response Tag Descriptions</title>
  1477. <para><informaltable colsep="1" frame="all" rowsep="1">
  1478. <tgroup cols="2">
  1479. <colspec colwidth="200pt" />
  1480. <colspec />
  1481. <tbody>
  1482. <row>
  1483. <entry><?dbfo bgcolor="LightCyan"?>Tag Name</entry>
  1484. <entry><?dbfo bgcolor="LightCyan"?>Description</entry>
  1485. </row>
  1486. <row>
  1487. <entry><programlisting role="wsig">ExecutePreparedSQLResponse</programlisting></entry>
  1488. <entry>Structure containing response</entry>
  1489. </row>
  1490. <row>
  1491. <entry><programlisting role="wsig"> Exceptions</programlisting></entry>
  1492. <entry>Structure containing exceptions. See <link
  1493. linkend="ExceptionStructure">Exceptions Structure</link> in
  1494. Common Structures</entry>
  1495. </row>
  1496. <row>
  1497. <entry><programlisting role="wsig"> ParentWuId</programlisting></entry>
  1498. <entry>The Workunit ID for the parent workunit (the one with
  1499. the prepared SQL)</entry>
  1500. </row>
  1501. <row>
  1502. <entry><programlisting role="wsig"> Result</programlisting></entry>
  1503. <entry>The query result</entry>
  1504. </row>
  1505. <row>
  1506. <entry><programlisting role="wsig"> ResultWindowStart</programlisting></entry>
  1507. <entry>The submitted starting record</entry>
  1508. </row>
  1509. <row>
  1510. <entry><programlisting role="wsig"> ResultWindowCount</programlisting></entry>
  1511. <entry>The submitted record count</entry>
  1512. </row>
  1513. <row>
  1514. <entry><programlisting role="wsig"> Workunit</programlisting></entry>
  1515. <entry>Structure containing Workunit details. See <link
  1516. linkend="WUStructure">Workunit Structure</link> in Common
  1517. Structures</entry>
  1518. </row>
  1519. </tbody>
  1520. </tgroup>
  1521. </informaltable></para>
  1522. </sect2>
  1523. </sect1>
  1524. <sect1 id="CreateTableAndLoad">
  1525. <title>CreateTableAndLoad</title>
  1526. <para>This method creates a table (HPCC logical file) which can
  1527. subsequently be accessed using WsSQL. The table is assigned the layout
  1528. as specified in the request ECLFields section. The table is then
  1529. populated with data from an existing file. The source data file can
  1530. either reside on the HPCC Landing Zone after being uploaded, or it can
  1531. already have been sprayed on to the system.</para>
  1532. <sect2>
  1533. <title>Sample Input XML</title>
  1534. <para><programlisting>&lt;CreateTableAndLoadRequest&gt;
  1535. &lt;TableName&gt;<emphasis role="bluebold">JIM::MyNewTable</emphasis>&lt;/TableName&gt;
  1536. &lt;TableDescription&gt;<emphasis role="bluebold">My Description of the new table</emphasis>&lt;/TableDescription&gt;
  1537. &lt;Overwrite&gt;1&lt;/Overwrite&gt;
  1538. &lt;EclFields&gt;
  1539. &lt;EclField&gt;
  1540. &lt;FieldName&gt;<emphasis role="bluebold">PersonName</emphasis>&lt;/FieldName&gt;
  1541. &lt;EclFieldType&gt;
  1542. <emphasis role="greenbold">&lt;!-- Valid types are: BOOLEAN, INTEGER,</emphasis> <emphasis
  1543. role="greenbold">UNSIGNED, REAL, DECIMAL, STRING, --&gt;
  1544. &lt;!-- QSTRING, UNICODE, DATA, VARSTRING, or VARUNICODE --&gt;
  1545. </emphasis> &lt;Type&gt;<emphasis role="bluebold">STRING</emphasis>&lt;/Type&gt;
  1546. &lt;Locale&gt;&lt;/Locale&gt;
  1547. &lt;Length&gt;<emphasis role="bluebold">20</emphasis>&lt;/Length&gt;
  1548. &lt;Precision&gt;&lt;/Precision&gt;
  1549. &lt;/EclFieldType&gt;
  1550. &lt;/EclField&gt;
  1551. &lt;EclField&gt;
  1552. &lt;FieldName&gt;<emphasis role="bluebold">PersonID</emphasis>&lt;/FieldName&gt;
  1553. &lt;EclFieldType&gt;
  1554. &lt;Type&gt;<emphasis role="bluebold">INTEGER</emphasis>&lt;/Type&gt;
  1555. &lt;Locale&gt;&lt;/Locale&gt;
  1556. &lt;Length&gt;<emphasis role="bluebold">2</emphasis>&lt;/Length&gt;
  1557. &lt;Precision&gt;&lt;/Precision&gt;
  1558. &lt;/EclFieldType&gt;
  1559. &lt;/EclField&gt;
  1560. &lt;/EclFields&gt;
  1561. &lt;TargetCluster&gt;<emphasis role="bluebold">thor</emphasis>&lt;/TargetCluster&gt;
  1562. &lt;Owner&gt;<emphasis role="bluebold">Jimmy</emphasis>&lt;/Owner&gt;
  1563. &lt;DataSource&gt;
  1564. <emphasis role="greenbold">&lt;!-- Use either SprayedFileName --&gt;</emphasis>
  1565. &lt;SprayedFileName&gt;<emphasis role="bluebold">Tutorial::JD::OriginalPerson</emphasis>&lt;/SprayedFileName&gt;
  1566. <emphasis role="greenbold">&lt;!-- or full Landing Zone details, not both --&gt;</emphasis>
  1567. &lt;LandingZoneIP&gt;<emphasis role="bluebold">127.0.0.1</emphasis>&lt;/LandingZoneIP&gt;
  1568. &lt;LandingZonePath&gt;<emphasis role="bluebold">/var/lib/HPCCSystems/mydropzone</emphasis>&lt;/LandingZonePath&gt;
  1569. &lt;LandingZoneFileName&gt;<emphasis role="bluebold">OriginalPerson</emphasis>&lt;/LandingZoneFileName&gt;
  1570. &lt;/DataSource&gt;
  1571. &lt;DataSourceType&gt;
  1572. <emphasis role="greenbold">&lt;!-- Valid types are: FLAT, CSV, JSON, or XML<emphasis
  1573. role="greenbold"> --&gt; </emphasis></emphasis>
  1574. &lt;Type&gt;<emphasis role="bluebold">FLAT</emphasis>&lt;/Type&gt;
  1575. &lt;Params&gt;
  1576. &lt;Param&gt;
  1577. &lt;Name&gt;&lt;/Name&gt;
  1578. &lt;Values&gt;
  1579. &lt;Value&gt;&lt;/Value&gt;
  1580. &lt;Value&gt;&lt;/Value&gt;
  1581. &lt;/Values&gt;
  1582. &lt;/Param&gt;
  1583. &lt;/Params&gt;
  1584. &lt;/DataSourceType&gt;
  1585. &lt;Wait&gt;-1&lt;/Wait&gt;
  1586. &lt;/CreateTableAndLoadRequest&gt;
  1587. </programlisting></para>
  1588. </sect2>
  1589. <sect2>
  1590. <title>Request Tag Descriptions</title>
  1591. <para><informaltable colsep="1" frame="all" rowsep="1">
  1592. <tgroup cols="3">
  1593. <colspec colwidth="200pt" />
  1594. <colspec colwidth="40 pt" />
  1595. <colspec />
  1596. <tbody>
  1597. <row>
  1598. <entry><?dbfo bgcolor="LightCyan"?>Tag Name</entry>
  1599. <entry><?dbfo bgcolor="LightCyan"?>Req?</entry>
  1600. <entry><?dbfo bgcolor="LightCyan"?>Description</entry>
  1601. </row>
  1602. <row>
  1603. <entry><programlisting role="wsig">TableName</programlisting></entry>
  1604. <entry>Y</entry>
  1605. <entry>The name of the table to create in the HPCC
  1606. Platform's distributed file system.</entry>
  1607. </row>
  1608. <row>
  1609. <entry><programlisting role="wsig"> TableDescription</programlisting></entry>
  1610. <entry>N</entry>
  1611. <entry>Your description of the file.</entry>
  1612. </row>
  1613. <row>
  1614. <entry><programlisting role="wsig"> Overwrite</programlisting></entry>
  1615. <entry>N</entry>
  1616. <entry>Boolean indicator to specify whether to allow the new
  1617. file to overwrite an existing file of the same name.</entry>
  1618. </row>
  1619. <row>
  1620. <entry><programlisting role="wsig"> EclFields</programlisting></entry>
  1621. <entry>Y</entry>
  1622. <entry>Structure containing details for the file's record
  1623. layout. This must match layout of the source data
  1624. file</entry>
  1625. </row>
  1626. <row>
  1627. <entry><programlisting role="wsig"> EclField</programlisting></entry>
  1628. <entry>Y</entry>
  1629. <entry>Structure containing details for one field</entry>
  1630. </row>
  1631. <row>
  1632. <entry><programlisting role="wsig"> FieldName </programlisting></entry>
  1633. <entry>Y</entry>
  1634. <entry>Field Name</entry>
  1635. </row>
  1636. <row>
  1637. <entry><programlisting role="wsig"> EclFieldType</programlisting></entry>
  1638. <entry>Y</entry>
  1639. <entry>Structure containing Data Type details</entry>
  1640. </row>
  1641. <row>
  1642. <entry><programlisting role="wsig"> Type</programlisting></entry>
  1643. <entry>Y</entry>
  1644. <entry>Field type. Valid types are: BOOLEAN, INTEGER,
  1645. UNSIGNED, REAL, DECIMAL, STRING, QSTRING, UNICODE, DATA,
  1646. VARSTRING, or VARUNICODE</entry>
  1647. </row>
  1648. <row>
  1649. <entry><programlisting role="wsig"> Locale </programlisting></entry>
  1650. <entry>N</entry>
  1651. <entry>Locale</entry>
  1652. </row>
  1653. <row>
  1654. <entry><programlisting role="wsig"> Length</programlisting></entry>
  1655. <entry>Y*</entry>
  1656. <entry>Field length</entry>
  1657. </row>
  1658. <row>
  1659. <entry><programlisting role="wsig"> Precision</programlisting></entry>
  1660. <entry>N</entry>
  1661. <entry>Field precision (decimal places)</entry>
  1662. </row>
  1663. <row>
  1664. <entry><programlisting role="wsig"> TargetCluster</programlisting></entry>
  1665. <entry>Y</entry>
  1666. <entry>The Target cluster where the job will run.</entry>
  1667. </row>
  1668. <row>
  1669. <entry><programlisting role="wsig"> Owner</programlisting></entry>
  1670. <entry>N</entry>
  1671. <entry>Owner name for the file</entry>
  1672. </row>
  1673. <row>
  1674. <entry><programlisting role="wsig"> DataSource</programlisting></entry>
  1675. <entry>Y</entry>
  1676. <entry>Structure containing Data Source details. Either
  1677. SprayedFileName or LandingZone File details must be
  1678. provided, not both.</entry>
  1679. </row>
  1680. <row>
  1681. <entry><programlisting role="wsig"> SprayedFileName</programlisting></entry>
  1682. <entry>Y**</entry>
  1683. <entry>Logical filename of sprayed data file</entry>
  1684. </row>
  1685. <row>
  1686. <entry><programlisting role="wsig"> LandingZoneIP</programlisting></entry>
  1687. <entry>Y**</entry>
  1688. <entry>IP address or hostname of the HPCC Landing
  1689. Zone</entry>
  1690. </row>
  1691. <row>
  1692. <entry><programlisting role="wsig"> LandingZonePath</programlisting></entry>
  1693. <entry>Y**</entry>
  1694. <entry>Path to the datafile on the Landing Zone</entry>
  1695. </row>
  1696. <row>
  1697. <entry><programlisting role="wsig"> LandingZoneFileName</programlisting></entry>
  1698. <entry>Y**</entry>
  1699. <entry>Physical filename</entry>
  1700. </row>
  1701. <row>
  1702. <entry><programlisting role="wsig"> DataSourceType</programlisting></entry>
  1703. <entry>N</entry>
  1704. <entry>Structure containing DataSource Type details.</entry>
  1705. </row>
  1706. <row>
  1707. <entry><programlisting role="wsig"> Type</programlisting></entry>
  1708. <entry>Y</entry>
  1709. <entry>Valid types are: FLAT, CSV, JSON, or XML</entry>
  1710. </row>
  1711. <row>
  1712. <entry><programlisting role="wsig"> Params</programlisting></entry>
  1713. <entry>N</entry>
  1714. <entry>Structure containing one or more type parameters that
  1715. describe the DataSource. For example, CSV Terminator =
  1716. \n</entry>
  1717. </row>
  1718. <row>
  1719. <entry><programlisting role="wsig"> Param</programlisting></entry>
  1720. <entry>N</entry>
  1721. <entry>Structure containing one type parameter.</entry>
  1722. </row>
  1723. <row>
  1724. <entry><programlisting role="wsig"> Name</programlisting></entry>
  1725. <entry>N</entry>
  1726. <entry>Name</entry>
  1727. </row>
  1728. <row>
  1729. <entry><programlisting role="wsig"> Values</programlisting></entry>
  1730. <entry>N</entry>
  1731. <entry>Structure containing one or more values.</entry>
  1732. </row>
  1733. <row>
  1734. <entry><programlisting role="wsig"> Value</programlisting></entry>
  1735. <entry>N</entry>
  1736. <entry>Value</entry>
  1737. </row>
  1738. <row>
  1739. <entry><programlisting role="wsig"> Wait</programlisting></entry>
  1740. <entry>N</entry>
  1741. <entry>Timeout value in milliseconds. Use -1 for no
  1742. timeout</entry>
  1743. </row>
  1744. </tbody>
  1745. </tgroup>
  1746. </informaltable></para>
  1747. <para>* <emphasis role="bold">Field length is only required for fixed
  1748. width fields (FLAT files)</emphasis></para>
  1749. <para>** <emphasis role="bold">Either SprayedFileName or LandingZone
  1750. File details must be provided, not both</emphasis></para>
  1751. </sect2>
  1752. <sect2>
  1753. <title>Response Tag Descriptions</title>
  1754. <para>The response structure contains many tags which provide useful
  1755. information for development and debugging of ECL code. Most of them
  1756. are outside of the scope of this document. Only those that are useful
  1757. when using the WsSQL service are listed below.</para>
  1758. <para><informaltable colsep="1" frame="all" rowsep="1">
  1759. <tgroup cols="2">
  1760. <colspec colwidth="200 pt" />
  1761. <colspec />
  1762. <tbody>
  1763. <row>
  1764. <entry><?dbfo bgcolor="LightCyan"?>Tag Name</entry>
  1765. <entry><?dbfo bgcolor="LightCyan"?>Description</entry>
  1766. </row>
  1767. <row>
  1768. <entry><programlisting role="wsig">CreateTableAndLoadResponse</programlisting></entry>
  1769. <entry>Structure containing response</entry>
  1770. </row>
  1771. <row>
  1772. <entry><programlisting role="wsig"> TableName</programlisting></entry>
  1773. <entry>Name of the created table</entry>
  1774. </row>
  1775. <row>
  1776. <entry><programlisting role="wsig"> Success</programlisting></entry>
  1777. <entry>Boolean indicator of success [1 = success]</entry>
  1778. </row>
  1779. <row>
  1780. <entry><programlisting role="wsig"> EclRecordDefinition</programlisting></entry>
  1781. <entry>Supplied record definition in ECL format</entry>
  1782. </row>
  1783. <row>
  1784. <entry><programlisting role="wsig"> Workunit</programlisting></entry>
  1785. <entry>Structure containing Workunit details. See <link
  1786. linkend="WUStructure">Workunit Structure</link> in Common
  1787. Structures</entry>
  1788. </row>
  1789. </tbody>
  1790. </tgroup>
  1791. </informaltable></para>
  1792. </sect2>
  1793. </sect1>
  1794. <sect1 id="SetRelatedIndexes">
  1795. <title>SetRelatedIndexes</title>
  1796. <para>This function adds a description to a logical file to be used as
  1797. an annotation indicating an index file which is related to a data file.
  1798. This makes it available to WsSQL for use in an indexed fetch.</para>
  1799. <para></para>
  1800. <sect2>
  1801. <title>Sample Input XML</title>
  1802. <para><programlisting>&lt;SetRelatedIndexesRequest&gt;
  1803. &lt;RelatedIndexSets&gt;
  1804. &lt;RelatedIndexSet&gt;
  1805. &lt;FileName&gt;<emphasis role="bluebold">Tutorial::JD::TutorialPerson</emphasis>&lt;/FileName&gt;
  1806. &lt;Indexes&gt;
  1807. &lt;Index&gt;<emphasis role="bluebold">Tutorial::JD::TutorialPersonByName</emphasis>&lt;/Index&gt;
  1808. &lt;Index&gt;<emphasis role="bluebold">Tutorial::JD::TutorialPersonByZIP</emphasis>&lt;/Index&gt;
  1809. &lt;/Indexes&gt;
  1810. &lt;/RelatedIndexSet&gt;
  1811. &lt;RelatedIndexSet&gt;
  1812. &lt;/SetRelatedIndexesRequest&gt;
  1813. </programlisting></para>
  1814. </sect2>
  1815. <sect2>
  1816. <title>Request Tag Descriptions</title>
  1817. <para><informaltable colsep="1" frame="all" rowsep="1">
  1818. <tgroup cols="3">
  1819. <colspec colwidth="200pt" />
  1820. <colspec colwidth="40 pt" />
  1821. <colspec />
  1822. <tbody>
  1823. <row>
  1824. <entry><?dbfo bgcolor="LightCyan"?>Tag Name</entry>
  1825. <entry><?dbfo bgcolor="LightCyan"?>Req?</entry>
  1826. <entry><?dbfo bgcolor="LightCyan"?>Description</entry>
  1827. </row>
  1828. <row>
  1829. <entry><programlisting role="wsig">SetRelatedIndexesRequest</programlisting></entry>
  1830. <entry></entry>
  1831. <entry>Structure containing request</entry>
  1832. </row>
  1833. <row>
  1834. <entry><programlisting role="wsig"> RelatedIndexSets</programlisting></entry>
  1835. <entry>Y</entry>
  1836. <entry>Structure containing one or more related index
  1837. sets</entry>
  1838. </row>
  1839. <row>
  1840. <entry><programlisting role="wsig"> RelatedIndexSet</programlisting></entry>
  1841. <entry>Y</entry>
  1842. <entry>Structure containing one related index set</entry>
  1843. </row>
  1844. <row>
  1845. <entry><programlisting role="wsig"> FileName</programlisting></entry>
  1846. <entry>Y</entry>
  1847. <entry>Logical filename to which the annotation is
  1848. added</entry>
  1849. </row>
  1850. <row>
  1851. <entry><programlisting role="wsig"> Indexes</programlisting></entry>
  1852. <entry>Y</entry>
  1853. <entry>Structure containing one or more indexes to add to
  1854. annotation</entry>
  1855. </row>
  1856. <row>
  1857. <entry><programlisting role="wsig"> Index</programlisting></entry>
  1858. <entry>Y</entry>
  1859. <entry>Index to add to annotation</entry>
  1860. </row>
  1861. </tbody>
  1862. </tgroup>
  1863. </informaltable></para>
  1864. </sect2>
  1865. <sect2>
  1866. <title>Response Tag Descriptions</title>
  1867. <para><informaltable colsep="1" frame="all" rowsep="1">
  1868. <tgroup cols="2">
  1869. <colspec colwidth="200 pt" />
  1870. <colspec />
  1871. <tbody>
  1872. <row>
  1873. <entry><?dbfo bgcolor="LightCyan"?>Tag Name</entry>
  1874. <entry><?dbfo bgcolor="LightCyan"?>Description</entry>
  1875. </row>
  1876. <row>
  1877. <entry><programlisting role="wsig">SetRelatedIndexesResponse</programlisting></entry>
  1878. <entry>Structure containing response</entry>
  1879. </row>
  1880. <row>
  1881. <entry><programlisting role="wsig"> RelatedIndexSets</programlisting></entry>
  1882. <entry>Structure containing one or more related index
  1883. sets</entry>
  1884. </row>
  1885. <row>
  1886. <entry><programlisting role="wsig"> RelatedIndexSet</programlisting></entry>
  1887. <entry>Structure containing one related index set</entry>
  1888. </row>
  1889. <row>
  1890. <entry><programlisting role="wsig"> FileName</programlisting></entry>
  1891. <entry>Logical filename to which the annotation was
  1892. added</entry>
  1893. </row>
  1894. <row>
  1895. <entry><programlisting role="wsig"> Indexes</programlisting></entry>
  1896. <entry>Structure containing one or more indexes added to
  1897. annotation</entry>
  1898. </row>
  1899. <row>
  1900. <entry><programlisting role="wsig"> Index</programlisting></entry>
  1901. <entry>Index added to annotation</entry>
  1902. </row>
  1903. </tbody>
  1904. </tgroup>
  1905. </informaltable></para>
  1906. </sect2>
  1907. </sect1>
  1908. <sect1 id="GetRelatedIndexes">
  1909. <title>GetRelatedIndexes</title>
  1910. <para>This function retrieves information from logical file descriptions
  1911. about annotations indicating an index file which is related to a data
  1912. file.</para>
  1913. <para></para>
  1914. <sect2>
  1915. <title>Sample Input XML</title>
  1916. <para><programlisting>&lt;GetRelatedIndexesRequest&gt;
  1917. &lt;FileNames&gt;
  1918. &lt;FileName&gt;<emphasis role="bluebold">Tutorial::JD::TutorialPerson</emphasis>&lt;/FileName&gt;
  1919. &lt;/FileNames&gt;
  1920. &lt;/SetRelatedIndexesRequest&gt;
  1921. </programlisting></para>
  1922. </sect2>
  1923. <sect2>
  1924. <title>Request Tag Descriptions</title>
  1925. <para><informaltable colsep="1" frame="all" rowsep="1">
  1926. <tgroup cols="3">
  1927. <colspec colwidth="200pt" />
  1928. <colspec colwidth="40 pt" />
  1929. <colspec />
  1930. <tbody>
  1931. <row>
  1932. <entry><?dbfo bgcolor="LightCyan"?>Tag Name</entry>
  1933. <entry><?dbfo bgcolor="LightCyan"?>Req?</entry>
  1934. <entry><?dbfo bgcolor="LightCyan"?>Description</entry>
  1935. </row>
  1936. <row>
  1937. <entry><programlisting role="wsig">SetRelatedIndexesRequest</programlisting></entry>
  1938. <entry></entry>
  1939. <entry>Structure containing request</entry>
  1940. </row>
  1941. <row>
  1942. <entry><programlisting role="wsig"> FileNames</programlisting></entry>
  1943. <entry>Y</entry>
  1944. <entry>Structure containing one or more related index
  1945. sets</entry>
  1946. </row>
  1947. <row>
  1948. <entry><programlisting role="wsig"> FileName</programlisting></entry>
  1949. <entry>Y</entry>
  1950. <entry>Logical filename to which the annotation is
  1951. added</entry>
  1952. </row>
  1953. </tbody>
  1954. </tgroup>
  1955. </informaltable></para>
  1956. </sect2>
  1957. <sect2>
  1958. <title>Response Tag Descriptions</title>
  1959. <para><informaltable colsep="1" frame="all" rowsep="1">
  1960. <tgroup cols="2">
  1961. <colspec colwidth="200 pt" />
  1962. <colspec />
  1963. <tbody>
  1964. <row>
  1965. <entry><?dbfo bgcolor="LightCyan"?>Tag Name</entry>
  1966. <entry><?dbfo bgcolor="LightCyan"?>Description</entry>
  1967. </row>
  1968. <row>
  1969. <entry><programlisting role="wsig">GetRelatedIndexesResponse</programlisting></entry>
  1970. <entry>Structure containing response</entry>
  1971. </row>
  1972. <row>
  1973. <entry><programlisting role="wsig"> RelatedIndexSets</programlisting></entry>
  1974. <entry>Structure containing one or more related index
  1975. sets</entry>
  1976. </row>
  1977. <row>
  1978. <entry><programlisting role="wsig"> RelatedIndexSet</programlisting></entry>
  1979. <entry>Structure containing one related index set</entry>
  1980. </row>
  1981. <row>
  1982. <entry><programlisting role="wsig"> FileName</programlisting></entry>
  1983. <entry>Logical filename to which the annotation was
  1984. added</entry>
  1985. </row>
  1986. <row>
  1987. <entry><programlisting role="wsig"> Indexes</programlisting></entry>
  1988. <entry>Structure containing one or more indexes added to
  1989. annotation</entry>
  1990. </row>
  1991. <row>
  1992. <entry><programlisting role="wsig"> Index</programlisting></entry>
  1993. <entry>Index added to annotation</entry>
  1994. </row>
  1995. </tbody>
  1996. </tgroup>
  1997. </informaltable></para>
  1998. </sect2>
  1999. </sect1>
  2000. <sect1>
  2001. <title>Common Structures</title>
  2002. <para>These structures are returned in several methods.</para>
  2003. <sect2 id="ExceptionStructure">
  2004. <title>Exceptions Structure</title>
  2005. <para><informaltable colsep="1" frame="all" rowsep="1">
  2006. <tgroup cols="2">
  2007. <colspec colwidth="200pt" />
  2008. <colspec />
  2009. <tbody>
  2010. <row>
  2011. <entry><?dbfo bgcolor="LightCyan"?>Tag Name</entry>
  2012. <entry><?dbfo bgcolor="LightCyan"?>Description</entry>
  2013. </row>
  2014. <row>
  2015. <entry><programlisting role="wsig">Exceptions</programlisting></entry>
  2016. <entry>Structure containing one or more exceptions</entry>
  2017. </row>
  2018. <row>
  2019. <entry><programlisting role="wsig"> Exception</programlisting></entry>
  2020. <entry>Structure containing one exception</entry>
  2021. </row>
  2022. <row>
  2023. <entry><programlisting role="wsig"> Code</programlisting></entry>
  2024. <entry>Code</entry>
  2025. </row>
  2026. <row>
  2027. <entry><programlisting role="wsig"> Audience</programlisting></entry>
  2028. <entry>Audience</entry>
  2029. </row>
  2030. <row>
  2031. <entry><programlisting role="wsig"> Source</programlisting></entry>
  2032. <entry>Source component</entry>
  2033. </row>
  2034. <row>
  2035. <entry><programlisting role="wsig"> Message</programlisting></entry>
  2036. <entry>Error message</entry>
  2037. </row>
  2038. </tbody>
  2039. </tgroup>
  2040. </informaltable></para>
  2041. </sect2>
  2042. <sect2 id="WUStructure">
  2043. <title>Workunit Structure</title>
  2044. <para>The workunit structure contains many tags which provide useful
  2045. information for development and debugging of ECL code. Most of them
  2046. are outside of the scope of this document. Only those that are useful
  2047. when using the WsSQL service are listed here.</para>
  2048. <para><informaltable colsep="1" frame="all" rowsep="1">
  2049. <tgroup cols="2">
  2050. <colspec colwidth="200pt" />
  2051. <colspec />
  2052. <tbody>
  2053. <row>
  2054. <entry><?dbfo bgcolor="LightCyan"?>Tag Name</entry>
  2055. <entry><?dbfo bgcolor="LightCyan"?>Description</entry>
  2056. </row>
  2057. <row>
  2058. <entry><programlisting role="wsig">Workunit</programlisting></entry>
  2059. <entry>Structure containing Workunit details</entry>
  2060. </row>
  2061. <row>
  2062. <entry><programlisting role="wsig"> Wuid</programlisting></entry>
  2063. <entry>Workunit Id (WUID)</entry>
  2064. </row>
  2065. <row>
  2066. <entry><programlisting role="wsig"> Owner</programlisting></entry>
  2067. <entry>Job Owner (if any)</entry>
  2068. </row>
  2069. <row>
  2070. <entry><programlisting role="wsig"> Cluster</programlisting></entry>
  2071. <entry>Target Cluster</entry>
  2072. </row>
  2073. <row>
  2074. <entry><programlisting role="wsig"> Jobname</programlisting></entry>
  2075. <entry>Job Name (If any)</entry>
  2076. </row>
  2077. <row>
  2078. <entry><programlisting role="wsig"> StateID</programlisting></entry>
  2079. <entry>State ID</entry>
  2080. </row>
  2081. <row>
  2082. <entry><programlisting role="wsig"> State</programlisting></entry>
  2083. <entry>State (compiled, failed, etc)</entry>
  2084. </row>
  2085. <row>
  2086. <entry><programlisting role="wsig"> Protected</programlisting></entry>
  2087. <entry>Boolean indicator: Is Workunit protected?</entry>
  2088. </row>
  2089. <row>
  2090. <entry><programlisting role="wsig"> Snapshot</programlisting></entry>
  2091. <entry>Snapshot</entry>
  2092. </row>
  2093. <row>
  2094. <entry><programlisting role="wsig"> IsPausing</programlisting></entry>
  2095. <entry>Boolean indicator of pause state</entry>
  2096. </row>
  2097. <row>
  2098. <entry><programlisting role="wsig"> ThorLCR</programlisting></entry>
  2099. <entry>Boolean indicator</entry>
  2100. </row>
  2101. <row>
  2102. <entry><programlisting role="wsig"> EventSchedule</programlisting></entry>
  2103. <entry>Boolean indicator</entry>
  2104. </row>
  2105. <row>
  2106. <entry><programlisting role="wsig"> TotalCLusterTime</programlisting></entry>
  2107. <entry>Time taken to process on cluster</entry>
  2108. </row>
  2109. <row>
  2110. <entry><programlisting role="wsig"> Query</programlisting></entry>
  2111. <entry>Query</entry>
  2112. </row>
  2113. <row>
  2114. <entry><programlisting role="wsig"> Result</programlisting></entry>
  2115. <entry>Structure containing result (if any)</entry>
  2116. </row>
  2117. </tbody>
  2118. </tgroup>
  2119. </informaltable></para>
  2120. </sect2>
  2121. </sect1>
  2122. </chapter>
  2123. <chapter>
  2124. <title>Supported SQL Grammar</title>
  2125. <sect1 role="nobrk">
  2126. <title>CALL</title>
  2127. <para><emphasis role="bold">Call
  2128. </emphasis><emphasis>queryName</emphasis><emphasis role="bold">
  2129. ([</emphasis><emphasis>paramList</emphasis><emphasis
  2130. role="bold">])</emphasis></para>
  2131. <para><informaltable colsep="1" frame="all" rowsep="1">
  2132. <tgroup cols="2">
  2133. <colspec colwidth="113.65pt" />
  2134. <colspec />
  2135. <tbody>
  2136. <row>
  2137. <entry>queryName</entry>
  2138. <entry>The published query name or alias</entry>
  2139. </row>
  2140. <row>
  2141. <entry>paramList</entry>
  2142. <entry>The parameters exposed by the published query
  2143. (comma-separated)</entry>
  2144. </row>
  2145. </tbody>
  2146. </tgroup>
  2147. </informaltable></para>
  2148. <para>Call executes a published ECL query as if it were a stored
  2149. procedure.</para>
  2150. <para>Example:</para>
  2151. <programlisting>Call SearchPeopleByZipService ('33024')</programlisting>
  2152. </sect1>
  2153. <sect1>
  2154. <title>SELECT</title>
  2155. <para><emphasis role="bold">select [</emphasis>distinct<emphasis
  2156. role="bold">]</emphasis> <emphasis>colummList</emphasis> <emphasis
  2157. role="bold">from</emphasis> <emphasis>tableList </emphasis><emphasis>
  2158. </emphasis><emphasis role="bold">[</emphasis>USE
  2159. INDEX<emphasis>(indexFileName</emphasis> | NONE
  2160. <emphasis>)</emphasis><emphasis role="bold">]</emphasis></para>
  2161. <para><emphasis role="bold">[where</emphasis>
  2162. <emphasis>logicalExpression</emphasis><emphasis role="bold">]</emphasis>
  2163. <emphasis role="bold">[group by</emphasis>
  2164. <emphasis>columnList<superscript>1</superscript></emphasis><emphasis
  2165. role="bold">]</emphasis> <emphasis role="bold">[having</emphasis>
  2166. <emphasis>logicalExpression<superscript>2</superscript></emphasis><emphasis
  2167. role="bold">]</emphasis></para>
  2168. <para><emphasis role="bold">[order by</emphasis>
  2169. <emphasis>columnList<superscript>1</superscript> </emphasis>[asc |
  2170. desc]<emphasis> </emphasis>] <emphasis
  2171. role="bold">[LIMIT</emphasis><emphasis> limitNumber</emphasis><emphasis
  2172. role="bold">]</emphasis></para>
  2173. <variablelist>
  2174. <varlistentry>
  2175. <term>NOTE:</term>
  2176. <listitem>
  2177. <para>Identifiers can be unquoted or within double quotes, literal
  2178. string values must be single quoted.</para>
  2179. </listitem>
  2180. </varlistentry>
  2181. </variablelist>
  2182. <para><informaltable colsep="1" frame="all" rowsep="1">
  2183. <tgroup cols="2">
  2184. <colspec colwidth="123.45pt" />
  2185. <colspec />
  2186. <tbody>
  2187. <row>
  2188. <entry><emphasis>columnList</emphasis></entry>
  2189. <entry>columnreference1[,columnreference2,columnreference3,...,columnreference<emphasis>n</emphasis>]</entry>
  2190. </row>
  2191. <row>
  2192. <entry></entry>
  2193. <entry>The column(s) to return (comma-separated list). In
  2194. addition, these aggregate functions are supported : COUNT,
  2195. SUM, MIN, MAX, and AVG. These work in a similar manner as
  2196. their ECL counterparts</entry>
  2197. </row>
  2198. <row>
  2199. <entry>columnreference</entry>
  2200. <entry>[tablename.]columnname[ [AS] alias ]</entry>
  2201. </row>
  2202. <row>
  2203. <entry><emphasis>distinct</emphasis></entry>
  2204. <entry>[distinct] col1, col2,...
  2205. col<emphasis>n</emphasis></entry>
  2206. </row>
  2207. <row>
  2208. <entry><emphasis></emphasis></entry>
  2209. <entry>The result set will only contain distinct (unique)
  2210. values</entry>
  2211. </row>
  2212. <row>
  2213. <entry><emphasis>tableList</emphasis></entry>
  2214. <entry>tableref1[,tableref2,tableref3,...,tableref<emphasis>n</emphasis>]</entry>
  2215. </row>
  2216. <row>
  2217. <entry></entry>
  2218. <entry>One or more tables, separated by commas.</entry>
  2219. </row>
  2220. <row>
  2221. <entry></entry>
  2222. <entry><emphasis role="bold">NOTE: </emphasis>A table list
  2223. with multiple tables creates an (one or more) implicit inner
  2224. join using the where clause logical expression as the join
  2225. condition which must contain an equality condition</entry>
  2226. </row>
  2227. <row>
  2228. <entry>tableref</entry>
  2229. <entry>tableName[ [AS] alias ]</entry>
  2230. </row>
  2231. <row>
  2232. <entry></entry>
  2233. <entry>The Name of the table as referenced, optionally
  2234. defining its alias</entry>
  2235. </row>
  2236. <row>
  2237. <entry><emphasis>alias</emphasis></entry>
  2238. <entry>The alias used to refer to the corresponding table or
  2239. field reference.</entry>
  2240. </row>
  2241. <row>
  2242. <entry><emphasis>logicalExpression</emphasis></entry>
  2243. <entry>Logical expression based on standard SQL filtering
  2244. syntax.</entry>
  2245. </row>
  2246. <row>
  2247. <entry></entry>
  2248. <entry>BOOLEAN Only supports <emphasis>True</emphasis> or
  2249. <emphasis>False</emphasis>, do not use Y, N, 0, or 1</entry>
  2250. </row>
  2251. <row>
  2252. <entry></entry>
  2253. <entry><emphasis role="bold">Valid
  2254. operators:</emphasis></entry>
  2255. </row>
  2256. <row>
  2257. <entry></entry>
  2258. <entry>= Equal (e.g., age=33)</entry>
  2259. </row>
  2260. <row>
  2261. <entry></entry>
  2262. <entry>&lt;&gt; Not equal (e.g., age &lt;&gt;33)</entry>
  2263. </row>
  2264. <row>
  2265. <entry></entry>
  2266. <entry>&gt; Greater than (e.g., age &gt;55)</entry>
  2267. </row>
  2268. <row>
  2269. <entry></entry>
  2270. <entry>&lt; Less than (e.g., age &lt; 18)</entry>
  2271. </row>
  2272. <row>
  2273. <entry></entry>
  2274. <entry>&gt;= Greater than or equal (e.g., age &gt;=21)</entry>
  2275. </row>
  2276. <row>
  2277. <entry></entry>
  2278. <entry>&lt;= Less than or equal (e.g., age &lt;=21)</entry>
  2279. </row>
  2280. <row>
  2281. <entry></entry>
  2282. <entry>IN(value1,value2,...,value<emphasis>n</emphasis>) where
  2283. values are comma separated homogeneous types</entry>
  2284. </row>
  2285. <row>
  2286. <entry></entry>
  2287. <entry>NOT IN(value1,value2,...,value<emphasis>n</emphasis>)
  2288. where values are comma separated homogeneous types</entry>
  2289. </row>
  2290. <row>
  2291. <entry></entry>
  2292. <entry>LIKE <emphasis>pattern</emphasis> where the pattern
  2293. uses SQL LIKE operators with % and _ wildcards.</entry>
  2294. </row>
  2295. <row>
  2296. <entry></entry>
  2297. <entry>NOT LIKE <emphasis>pattern</emphasis> where the pattern
  2298. uses SQL LIKE operators with % and _ wildcards.</entry>
  2299. </row>
  2300. <row>
  2301. <entry><emphasis>limitNumber</emphasis></entry>
  2302. <entry>The number of rows to return. This overrides the
  2303. default configuration attribute (EclResultLimit ) but cannot
  2304. be set to ALL</entry>
  2305. </row>
  2306. </tbody>
  2307. </tgroup>
  2308. </informaltable><superscript>1</superscript>Aliasing not
  2309. supported</para>
  2310. <para><superscript>2</superscript>Can only contain references to
  2311. aggregate functions<superscript></superscript>if used with
  2312. <emphasis>having</emphasis> clause.</para>
  2313. <para>Aggregate functions can only be expressed in logicalExpressions by
  2314. using <emphasis>Group by</emphasis>and
  2315. <emphasis>having</emphasis></para>
  2316. <para>Examples:</para>
  2317. <programlisting>Select * from tableList where Sum(F1 &gt; 100) /* is NOT SUPPORTED */
  2318. Select * from tableList Group by F1 Having Sum (F1 &gt; 100) /* IS SUPPORTED */</programlisting>
  2319. <para>Example:</para>
  2320. <programlisting>Select fname, lname, state from TutorialPerson where
  2321. state='FL' OR (lname='Smith' and fname='Joe')
  2322. //returns data that looks like this:
  2323. John Doe FL
  2324. Jim Smith FL
  2325. Jane Row FL
  2326. Joe Smith CA
  2327. Select fname, lname, state from TutorialPerson where state='FL' AND lname &lt;&gt; 'Smith'
  2328. //returns data that looks like this:
  2329. John Doe FL
  2330. Jane Row FL
  2331. Select fname, lname, state from TutorialPerson where state='FL' AND lname like 'Smi%'
  2332. //returns data that looks like this:
  2333. Jim Smith FL
  2334. Select fname, lname, state from TutorialPerson where
  2335. state='FL' OR (lname='Smith' and fname='Joe') AND fname NOT LIKE 'Ji%'
  2336. //returns data that looks like this:
  2337. John Doe FL
  2338. Jane Row FL
  2339. Joe Smith CA
  2340. </programlisting>
  2341. <para>The interface supports SQL index hints, which gives the SQL user
  2342. the option to specify the most appropriate HPCC index for the current
  2343. SQL query. This also allows you to disable the use of an index.</para>
  2344. <para><emphasis role="bold">select
  2345. </emphasis><emphasis>columnList</emphasis> <emphasis role="bold"> from
  2346. </emphasis><emphasis>tableName </emphasis><emphasis role="bold">USE
  2347. INDEX(</emphasis><emphasis>hpcc::index::file::name</emphasis><emphasis
  2348. role="bold">) where </emphasis><emphasis>logicalExprssions
  2349. </emphasis></para>
  2350. <para><emphasis role="bold">USE INDEX(none) </emphasis>forces the system
  2351. to avoid seeking an index for the current query.</para>
  2352. <para>Example:</para>
  2353. <programlisting>Select fname, lname, zip, state from TutorialPerson
  2354. USEINDEX(TutorialPersonByZipIndex)where zip='33024'
  2355. //returns data that looks like this:
  2356. John Doe FL 33024
  2357. Jim Smith FL 33024
  2358. Jane Row FL 33024
  2359. </programlisting>
  2360. <para>A Select query returns two dataset outputs per request. The second
  2361. dataset (named WsSQLCount) provides the total result count. This is
  2362. useful when paging results.</para>
  2363. <para>Example:</para>
  2364. <programlisting>&lt;Dataset name='WsSQLResult'&gt;
  2365. &lt;Row&gt;
  2366. &lt;yearbuilt&gt;1203&lt;/yearbuilt&gt;
  2367. &lt;id&gt;4&lt;/id&gt;&lt;/Row&gt;
  2368. &lt;Row&gt;
  2369. &lt;yearbuilt&gt;2003&lt;/yearbuilt&gt;
  2370. &lt;id&gt;5&lt;/id&gt;&lt;/Row&gt;
  2371. &lt;/Dataset&gt;
  2372. &lt;Dataset name='WsSQLCount'&gt;
  2373. &lt;Row&gt;
  2374. &lt;WSSQLSelectQueryResultCount&gt;2&lt;/WSSQLSelectQueryResultCount&gt;
  2375. &lt;/Row&gt;
  2376. &lt;/Dataset&gt;</programlisting>
  2377. </sect1>
  2378. <sect1>
  2379. <title>SELECT JOIN</title>
  2380. <para><emphasis role="bold">select
  2381. </emphasis><emphasis>colummList</emphasis> <emphasis
  2382. role="bold">from</emphasis> <emphasis>tableName <emphasis
  2383. role="bold">[</emphasis></emphasis><emphasis
  2384. role="bold">as</emphasis><emphasis> alias<emphasis
  2385. role="bold">]</emphasis></emphasis><emphasis role="bold">
  2386. </emphasis></para>
  2387. <para><emphasis role="bold">[</emphasis>&lt;outer | inner &gt; <emphasis
  2388. role="bold">JOIN </emphasis><emphasis>join TableName
  2389. </emphasis><emphasis role="bold">[ as
  2390. </emphasis><emphasis>alias</emphasis><emphasis role="bold">] on
  2391. </emphasis><emphasis>joinCondition</emphasis><emphasis
  2392. role="bold">]</emphasis></para>
  2393. <para>[USE INDEX<emphasis>(</emphasis>indexFileName | NONE
  2394. <emphasis>)</emphasis>]</para>
  2395. <para>[<emphasis role="bold">where</emphasis>
  2396. <emphasis>logicalExpression] </emphasis>[<emphasis role="bold">group
  2397. by</emphasis> <emphasis>fieldName</emphasis>]</para>
  2398. <para>[<emphasis role="bold">order by</emphasis> <emphasis>columnNames
  2399. </emphasis>[asc | desc]<emphasis> </emphasis>] [<emphasis
  2400. role="bold">LIMIT</emphasis><emphasis> limitNumber</emphasis>]</para>
  2401. <para><informaltable colsep="1" frame="all" rowsep="1">
  2402. <tgroup cols="2">
  2403. <colspec colwidth="123.45pt" />
  2404. <colspec />
  2405. <tbody>
  2406. <row>
  2407. <entry><emphasis>columnList</emphasis></entry>
  2408. <entry>columnreference1[,columnreference2,columnreference3,...,columnreference<emphasis>n</emphasis>]</entry>
  2409. </row>
  2410. <row>
  2411. <entry></entry>
  2412. <entry>The column(s) to return (comma-separated list). In
  2413. addition, these aggregate functions are supported : COUNT,
  2414. SUM, MIN, MAX, and AVG. These work in a similar manner as
  2415. their ECL counterparts.</entry>
  2416. </row>
  2417. <row>
  2418. <entry>columnreference</entry>
  2419. <entry>[tablename.]columnname[ [AS] alias ]</entry>
  2420. </row>
  2421. <row>
  2422. <entry><emphasis>distinct</emphasis></entry>
  2423. <entry>[distinct] col1, col2,...
  2424. col<emphasis>n</emphasis></entry>
  2425. </row>
  2426. <row>
  2427. <entry><emphasis></emphasis></entry>
  2428. <entry>The result set will only contain distinct (unique)
  2429. values.</entry>
  2430. </row>
  2431. <row>
  2432. <entry><emphasis>alias</emphasis></entry>
  2433. <entry>The alias used to refer to the corresponding table or
  2434. field reference.</entry>
  2435. </row>
  2436. <row>
  2437. <entry><emphasis role="bold">outer | inner</emphasis></entry>
  2438. <entry>The type of JOIN to use. Note: The WsSQL service
  2439. currently supports INNER JOIN or OUTER Joins. An OUTER JOIN is
  2440. converted to a FULL OUTER JOIN internally.</entry>
  2441. </row>
  2442. <row>
  2443. <entry><emphasis>joinTableName</emphasis></entry>
  2444. <entry>The JOIN file to use.</entry>
  2445. </row>
  2446. <row>
  2447. <entry><emphasis>joinCondition</emphasis></entry>
  2448. <entry>Specifies the relationship between columns in the
  2449. joined tables using logical expression.</entry>
  2450. </row>
  2451. <row>
  2452. <entry><emphasis>logicalExpression</emphasis></entry>
  2453. <entry>Logical expression based on standard SQL filtering
  2454. syntax.</entry>
  2455. </row>
  2456. <row>
  2457. <entry></entry>
  2458. <entry>BOOLEAN Only supports <emphasis>True</emphasis> or
  2459. <emphasis>False</emphasis>, do not use Y, N, 0, or 1.</entry>
  2460. </row>
  2461. <row>
  2462. <entry></entry>
  2463. <entry><emphasis role="bold">Valid
  2464. operators:</emphasis></entry>
  2465. </row>
  2466. <row>
  2467. <entry></entry>
  2468. <entry>= Equal (e.g., age=33)</entry>
  2469. </row>
  2470. <row>
  2471. <entry></entry>
  2472. <entry>&lt;&gt; Not equal (e.g., age &lt;&gt;33)</entry>
  2473. </row>
  2474. <row>
  2475. <entry></entry>
  2476. <entry>&gt; Greater than (e.g., age &gt;55)</entry>
  2477. </row>
  2478. <row>
  2479. <entry></entry>
  2480. <entry>&lt; Less than (e.g., age &lt; 18)</entry>
  2481. </row>
  2482. <row>
  2483. <entry></entry>
  2484. <entry>&gt;= Greater than or equal (e.g., age &gt;=21)</entry>
  2485. </row>
  2486. <row>
  2487. <entry></entry>
  2488. <entry>&lt;= Less than or equal (e.g., age &lt;=21)</entry>
  2489. </row>
  2490. <row>
  2491. <entry></entry>
  2492. <entry>IN(value1,value2,...,value<emphasis>n</emphasis>) where
  2493. values are comma separated homogeneous types.</entry>
  2494. </row>
  2495. <row>
  2496. <entry></entry>
  2497. <entry>NOT IN(value1,value2,...,value<emphasis>n</emphasis>)
  2498. where values are comma separated homogeneous types.</entry>
  2499. </row>
  2500. <row>
  2501. <entry></entry>
  2502. <entry>LIKE <emphasis>pattern</emphasis> where the pattern
  2503. uses SQL LIKE operators with % and _ wildcards.</entry>
  2504. </row>
  2505. <row>
  2506. <entry></entry>
  2507. <entry>NOT LIKE <emphasis>pattern</emphasis> where the pattern
  2508. uses SQL LIKE operators with % and _ wildcards.</entry>
  2509. </row>
  2510. <row>
  2511. <entry><emphasis>limitNumber</emphasis></entry>
  2512. <entry>Optional. The number of rows to return. This overrides
  2513. the default configuration attribute (<emphasis
  2514. role="code">EclResultLimit </emphasis>) but cannot be set to
  2515. ALL.</entry>
  2516. </row>
  2517. </tbody>
  2518. </tgroup>
  2519. </informaltable></para>
  2520. <para><superscript>1</superscript>Aliasing not supported</para>
  2521. <para><superscript>2</superscript>Can only contain references to
  2522. aggregate functions<superscript></superscript>if used with
  2523. <emphasis>having</emphasis> clause.</para>
  2524. <para>Aggregate functions can only be expressed in logicalExpressions by
  2525. using <emphasis>Group by</emphasis>and
  2526. <emphasis>having</emphasis></para>
  2527. <para>Examples:</para>
  2528. <programlisting>Select * from tableList where Sum(F1 &gt; 100) /* is NOT SUPPORTED */
  2529. Select * from tableList Group by F1 Having Sum (F1 &gt; 100) /* IS SUPPORTED */</programlisting>
  2530. <para>Example:</para>
  2531. <para><programlisting>Select t1.personname, t2.address
  2532. from persontable as t1 inner join addresstable as t2
  2533. on (t1.personid = t2.personid AND
  2534. (t1.firstname = 'jim' AND
  2535. t1.lastname = 'smith' )) </programlisting></para>
  2536. <para></para>
  2537. <para>The interface does not convert parameter list or column list
  2538. values to string literals.</para>
  2539. <para>String values should be single quote encapsulated. Field
  2540. identifier can be left unquoted or double quoted.</para>
  2541. <para>For example, the table <emphasis role="bold">persons</emphasis>
  2542. has columns lastname(String) and Zip (numeric)</para>
  2543. <para><programlisting>Select Firstname from persons where lastname = 'Jones' and zip &gt; 33445 /* works */
  2544. Select Firstname from persons where lastname = 'Jones' and "zip" &gt; 33445 /* also works */
  2545. Select Firstname from persons where lastname = Jones and zip &gt; 33445 /* doesn't work */
  2546. Select Firstname from persons where lastname = 'Jones' and zip &gt; '33445' /* doesn't work */</programlisting></para>
  2547. <para></para>
  2548. </sect1>
  2549. <sect1>
  2550. <title>CREATE / LOAD</title>
  2551. <para><emphasis role="bold">create table</emphasis> <emphasis
  2552. role="bold">[if not exists]</emphasis> <emphasis>newtablename</emphasis>
  2553. <emphasis
  2554. role="bold">'('(</emphasis><emphasis>fieldname</emphasis><emphasis
  2555. role="bold">(</emphasis><emphasis>fieldtype</emphasis><emphasis
  2556. role="bold">[</emphasis><emphasis>fieldlen</emphasis><emphasis
  2557. role="bold">[</emphasis><emphasis>,precision</emphasis><emphasis
  2558. role="bold">]][</emphasis><emphasis
  2559. role="bold">UNSIGNED</emphasis><emphasis role="bold">][,]
  2560. ))+')'</emphasis></para>
  2561. <para><emphasis role="bold">[comment</emphasis> 'commenttext'<emphasis
  2562. role="bold">]<emphasis role="bold">[;]</emphasis></emphasis></para>
  2563. <para><emphasis role="bold">load data infile</emphasis>
  2564. '<emphasis>sourcetablename</emphasis>' <emphasis
  2565. role="bold">[connection</emphasis> '<emphasis>landingzoneIP</emphasis>'
  2566. <emphasis role="bold">directory</emphasis>
  2567. '<emphasis>landingzonepath</emphasis>'<emphasis
  2568. role="bold">]</emphasis></para>
  2569. <para><emphasis role="bold">into table</emphasis> <emphasis>newtablename
  2570. </emphasis></para>
  2571. <para><emphasis role="bold">[(fields | columns) [ terminated by
  2572. '</emphasis><emphasis>fieldDelimiter</emphasis>'<emphasis role="bold">]
  2573. [ enclosed by '</emphasis><emphasis>quoteChar</emphasis><emphasis
  2574. role="bold">']</emphasis><emphasis role="bold"> [ escaped by
  2575. '</emphasis><emphasis>escapeChar</emphasis><emphasis
  2576. role="bold">']]]</emphasis></para>
  2577. <para><emphasis role="bold">[lines [ terminated by
  2578. '</emphasis><emphasis>recordDelimiter</emphasis>'<emphasis
  2579. role="bold">]]<emphasis role="bold">[;]</emphasis></emphasis></para>
  2580. <para>The CREATE TABLE and LOAD DATA SQL statements allow you to create
  2581. a file in an HPCC cluster that is accessible via WsSQL. You can populate
  2582. the new file from data in a logical file already on the HPCC cluster or
  2583. one that is on a landing zone.</para>
  2584. <para>All Create requests MUST be accompanied by a Load request. You
  2585. cannot create a table with the intention to load or insert data
  2586. later.</para>
  2587. <para><informaltable colsep="1" frame="all" rowsep="1">
  2588. <tgroup cols="2">
  2589. <colspec colwidth="123.45pt" />
  2590. <colspec />
  2591. <tbody>
  2592. <row>
  2593. <entry><emphasis>newtablename</emphasis></entry>
  2594. <entry>The logical filename to create on the HPCC cluster.
  2595. <emphasis role="bold">Note: </emphasis>Create and Load must
  2596. target the same file.</entry>
  2597. </row>
  2598. <row>
  2599. <entry><emphasis>commenttext</emphasis></entry>
  2600. <entry>A text comment to add to the logical file's
  2601. description</entry>
  2602. </row>
  2603. <row>
  2604. <entry><emphasis>sourcetablename</emphasis></entry>
  2605. <entry>The source file from which to extract data to load into
  2606. the new table. This can be a logical file on an HPCC cluster
  2607. or a physical file on a landing zone. For a landing zone file,
  2608. you MUST provide a <emphasis role="bold">connection</emphasis>
  2609. '<emphasis>landingzoneIP</emphasis>' and a <emphasis
  2610. role="bold">directory</emphasis>
  2611. '<emphasis>landingzonepath</emphasis>' (the path to the file).
  2612. For a landing zone file, be sure to use matching case for the
  2613. filename.</entry>
  2614. </row>
  2615. <row>
  2616. <entry><emphasis>landingzoneIP</emphasis></entry>
  2617. <entry>The IP Address or hostname of the HPCC Landing
  2618. Zone</entry>
  2619. </row>
  2620. <row>
  2621. <entry><emphasis>landingzonepath</emphasis></entry>
  2622. <entry>The path to the datafile on the Landing Zonebut</entry>
  2623. </row>
  2624. <row>
  2625. <entry><emphasis>fieldDelimiter</emphasis></entry>
  2626. <entry>String value for field delimiter</entry>
  2627. </row>
  2628. <row>
  2629. <entry><emphasis>quoteChar</emphasis></entry>
  2630. <entry>String Value for the quote character</entry>
  2631. </row>
  2632. <row>
  2633. <entry><emphasis>escapeChar</emphasis></entry>
  2634. <entry>String Value for the escape character</entry>
  2635. </row>
  2636. <row>
  2637. <entry><emphasis>recordDelimiter</emphasis></entry>
  2638. <entry>String value for record delimiter</entry>
  2639. </row>
  2640. </tbody>
  2641. </tgroup>
  2642. </informaltable></para>
  2643. <para>Examples:</para>
  2644. <programlisting>CREATE TABLE newCustomerFile (id DECIMAL( 30, 5), mytint INT(9),
  2645. mydouble DOUBLE (5,3) UNSIGNED)
  2646. COMMENT 'this file created via WsSQL and populated from file on lz';
  2647. LOAD DATA INFILE 'CustomerData' CONNECTION '127.0.0.1'
  2648. DIRECTORY '/var/lib/HPCCSystems/mydropzone'
  2649. INTO TABLE newCustomerFile;
  2650. CREATE TABLE newCustomerFile2 (id DECIMAL( 30, 5), mytint INT(9),
  2651. mydouble DOUBLE (5,3) UNSIGNED)
  2652. COMMENT 'this file created via WsSQL and populated from sprayed file';
  2653. LOAD DATA INFILE 'thor::customerdata::customers' INTO TABLE newCustomerFile2
  2654. CREATE TABLE IF NOT EXISTS newCustomerFile3 (id DECIMAL( 30, 5), mytint INT(9),
  2655. mydouble DOUBLE (5,3) UNSIGNED)
  2656. COMMENT 'won't overwrite';
  2657. LOAD DATA INFILE 'thor::customerdata::customers' INTO TABLE newCustomerFile3
  2658. CREATE TABLE newCustomerFile4CSV (id DECIMAL( 30, 5), mytint INT(9),
  2659. mydouble DOUBLE (5,3) UNSIGNED)
  2660. COMMENT 'Loading CSV data';
  2661. LOAD DATA INFILE 'somecsvfile.csv' FIELDS TERMINATED BY ',' ENCLOSED BY '"'
  2662. LINES TERMINATED BY 'n'
  2663. INTO TABLE newCustomerFile4CSV
  2664. </programlisting>
  2665. </sect1>
  2666. <sect1>
  2667. <title>Supported Aggregate Functions</title>
  2668. <para><emphasis
  2669. role="bold">COUNT</emphasis>([DISTINCT]<emphasis>columnName</emphasis>)</para>
  2670. <para><emphasis
  2671. role="bold">DISTINCT</emphasis>(<emphasis>columnName</emphasis>)</para>
  2672. <para><emphasis
  2673. role="bold">SUM</emphasis>(<emphasis>columnName</emphasis>)</para>
  2674. <para><emphasis
  2675. role="bold">MIN</emphasis>(<emphasis>columnName</emphasis>)</para>
  2676. <para><emphasis
  2677. role="bold">MAX</emphasis>(<emphasis>columnName</emphasis>)</para>
  2678. <para><emphasis
  2679. role="bold">AVG</emphasis>(<emphasis>columnName</emphasis>)</para>
  2680. <para>These aggregate functions are supported. They behave as their ECL
  2681. counterparts. See the <emphasis role="bold">ECL Language
  2682. Reference</emphasis> for details.</para>
  2683. <para><informaltable colsep="1" frame="all" rowsep="1">
  2684. <tgroup cols="2">
  2685. <colspec colwidth="200pt" />
  2686. <colspec />
  2687. <tbody>
  2688. <row>
  2689. <entry>COUNT</entry>
  2690. <entry>Counts the occurrences of columnName in the result,
  2691. always an integer.</entry>
  2692. </row>
  2693. <row>
  2694. <entry>DISTINCT</entry>
  2695. <entry>Returns only distinct values of columnName in the
  2696. result, output type is dependent on input type.</entry>
  2697. </row>
  2698. <row>
  2699. <entry>SUM</entry>
  2700. <entry>Returns the sum of the values of columnName in the
  2701. result, output type is dependent on input type.</entry>
  2702. </row>
  2703. <row>
  2704. <entry>MIN</entry>
  2705. <entry>Returns the minimum value for of columnName in the
  2706. result, output type is dependent on input type.</entry>
  2707. </row>
  2708. <row>
  2709. <entry>MAX</entry>
  2710. <entry>Returns the minimum value for of columnName in the
  2711. result, output type is dependent on input type.</entry>
  2712. </row>
  2713. <row>
  2714. <entry>AVG</entry>
  2715. <entry>Returns the average of the values of columnName in the
  2716. result, always a real number.</entry>
  2717. </row>
  2718. <row>
  2719. <entry>columnName</entry>
  2720. <entry>The column to aggregate.</entry>
  2721. </row>
  2722. </tbody>
  2723. </tgroup>
  2724. </informaltable></para>
  2725. <para>Example:</para>
  2726. <para><programlisting>Select fname, lname, state, COUNT(zip) from TutorialPerson where zip='33024'</programlisting></para>
  2727. <sect2>
  2728. <title>Supported String Modifiers</title>
  2729. <para><emphasis
  2730. role="bold">UPPER</emphasis>(<emphasis>columnName</emphasis>)</para>
  2731. <para><emphasis
  2732. role="bold">LOWER</emphasis>(<emphasis>columnName</emphasis>)</para>
  2733. <para></para>
  2734. <informaltable colsep="1" frame="all" rowsep="1">
  2735. <tgroup cols="2">
  2736. <colspec colwidth="200pt" />
  2737. <colspec />
  2738. <tbody>
  2739. <row>
  2740. <entry>UPPER</entry>
  2741. <entry>Returns with all lower case characters converted to
  2742. upper case.</entry>
  2743. </row>
  2744. <row>
  2745. <entry>LOWER</entry>
  2746. <entry>Returns with all upper case characters converted to
  2747. lower case.</entry>
  2748. </row>
  2749. <row>
  2750. <entry>columnName</entry>
  2751. <entry>The column to aggregate</entry>
  2752. </row>
  2753. </tbody>
  2754. </tgroup>
  2755. </informaltable>
  2756. </sect2>
  2757. <sect2 role="brk">
  2758. <title>Special considerations</title>
  2759. <para>Since this service uses both ECL and SQL, there are a few
  2760. special considerations when designing the backend databases and stored
  2761. procedures.</para>
  2762. <sect3>
  2763. <title>Reserved SQL Keywords</title>
  2764. <para>Your HPCC identifiers (field names, Stored Procedure names,
  2765. etc) cannot use SQL reserved words such as:</para>
  2766. <programlisting>ADD ALL ANY AS ASC AT AVG BETWEEN BOOL BOOLEAN BY CALL COLUMN CONTAINS COUNT
  2767. DESC DISTINCT FALSE FOR FROM GROUP HAVING IN INDEX INNER IS JOIN KEY KEYS LAST
  2768. LEFT LIKE LIMIT LOWER MAX MIN MOD NOT NULL OFFSET ON ORDER OUT OUTER POWER SELECT
  2769. SUM TABLE TRUE UPPER USE WHERE XOR DIV MOD OR AND</programlisting>
  2770. </sect3>
  2771. <sect3>
  2772. <title>Special Characters</title>
  2773. <para>Your HPCC filenames should avoid special characters other
  2774. than:</para>
  2775. <programlisting>( 'A'..'Z' | 'a'..'z' | '' | '$') ( 'A'..'Z' | 'a'..'z' | '' | '$' | '0'..'9' )
  2776. File names can be prefixed with a ~ (tilde) or .::
  2777. </programlisting>
  2778. <para>If a filename is not supported, it will not be returned when
  2779. interrogating the system using GetDBMetaData.</para>
  2780. </sect3>
  2781. </sect2>
  2782. </sect1>
  2783. </chapter>
  2784. </book>