12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848 |
- <?xml version="1.0" encoding="utf-8"?>
- <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
- "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
- <book lang="en_US" xml:base="../">
- <bookinfo>
- <title>WsSQL ESP Web Service Guide</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/redswooshWithLogo3.jpg" />
- </imageobject>
- </mediaobject>
- <author>
- <surname>Boca Raton Documentation Team</surname>
- </author>
- <legalnotice>
- <para>We welcome your comments and feedback about this document via
- email to <email>docfeedback@hpccsystems.com</email> Please include
- <emphasis role="bold">Documentation Feedback</emphasis> in the subject
- line and reference the document name, page numbers, and current Version
- Number in the text of the message.</para>
- <para>LexisNexis and the Knowledge Burst logo are registered trademarks
- of Reed Elsevier Properties Inc., used under license. Other products,
- logos, and services may be trademarks or registered trademarks of their
- respective companies. All names and example data used in this manual are
- fictitious. Any similarity to actual persons, living or dead, is purely
- coincidental.</para>
- <para></para>
- </legalnotice>
- <xi:include href="common/Version.xml" xpointer="xpointer(//*[@id='FooterInfo'])"
- xmlns:xi="http://www.w3.org/2001/XInclude" />
- <xi:include href="common/Version.xml" xpointer="xpointer(//*[@id='DateVer'])"
- xmlns:xi="http://www.w3.org/2001/XInclude" />
- <corpname>HPCC Systems</corpname>
- <xi:include href="common/Version.xml" xpointer="xpointer(//*[@id='Copyright'])"
- xmlns:xi="http://www.w3.org/2001/XInclude" />
- <mediaobject role="logo">
- <imageobject>
- <imagedata fileref="images/LN_Rightjustified.jpg" />
- </imageobject>
- </mediaobject>
- </bookinfo>
- <chapter>
- <title>Introduction</title>
- <para>The WsSQL Web service is an add-on service that provides an SQL
- interface into HPCC Systems. The Web service accepts a subset of prepared
- and standard SQL queries. This provides access to most HPCC data and
- published queries over HTTP or HTTPS using SOAP or REST interfaces.</para>
- <para>The WsSQL service maps HPCC logical files to RDBMS tables. HPCC
- Published Queries are exposed as RDBMS Stored Procedures.</para>
- <para>The WsSQL service also provides convenient methods to obtain system
- information, metadata, and results from previously run queries.</para>
- <para>This service is intended to be used in a programmatic fashion (for
- example, via database drivers), but can also be used in an interactive
- fashion by users who are more comfortable using SQL than ECL. This makes
- it possible to submit ad-hoc queries without learning ECL.</para>
- <para>The service exposes HPCC logical files as RDB tables.</para>
- <para><itemizedlist mark="bullet">
- <listitem>
- <para>HPCC Logical File <-> RDB Table</para>
- </listitem>
- <listitem>
- <para>HPCC Record Fields <-> RDB Table Columns</para>
- </listitem>
- <listitem>
- <para>HPCC Published query <-> RDB Stored Procedure</para>
- </listitem>
- <listitem>
- <para>Provides HPCC system and data RDB metadata</para>
- </listitem>
- <listitem>
- <para>Supports subset of SQL syntax</para>
- </listitem>
- <listitem>
- <para>Non-transactional</para>
- </listitem>
- <listitem>
- <para>Provides means for utilizing HPCC index files for faster
- reads.</para>
- <para></para>
- </listitem>
- </itemizedlist></para>
- <sect1>
- <title>Supported File Types</title>
- <para>The WsSQL service supports all HPCC file types except :</para>
- <para><itemizedlist>
- <listitem>
- <para>XML</para>
- </listitem>
- <listitem>
- <para>Files with Nested Child Datasets</para>
- </listitem>
- <listitem>
- <para>Files without record layout in its metadata.</para>
- <para>The WsSQL service <emphasis role="bold">only supports files
- which contain the record definition in the logical file's
- metadata.</emphasis> Sprayed files do not contain this metadata.
- This metadata exists on any file or index which is written to the
- HPCC Distributed File System (DFS). Sprayed data files typically
- undergo some processing and an OUTPUT of the transformed data to
- disk before use, so this should not interfere with the service's
- usefulness. You can use the
- <emphasis>CreateTableAndLoad</emphasis> method to produce a usable
- file from a sprayed file or one on a landing zone. See <link
- linkend="CreateTableAndLoad">CreateTableAndLoad</link> for
- details.</para>
- </listitem>
- </itemizedlist></para>
- </sect1>
- </chapter>
- <chapter>
- <title>Setup</title>
- <para>The WsSQL service is included in the HPCC Platform. </para>
- <sidebar>
- <para>Prior to version 7.0, WsSQL was an add-on product and was
- installed separately. If you have a system configured with WsSQL prior
- to version 7.0, you should uninstall WsSQL before upgrading the
- platform.</para>
- </sidebar>
- <sect1 id="Quick_Start" role="nobrk">
- <title>Configuration </title>
- <para>We recommend taking the time to read this manual in its entirety;
- however, the following is a quick start summary of steps.</para>
- <para></para>
- <sect2>
- <title>Configure Using Wizard</title>
- <para><orderedlist>
- <listitem>
- <para>Once Configuration Manager is running:</para>
- </listitem>
- <listitem>
- <para>Create a new environment using the wizard.</para>
- <para>The WsSQL service is automatically added and its service
- binding is created in the ESP Server's configuration.</para>
- </listitem>
- <listitem>
- <para>Save the environment file.</para>
- </listitem>
- <listitem>
- <para>Copy your environment.xml file to all servers.</para>
- <para><programlisting># for example
- sudo -u hpcc cp /etc/HPCCSystems/source/NewEnvironment.xml /etc/HPCCSystems/environment.xml</programlisting></para>
- </listitem>
- <listitem>
- <para>Exit Configuration manager.</para>
- </listitem>
- <listitem>
- <para>Restart the system.</para>
- </listitem>
- <listitem>
- <para>Access the WsSQL interface in your browser (port
- 8510).</para>
- </listitem>
- <listitem>
- <para>Run the Echo method to confirm connectivity. See
- <citebiblioid><link
- linkend="echotest">Echo</link></citebiblioid>.</para>
- </listitem>
- </orderedlist></para>
- </sect2>
- <sect2>
- <title>Configure Manually</title>
- <para>This method is useful when adding the WsSQL service to an
- existing system that did not have a service configured or to add an
- additional WsSql service.</para>
- <para><orderedlist>
- <listitem>
- <para>Once Configuration Manager is running:</para>
- </listitem>
- <listitem>
- <para>Open an environment file (*.xml) in Advanced Mode.</para>
- <para>If you are adding WsSQL to an existing system, open an
- environment file that matches the live environment.xml. It is
- highlighted.</para>
- </listitem>
- <listitem>
- <para>Check the Write Access box.</para>
- </listitem>
- <listitem>
- <para>Right-click on the <emphasis
- role="bold">Software</emphasis> portion of the tree in the left
- panel, and select <emphasis role="bold">New ESP
- Service</emphasis> > <emphasis role="bold">ws_sql</emphasis>
- .</para>
- <para><graphic fileref="images/AddWsSQLService.jpg" /></para>
- <para>This adds a definition for the service.</para>
- </listitem>
- <listitem>
- <para>Select the <emphasis role="bold">ESP</emphasis> component,
- then select the ESP Service Bindings tab.</para>
- <para><graphic
- fileref="images/WsSQLServiceBinding2.jpg" /></para>
- </listitem>
- <listitem>
- <para>Provide the name of the service to bind and the port.
- (Default port is 8510)</para>
- </listitem>
- <listitem>
- <para>Save the environment file.</para>
- </listitem>
- <listitem>
- <para>Copy your environment.xml file to all servers</para>
- <programlisting># for example
- sudo -u hpcc cp /etc/HPCCSystems/source/NewEnvironment.xml /etc/HPCCSystems/environment.xml</programlisting>
- </listitem>
- <listitem>
- <para>Exit Configuration manager.</para>
- </listitem>
- <listitem>
- <para>Restart the system.</para>
- </listitem>
- <listitem>
- <para>Access the WsSQL interface in your browser:</para>
- <para>Using <emphasis>http://nnn.nnn.nnn.nnn:pppp</emphasis>
- (where nnn.nnn.nnn.nnn is your ESP Server's IP Address and pppp
- is the WsSQL service port. The default port is 8510)</para>
- </listitem>
- <listitem>
- <para>Run the Echo method to confirm connectivity. See
- <citebiblioid><link
- linkend="echotest">Echo</link></citebiblioid>.</para>
- </listitem>
- </orderedlist></para>
- </sect2>
- </sect1>
- </chapter>
- <chapter>
- <title>Using HPCC Files as a data source</title>
- <para>Once installed and configured, the WsSQL service will process
- submitted SQL statements and generate dynamic ECL code. The code is
- submitted to and executed by your HPCC Platform. The result set is
- returned to your application.</para>
- <para><variablelist>
- <varlistentry>
- <term>Note:</term>
- <listitem>
- <para>The WsSQL service <emphasis role="bold">only supports files
- which contain the record definition in the logical file's
- metadata.</emphasis> Sprayed files do not contain this metadata.
- This metadata exists on any file or index which is written to the
- HPCC Distributed File System (DFS). Sprayed data files typically
- undergo some processing and an OUTPUT of the transformed data to
- disk before use, so this should not interfere with the service's
- usefulness. You can use the
- <emphasis>CreateTableAndLoad</emphasis> method to produce a usable
- file from a sprayed file or one on a landing zone. See <link
- linkend="CreateTableAndLoad">CreateTableAndLoad</link> for
- details.</para>
- </listitem>
- </varlistentry>
- </variablelist></para>
- <para>In addition, you can utilize indexes on the HPCC in one of two
- ways:</para>
- <orderedlist numeration="arabic">
- <listitem>
- <para>Provide SQL hints to tell service to use a specific index for
- your query.</para>
- <para>For example:</para>
- <programlisting>USEINDEX(TutorialPersonByZipIndex)</programlisting>
- </listitem>
- <listitem>
- <para>Specify the related indexes in the HPCC logical file
- description.</para>
- </listitem>
- </orderedlist>
- <sect1 role="nobrk">
- <title>Index Annotations</title>
- <para>The WsSQL service attempts to perform index based reads whenever
- possible. However, in order to take advantage of index reads, the target
- HPCC files need to be annotated with the pertinent index file names.
- This is accomplished by adding the following key/value entry on the
- file's description using ECL Watch.</para>
- <para>From a logical file's details page, enter the information in the
- Description entry box, then press the <emphasis role="bold">Save
- Description</emphasis> button.</para>
- <para>This information is used by the service to decide if an index
- fetch is possible for a query on the base file.</para>
- <sect2>
- <title><emphasis role="bold">On source file:</emphasis></title>
- <para><emphasis role="bold">XDBC:RelIndexes=
- [</emphasis><emphasis><emphasis
- role="bold"><emphasis>fullLogicalFilename1</emphasis></emphasis></emphasis><emphasis
- role="bold">;<emphasis>
- fullLogicalFilename2</emphasis></emphasis><emphasis
- role="bold">]</emphasis></para>
- <para></para>
- <para>Example:</para>
- <programlisting>XDBC:RelIndexes=[tutorial::yn::peoplebyzipindex;
- tutorial::yn::peoplebyzipindex2;
- tutorial::yn::peoplebyzipindex3]</programlisting>
- <para>In this example, the source file has three indexes
- available.</para>
- <para>You can add annotations using the <link
- linkend="SetRelatedIndexes">SetRelatedIndexes</link> method.</para>
- </sect2>
- <sect2 role="brk">
- <title><emphasis role="bold">On the index file:</emphasis></title>
- <para><emphasis
- role="bold">XDBC:PosField=[</emphasis><emphasis>indexPositionFieldName</emphasis><emphasis
- role="bold">]</emphasis></para>
- <para></para>
- <para>Example:</para>
- <programlisting>XDBC:PosField=[fpos]</programlisting>
- <para>The FilePosition field (fpos) can have any name, so it must be
- specified in the metadata so the service knows which field is the
- fileposition.</para>
- <para>Simply enter the information in the description entry box, then
- press the <emphasis role="bold">Save Description</emphasis>
- button.</para>
- <variablelist>
- <varlistentry>
- <term>Note:</term>
- <listitem>
- <para>You should enter this information BEFORE publishing any
- query using the data file or indexes. Published queries lock the
- file and would prevent editing the metadata.</para>
- </listitem>
- </varlistentry>
- </variablelist>
- <para></para>
- </sect2>
- </sect1>
- </chapter>
- <chapter>
- <title>Methods</title>
- <para>These methods are included in the WsSQL service interface:</para>
- <para></para>
- <itemizedlist>
- <listitem>
- <para><emphasis role="bold">Echo</emphasis></para>
- <para>This method is provided to test end-to-end communication. The
- Input string is echoed in response.</para>
- </listitem>
- <listitem>
- <para><emphasis role="bold">GetDBSystemInfo</emphasis></para>
- <para>You can use this method to gather version information from the
- HPCC Platform.</para>
- </listitem>
- <listitem>
- <para><emphasis role="bold">GetMetadata</emphasis></para>
- <para>This method provides metadata you can use to create a view or
- model of the target HPCC system as a SQL accessible DB. You can
- request Tables, Stored Procedures, and/or Targetclusters.</para>
- </listitem>
- <listitem>
- <para><emphasis role="bold">ExecuteSQL</emphasis></para>
- <para>Use this method to submit standard (non-prepared) SQL queries.
- This method accepts free-hand SQL text (see supported grammar
- below).</para>
- </listitem>
- <listitem>
- <para><emphasis role="bold">GetRelatedIndexes</emphasis></para>
- <para>This method retrieves information from a logical file's
- description about related indexes.</para>
- </listitem>
- <listitem>
- <para><emphasis role="bold">GetResults</emphasis></para>
- <para>This method provides results from previously executed
- queries.</para>
- </listitem>
- <listitem>
- <para><emphasis role="bold">PrepareSQL</emphasis></para>
- <para>This method provides the ability to submit a free-hand SQL
- request for later use as a parameterized query. It compiles the query
- and returns the Workunit ID (WUID). This WUID is later used to execute
- the query with provided input parameters using the ExecutePreparedSQL
- method. This is ideal for queries which are executed many times with
- different values.</para>
- </listitem>
- <listitem>
- <para><emphasis role="bold">ExecutePreparedSQL</emphasis></para>
- <para>This method executes a previously created parameterized SQL
- query. The query is referenced using a Workunit ID (WUID), which is
- returned from the PrepareSQL method. The caller can specify sequence
- of input parameters as key-value pairs, which are bound to the
- precompiled query.</para>
- </listitem>
- <listitem>
- <para><emphasis role="bold">CreateTableAndLoad</emphasis></para>
- <para>This method reads a logical file or a file on a landing zone and
- creates a new table and loads the data from the source file creating a
- table (logical file) that WsSQL can use. This function is intended to
- use when you have a logical file without metadata or to import a new
- file into an HPCC platform.</para>
- </listitem>
- <listitem>
- <para><emphasis role="bold">SetRelatedIndexes</emphasis></para>
- <para>This method adds information to a logical file's description
- that WsSQL uses as an annotation of a related index.</para>
- </listitem>
- </itemizedlist>
- <sect1 id="echotest">
- <title>Echo</title>
- <para>This function takes an input string and "echoes" the value in its
- result.</para>
- <para>This function is intended for end-to-end connectivity testing. A
- successful response indicates a good connection to the server hosting
- the Ws-SQL Web service. This function is designed for connectivity
- testing.</para>
- <para>We recommend using this function as a first step of the
- application development process.</para>
- <sect2>
- <title>Sample Input XML</title>
- <para><programlisting><soap:Envelope>
- <soap:Body>
- <EchoRequest>
- <Request><emphasis role="bluebold">StringToEcho</emphasis></Request>
- </EchoRequest>
- </soap:Body>
- </soap:Envelope>
- </programlisting></para>
- </sect2>
- <sect2>
- <title>Request Tag Descriptions</title>
- <para><informaltable colsep="1" frame="all" rowsep="1">
- <tgroup cols="3">
- <colspec colwidth="200pt" />
- <colspec colwidth="40 pt" />
- <colspec />
- <tbody>
- <row>
- <entry><?dbfo bgcolor="LightCyan"?>Tag Name</entry>
- <entry><?dbfo bgcolor="LightCyan"?>Req?</entry>
- <entry><?dbfo bgcolor="LightCyan"?>Description</entry>
- </row>
- <row>
- <entry><programlisting role="wsig">EchoRequest</programlisting></entry>
- <entry>N</entry>
- <entry>Structure containing the request</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Request</programlisting></entry>
- <entry>N</entry>
- <entry>String to echo in result</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable></para>
- </sect2>
- <sect2>
- <title>Response Tag Descriptions</title>
- <para><informaltable colsep="1" frame="all" rowsep="1">
- <tgroup cols="2">
- <colspec colwidth="200 pt" />
- <colspec />
- <tbody>
- <row>
- <entry><?dbfo bgcolor="LightCyan"?>Tag Name</entry>
- <entry><?dbfo bgcolor="LightCyan"?>Description</entry>
- </row>
- <row>
- <entry><programlisting role="wsig">EchoResponse</programlisting></entry>
- <entry>Structure containing response</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Response</programlisting></entry>
- <entry>Response</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable></para>
- </sect2>
- </sect1>
- <sect1>
- <title>GetDBSystemInfo</title>
- <para>This method allows you to get HPCC System version
- information.</para>
- <sect2>
- <title>Sample Input XML</title>
- <para><programlisting><soap:Envelope>
- <soap:Body>
- <GetDBSystemInfoRequest>
- <IncludeAll><emphasis role="bluebold">1</emphasis></IncludeAll>
- </GetDBSystemInfoRequest>
- </soap:Body>
- </soap:Envelope>
- </programlisting></para>
- </sect2>
- <sect2>
- <title>Request Tag Descriptions</title>
- <para><informaltable colsep="1" frame="all" rowsep="1">
- <tgroup cols="3">
- <colspec colwidth="200pt" />
- <colspec colwidth="40 pt" />
- <colspec />
- <tbody>
- <row>
- <entry><?dbfo bgcolor="LightCyan"?>Tag Name</entry>
- <entry><?dbfo bgcolor="LightCyan"?>Req?</entry>
- <entry><?dbfo bgcolor="LightCyan"?>Description</entry>
- </row>
- <row>
- <entry><programlisting role="wsig">GetDBSystemInfoRequest</programlisting></entry>
- <entry>Y</entry>
- <entry>Structure containing the request</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> IncludeAll</programlisting></entry>
- <entry>N</entry>
- <entry>If set to 1 or true, all available information is
- returned</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable></para>
- </sect2>
- <sect2>
- <title>Response Tag Descriptions</title>
- <para><informaltable colsep="1" frame="all" rowsep="1">
- <tgroup cols="2">
- <colspec colwidth="200pt" />
- <colspec />
- <tbody>
- <row>
- <entry><?dbfo bgcolor="LightCyan"?>Tag Name</entry>
- <entry><?dbfo bgcolor="LightCyan"?>Description</entry>
- </row>
- <row>
- <entry><programlisting role="wsig">GetDBSystemInfoResponse</programlisting></entry>
- <entry>Structure containing response</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Exceptions</programlisting></entry>
- <entry>Structure containing exceptions. See <link
- linkend="ExceptionStructure">Exceptions Structure</link> in
- Common Structures</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Name</programlisting></entry>
- <entry>Name.</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> FullVersion</programlisting></entry>
- <entry>Full Version of HPCC Platform</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Major</programlisting></entry>
- <entry>Major of HPCC Platform</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Minor</programlisting></entry>
- <entry>Minor of HPCC Platform</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Point</programlisting></entry>
- <entry>Point of HPCC Platform</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Project</programlisting></entry>
- <entry>Project of HPCC Platform</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Maturity</programlisting></entry>
- <entry>Maturity of HPCC Platform</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> WsSQLFullVersion</programlisting></entry>
- <entry>Full Version of WsSQL</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> WsSQLMajor </programlisting></entry>
- <entry>Major of WsSQL</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> WsSQLMinor </programlisting></entry>
- <entry>Minor of WsSQL</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> WsSQLPoint </programlisting></entry>
- <entry>Point of WsSQL</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> WsSQLProject </programlisting></entry>
- <entry>Project of WsSQL</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> WsSQLMaturity</programlisting></entry>
- <entry>Maturity of WsSQL</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable></para>
- </sect2>
- </sect1>
- <sect1>
- <title>GetDBMetaData</title>
- <para>This methods allows you to query the HPCC Platform and get
- metadata to use to create a view or model of the target HPCC system as a
- SQL accessible DB.</para>
- <para>You can request one or more of the followinfg:</para>
- <itemizedlist>
- <listitem>
- <para>Tables (Logical files in the HPCC Cluster)</para>
- </listitem>
- <listitem>
- <para>Stored Procedures (Published Queries)</para>
- </listitem>
- <listitem>
- <para>TargetClusters</para>
- </listitem>
- </itemizedlist>
- <sect2>
- <title>Sample Input XML</title>
- <para><programlisting><soap:Envelope>
- <soap:Body>
- <GetDBMetaDataRequest>
- <IncludeTables><emphasis role="bluebold">1</emphasis></IncludeTables>
- <TableFilter/>
- <IncludeStoredProcedures><emphasis role="bluebold">1</emphasis></IncludeStoredProcedures>
- <QuerySet/>
- <IncludeTargetClusters><emphasis role="bluebold">1</emphasis></IncludeTargetClusters>
- <ClusterType/>
- </GetDBMetaDataRequest>
- </soap:Body>
- </soap:Envelope></programlisting></para>
- </sect2>
- <sect2>
- <title>Request Tag Descriptions</title>
- <para><informaltable colsep="1" frame="all" rowsep="1">
- <tgroup cols="3">
- <colspec colwidth="200pt" />
- <colspec colwidth="40 pt" />
- <colspec />
- <tbody>
- <row>
- <entry><?dbfo bgcolor="LightCyan"?>Tag Name</entry>
- <entry><?dbfo bgcolor="LightCyan"?>Req?</entry>
- <entry><?dbfo bgcolor="LightCyan"?>Description</entry>
- </row>
- <row>
- <entry><programlisting role="wsig">GetDBMetaDataRequest</programlisting></entry>
- <entry>Y</entry>
- <entry>Structure containing the request</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> IncludeTables</programlisting></entry>
- <entry>N</entry>
- <entry>If set to 1 or true, available tables are included in
- response</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> TableFilter</programlisting></entry>
- <entry>N</entry>
- <entry>Filter for table results</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> IncludeStoredProcedures</programlisting></entry>
- <entry>N</entry>
- <entry>If set to 1 or true, available Stored Procedures are
- included in response</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> QuerySet</programlisting></entry>
- <entry>N</entry>
- <entry>QuerySet to use as filter for Stored procedures to
- return</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> IncludeTargetClusters</programlisting></entry>
- <entry>N</entry>
- <entry>If set to 1 or true, available Target Clusters are
- included in response</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> ClusterType</programlisting></entry>
- <entry>N</entry>
- <entry>Cluster type to use as filter</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable></para>
- </sect2>
- <sect2 role="brk">
- <title>Response Tag Descriptions</title>
- <para><informaltable colsep="1" frame="all" rowsep="1">
- <tgroup cols="2">
- <colspec colwidth="200pt" />
- <colspec />
- <tbody>
- <row>
- <entry><?dbfo bgcolor="LightCyan"?>Tag Name</entry>
- <entry><?dbfo bgcolor="LightCyan"?>Description</entry>
- </row>
- <row>
- <entry><programlisting role="wsig">GetDBMetaDataResponse</programlisting></entry>
- <entry>Structure containing response</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Exceptions</programlisting></entry>
- <entry>Structure containing exceptions. See <link
- linkend="ExceptionStructure">Exceptions Structure</link> in
- Common Structures</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> TableCount</programlisting></entry>
- <entry>Count of available tables</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Tables</programlisting></entry>
- <entry>Structure containing one or more tables</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Table</programlisting></entry>
- <entry>Structure containing one table</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Name</programlisting></entry>
- <entry>Table name</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Columns</programlisting></entry>
- <entry>Structure containing one or more columns</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Column</programlisting></entry>
- <entry>Column</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Name</programlisting></entry>
- <entry>Column name</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Type</programlisting></entry>
- <entry>Column data type (e.g., unsigned8, string3)</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> ECL</programlisting></entry>
- <entry>ECL Definition for the table</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Format</programlisting></entry>
- <entry>Table format (e.g., FLAT, KEYED, etc)</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> ContentType</programlisting></entry>
- <entry>Content Type</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Description</programlisting></entry>
- <entry>Description</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> IsKeyed</programlisting></entry>
- <entry>Boolean indicator: Is this an index?</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> IsSuper</programlisting></entry>
- <entry>Boolean indicator: Is this a superfile?</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> CsvQuote</programlisting></entry>
- <entry>Quote character (only valid for CSV files)</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> CsvSeparate</programlisting></entry>
- <entry>Separator character (only valid for CSV
- files)</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> CsvTerminate</programlisting></entry>
- <entry>Record terminator character (only valid for CSV
- files)</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Group</programlisting></entry>
- <entry>Group</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> MaxRecordSize</programlisting></entry>
- <entry>Maximum record size</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Modified</programlisting></entry>
- <entry>Date modified</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> NumParts</programlisting></entry>
- <entry>Number of file parts</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Owner</programlisting></entry>
- <entry>Owner name</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> QuerySets</programlisting></entry>
- <entry>Structure containing one or more Query Sets</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> QuerySet</programlisting></entry>
- <entry>Structure containing one Query Set</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Name</programlisting></entry>
- <entry>Query Name</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> QuerySetQueries</programlisting></entry>
- <entry>Structure containing one or more
- QuerySetQueries</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> QuerySetQuery</programlisting></entry>
- <entry>Structure containing one QuerySetQuery</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Name</programlisting></entry>
- <entry>Query Name</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Id</programlisting></entry>
- <entry>Query ID (for internal use and informational purposes
- only)</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Wuid</programlisting></entry>
- <entry>Workunit ID</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Suspended</programlisting></entry>
- <entry>Boolean indicator: Is the query suspended?</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Signature</programlisting></entry>
- <entry>Query Signature</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> InParams</programlisting></entry>
- <entry>Structure containing one or more Input
- parameters</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> InParam</programlisting></entry>
- <entry>Structure containing one Input parameter</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Name</programlisting></entry>
- <entry>Parameter name</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Type</programlisting></entry>
- <entry>Parameter data type (e.g., string)</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> ResultSets</programlisting></entry>
- <entry>Structure containing one or more Result Sets (Only
- the first result set is returned from a WsSQL service
- request)</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> ResultSet</programlisting></entry>
- <entry>Structure containing one Result Set</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Name</programlisting></entry>
- <entry>Result set name</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> OutParams</programlisting></entry>
- <entry>Structure containing one or more output
- parameters</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> OutParam</programlisting></entry>
- <entry>Structure containing one output parameter</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Name</programlisting></entry>
- <entry>Parameter name</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Type</programlisting></entry>
- <entry>Parameter data type (e.g., string)</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> QuerySetAliases</programlisting></entry>
- <entry>Structure containing one or more
- QuerySetAliases</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> QuerySetAlias</programlisting></entry>
- <entry>Structure containing one QuerySetAlias</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Name</programlisting></entry>
- <entry>Query name</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Id</programlisting></entry>
- <entry>Query Id</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> ClusterNames</programlisting></entry>
- <entry>Structure containing one or more
- TargetClusters</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> ClusterName</programlisting></entry>
- <entry>Structure containing one TargetCluster</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable></para>
- </sect2>
- </sect1>
- <sect1>
- <title>ExecuteSQL</title>
- <para>Use this method to submit standard (non-prepared) SQL queries. The
- <emphasis role="bold">SqlText</emphasis> input tag accepts free hand SQL
- text (see Supported SQL grammar below).</para>
- <para>If you are executing SQL using a SELECT or SELECT JOIN, you must
- specify the <emphasis role="bold">TargetCluster</emphasis>.</para>
- <para>If you are executing SQL that uses a CALL to a stored procedure,
- you must either fully qualify the procedure name (For example:
- Roxie.FindPeopleByZip) or specify the <emphasis
- role="bold">TargetQuerySet</emphasis> here. Parameters must be passed in
- order, not by name. You can retrieve the order using
- GetDBMetaData.</para>
- <para>To exclude the result schema in the result, set the <emphasis
- role="bold">SuppressXmlSchema</emphasis> option to 1 or true.</para>
- <para>For result set paging, you can limit the total query results and
- the initial page returned (<emphasis
- role="bold">ResultWindowStart</emphasis>, <emphasis
- role="bold">ResultWindowCount</emphasis>).</para>
- <sect2>
- <title>Sample Input XML</title>
- <para><programlisting><soap:Envelope>
- <ExecuteSQLRequest>
- <SqlText><emphasis role="bluebold">SELECT * from tutorial::yn::tutorialperson where lastname='JONES'</emphasis></SqlText>
- <UserName><emphasis role="bluebold">Emily</emphasis></UserName>
- <emphasis role="greenbold"><!-- Use either TargetCluster or TargetQuerySet, not both --></emphasis>
- <emphasis role="greenbold"><!-- If stored procedure was fully qualified, you can omit TargetQuerySet --></emphasis>
- <TargetCluster><emphasis role="bluebold">thor</emphasis></TargetCluster>
- <TargetQuerySet><emphasis role="bluebold"></emphasis></TargetQuerySet>
- <SuppressResults><emphasis role="bluebold">1</emphasis></SuppressResults>
- <SuppressXmlSchema><emphasis role="bluebold">0</emphasis></SuppressXmlSchema>
- <resultLimit><emphasis role="bluebold">100</emphasis></resultLimit>
- <emphasis role="greenbold"><!-- For page loading --></emphasis>
- <ResultWindowStart><emphasis role="bluebold">0</emphasis></ResultWindowStart>
- <ResultWindowCount><emphasis role="bluebold">50</emphasis></ResultWindowCount>
- </ExecuteSQLRequest>
- </soap:Envelope>
- </programlisting></para>
- </sect2>
- <sect2 role="brk">
- <title>Request Tag Descriptions</title>
- <para><informaltable colsep="1" frame="all" rowsep="1">
- <tgroup cols="3">
- <colspec colwidth="200pt" />
- <colspec colwidth="40 pt" />
- <colspec />
- <tbody>
- <row>
- <entry><?dbfo bgcolor="LightCyan"?>Tag Name</entry>
- <entry><?dbfo bgcolor="LightCyan"?>Req?</entry>
- <entry><?dbfo bgcolor="LightCyan"?>Description</entry>
- </row>
- <row>
- <entry><programlisting role="wsig">ExecuteSQLRequest</programlisting></entry>
- <entry>Y</entry>
- <entry>Structure containing the request</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> SqlText</programlisting></entry>
- <entry>Y</entry>
- <entry>Free-hand SQL text (see Supported SQL grammar
- below)</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> UserName</programlisting></entry>
- <entry>N</entry>
- <entry>User Name to pass to HPCC. This is used as the job
- owner name in HPCC</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> TargetCluster</programlisting></entry>
- <entry>Y *</entry>
- <entry>If you are executing prepared SQL using a SELECT or
- SELECT JOIN, you must specify the TargetCluster.</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> TargetQuerySet</programlisting></entry>
- <entry>Y *</entry>
- <entry>If you are executing prepared SQL that uses a CALL to
- a stored procedure, you must either fully qualify the
- procedure name in the prepared SQL (For example:
- Roxie.FindPeopleByZip) or specify the TargetCluster
- here.</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> SuppressResults</programlisting></entry>
- <entry>N</entry>
- <entry>If set to 1 or true, query results are not included
- in response</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> SuppressXmlSchema</programlisting></entry>
- <entry>N</entry>
- <entry>If set to 1 or true, the query result schema is not
- included in response</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Wait</programlisting></entry>
- <entry>N</entry>
- <entry>Timeout value in milliseconds. Use -1 for no
- timeout</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> resultLimit</programlisting></entry>
- <entry>N</entry>
- <entry>If set, the results can contain as many records as
- this limit</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> ResultWindowStart</programlisting></entry>
- <entry>N</entry>
- <entry>For use with page-loading, the starting record to
- return</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> ResultWindowCount</programlisting></entry>
- <entry>N</entry>
- <entry>For use with page-loading, the number of records to
- include from the ResultWindowStart</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable><parameter>* One or the other is
- required</parameter></para>
- </sect2>
- <sect2>
- <title>Response Tag Descriptions</title>
- <para><informaltable colsep="1" frame="all" rowsep="1">
- <tgroup cols="2">
- <colspec colwidth="200pt" />
- <colspec />
- <tbody>
- <row>
- <entry><?dbfo bgcolor="LightCyan"?>Tag Name</entry>
- <entry><?dbfo bgcolor="LightCyan"?>Description</entry>
- </row>
- <row>
- <entry><programlisting role="wsig">ExecuteSQLResponse</programlisting></entry>
- <entry>Structure containing response</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Exceptions</programlisting></entry>
- <entry>Structure containing exceptions. See <link
- linkend="ExceptionStructure">Exceptions Structure</link> in
- Common Structures</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> ParentWuId</programlisting></entry>
- <entry>The Workunit Id for the parent workunit (the one with
- the prepared SQL)</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Result</programlisting></entry>
- <entry>The query result</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Workunit</programlisting></entry>
- <entry>Structure containing Workunit details. See <link
- linkend="WUStructure">Workunit Structure</link> in Common
- Structures</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> resultLimit</programlisting></entry>
- <entry>The submitted resultLimit</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> ResultWindowStart</programlisting></entry>
- <entry>The submitted ReslutWindowStart</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> ResultWindowCount</programlisting></entry>
- <entry>The submitted ResultWindowCount</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable></para>
- </sect2>
- </sect1>
- <sect1>
- <title>GetResults</title>
- <para>This method allows you to get results from previously executed
- queries. Use the <emphasis role="bold">Wuid</emphasis> returned from
- <emphasis role="bold">ExecuteSQL</emphasis> or <emphasis
- role="bold">PrepareSQL</emphasis>. This method is ideal for results
- paging.</para>
- <sect2>
- <title>Sample Input XML</title>
- <para><programlisting><soap:Envelope>
- <soap:Body>
- <GetResultsRequest>
- <WuId><emphasis role="bluebold">W20140529-161930</emphasis></WuId>
- <SuppressXmlSchema><emphasis role="bluebold">1</emphasis></SuppressXmlSchema>
- <ResultWindowStart><emphasis role="bluebold">0</emphasis></ResultWindowStart>
- <ResultWindowCount><emphasis role="bluebold">0</emphasis></ResultWindowCount>
- </GetResultsRequest>
- </soap:Body>
- </soap:Envelope></programlisting></para>
- </sect2>
- <sect2>
- <title>Request Tag Descriptions</title>
- <para><informaltable colsep="1" frame="all" rowsep="1">
- <tgroup cols="3">
- <colspec colwidth="200pt" />
- <colspec colwidth="40 pt" />
- <colspec />
- <tbody>
- <row>
- <entry><?dbfo bgcolor="LightCyan"?>Tag Name</entry>
- <entry><?dbfo bgcolor="LightCyan"?>Req?</entry>
- <entry><?dbfo bgcolor="LightCyan"?>Description</entry>
- </row>
- <row>
- <entry><programlisting role="wsig">GetResultsRequest</programlisting></entry>
- <entry>Y</entry>
- <entry>Structure containing the request</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> WuId</programlisting></entry>
- <entry>Y</entry>
- <entry>Workunit Id (WUID)</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> SuppressXmlSchema</programlisting></entry>
- <entry>N</entry>
- <entry>If set to 1 or true, the query result schema is not
- included in response</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> ResultWindowStart</programlisting></entry>
- <entry>N</entry>
- <entry>For use with page-loading, the starting record to
- return</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> ResultWindowCount</programlisting></entry>
- <entry>N</entry>
- <entry>For use with page-loading, the number of records to
- include from the ResultWindowStart</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable></para>
- </sect2>
- <sect2>
- <title>Response Tag Descriptions</title>
- <para><informaltable colsep="1" frame="all" rowsep="1">
- <tgroup cols="2">
- <colspec colwidth="200pt" />
- <colspec />
- <tbody>
- <row>
- <entry><?dbfo bgcolor="LightCyan"?>Tag Name</entry>
- <entry><?dbfo bgcolor="LightCyan"?>Description</entry>
- </row>
- <row>
- <entry><programlisting role="wsig">GetResultsResponse</programlisting></entry>
- <entry>Structure containing response</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Exceptions</programlisting></entry>
- <entry>Structure containing exceptions. See <link
- linkend="ExceptionStructure">Exceptions Structure</link> in
- Common Structures</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Result</programlisting></entry>
- <entry>The query result</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> ResultWindowStart</programlisting></entry>
- <entry>The submitted starting record</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> ResultWindowCount</programlisting></entry>
- <entry>The submitted record count</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Workunit</programlisting></entry>
- <entry>Structure containing Workunit details. See <link
- linkend="WUStructure">Workunit Structure</link> in Common
- Structures</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable></para>
- </sect2>
- </sect1>
- <sect1>
- <title>PrepareSQL</title>
- <para>Use this method to submit a free-hand SQL request for later use as
- a parameterized query. This compiles the query and returns the <emphasis
- role="bold">Wuid</emphasis>. This <emphasis role="bold">Wuid</emphasis>
- is later used to execute the query with provided input parameters using
- the <emphasis role="bold">ExecutePreparedSQL</emphasis> method.</para>
- <para>This is ideal for queries which are executed many times with
- different values.</para>
- <para>The prepared SQL can contain any supported SQL grammar.</para>
- <para>If you are executing SQL using a SELECT or SELECT JOIN, you must
- specify the <emphasis role="bold">TargetCluster</emphasis>.</para>
- <para>If you using a CALL to a stored procedure, you must either fully
- qualify the procedure name in the SQL (For example:
- Roxie.FindPeopleByZip) or specify the <emphasis
- role="bold">TargetQuerySet</emphasis> here. Parameters must be passed in
- order, not by name. You can retrieve the order using
- GetDBMetaData.</para>
- <para>Create parameters using a ? as a placeholder.</para>
- <para><emphasis role="bold">Example:</emphasis></para>
- <para><programlisting>select * from tutorial::yn::tutorialperson where lastname=?</programlisting>Later
- you would submit a request to <emphasis
- role="bold">ExecutePreparedSQL</emphasis> providing a value to use for
- <emphasis>lastname</emphasis> as shown in the following example:</para>
- <para><programlisting><soap:Envelope >
- <soap:Body>
- <ExecutePreparedSQLRequest>
- <WuId><emphasis role="bluebold">W20140724-135811</emphasis></WuId>
- <TargetCluster><emphasis role="bluebold">thor</emphasis></TargetCluster>
- <SuppressResults><emphasis role="bluebold">0</emphasis></SuppressResults>
- <SuppressXmlSchema><emphasis role="bluebold">1</emphasis></SuppressXmlSchema>
- <resultLimit><emphasis role="bluebold">100</emphasis></resultLimit>
- <Variables>
- <NamedValue>
- <Name><emphasis role="bluebold">lastname</emphasis></Name>
- <Value><emphasis role="bluebold">JONES</emphasis></Value>
- </NamedValue>
- </Variables>
- </ExecutePreparedSQLRequest>
- </soap:Body>
- </soap:Envelope></programlisting></para>
- <sect2>
- <title>Sample Input XML</title>
- <para><programlisting><soap:Envelope >
- <soap:Body>
- <PrepareSQLRequest>
- <SqlText><emphasis role="bluebold">select * from tutorial::yn::tutorialperson where lastname=?</emphasis></SqlText>
- <emphasis role="greenbold"><!-- Use either TargetCluster or TargetQuerySet, not both --></emphasis>
- <emphasis role="greenbold"><!-- If stored procedure is fully qualified, you can omit TargetQuerySet --></emphasis>
- <TargetCluster><emphasis role="bluebold">thor</emphasis></TargetCluster>
- </PrepareSQLRequest>
- </soap:Body>
- </soap:Envelope></programlisting></para>
- </sect2>
- <sect2 role="brk">
- <title>Request Tag Descriptions</title>
- <para><informaltable colsep="1" frame="all" rowsep="1">
- <tgroup cols="3">
- <colspec colwidth="200pt" />
- <colspec colwidth="40 pt" />
- <colspec />
- <tbody>
- <row>
- <entry><?dbfo bgcolor="LightCyan"?>Tag Name</entry>
- <entry><?dbfo bgcolor="LightCyan"?>Req?</entry>
- <entry><?dbfo bgcolor="LightCyan"?>Description</entry>
- </row>
- <row>
- <entry><programlisting role="wsig">PrepareSQLRequest</programlisting></entry>
- <entry>N</entry>
- <entry>Structure containing request</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> SqlText</programlisting></entry>
- <entry>Y</entry>
- <entry>Free-hand SQL text (see Supported SQL grammar
- below)</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> TargetCluster</programlisting></entry>
- <entry>Y *</entry>
- <entry>If you are executing prepared SQL using a SELECT or
- SELECT JOIN, you must specify the TargetCluster</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> TargetQuerySet</programlisting></entry>
- <entry>Y *</entry>
- <entry>If you are executing prepared SQL that uses a CALL to
- a stored procedure, you must either fully qualify the
- procedure name in the prepared SQL (For example:
- Roxie.FindPeopleByZip) or specify the TargetCluster
- here</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Wait</programlisting></entry>
- <entry>N</entry>
- <entry>Timeout value in milliseconds. Use -1 for no
- timeout</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable><parameter>* One or the other is
- required</parameter></para>
- </sect2>
- <sect2>
- <title>Response Tag Descriptions</title>
- <para><informaltable colsep="1" frame="all" rowsep="1">
- <tgroup cols="2">
- <colspec colwidth="200pt" />
- <colspec />
- <tbody>
- <row>
- <entry><?dbfo bgcolor="LightCyan"?>Tag Name</entry>
- <entry><?dbfo bgcolor="LightCyan"?>Description</entry>
- </row>
- <row>
- <entry><programlisting role="wsig">PrepareSQLResponse</programlisting></entry>
- <entry>Structure containing response</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Exceptions</programlisting></entry>
- <entry>Structure containing exceptions. See <link
- linkend="ExceptionStructure">Exceptions Structure</link> in
- Common Structures</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Workunit</programlisting></entry>
- <entry>Structure containing Workunit details. See <link
- linkend="WUStructure">Workunit Structure</link> in Common
- Structures</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Result</programlisting></entry>
- <entry>Structure containing result (if any)</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable></para>
- </sect2>
- </sect1>
- <sect1>
- <title>ExecutePreparedSQL</title>
- <para>This method executes a previously created parameterized SQL
- query.</para>
- <para>The target compiled query is referenced using a Workunit ID
- (<emphasis role="bold">Wuid</emphasis>), which is returned from the
- <emphasis role="bold">PrepareSQL</emphasis> method. The caller can
- specify sequence of input parameters as key-value pairs, which are bound
- to the precompiled query.</para>
- <para>The prepared SQL can contain any supported SQL grammar.</para>
- <para>If you are executing prepared SQL using a SELECT or SELECT JOIN,
- you can supply a <emphasis role="bold">TargetCluster</emphasis> to
- override the one specified when you submitted the PrepareSQL request;
- however, it must be a cluster of the same type.</para>
- <para>If you want to limit the number of results, you must use a LIMIT
- clause in you SQL query.</para>
- <para>For result set paging, you can limit the total query results and
- the initial page returned (<emphasis
- role="bold">ResultWindowStart</emphasis>, <emphasis
- role="bold">ResultWindowCount</emphasis>).</para>
- <sect2>
- <title>Sample Input XML</title>
- <para><programlisting><soap:Envelope>
- <soap:Body>
- <ExecutePreparedSQLRequest>
- <WuId><emphasis role="bluebold">W20140529-161930</emphasis></WuId>
- <UserName><emphasis role="bluebold">EmilyKate</emphasis></UserName>
- <emphasis role="greenbold"><!-- You can override the TargetCluster used in original PrepareSQL query, <emphasis
- role="greenbold">--></emphasis>
- <!-- but it must be of the same type --></emphasis>
- <TargetCluster><emphasis role="bluebold">Thor</emphasis></TargetCluster>
- <SuppressResults><emphasis role="bluebold">0</emphasis></SuppressResults>
- <SuppressXmlSchema><emphasis role="bluebold">1</emphasis></SuppressXmlSchema>
- <Wait><emphasis role="bluebold">-1</emphasis></Wait>
- <emphasis role="greenbold"><!-- For page loading --></emphasis>
- <ResultWindowStart><emphasis role="bluebold">0</emphasis></ResultWindowStart>
- <ResultWindowCount><emphasis role="bluebold">50</emphasis></ResultWindowCount>
- <emphasis role="greenbold"><!-- Paramaters using name/value pairs --></emphasis>
- <Variables>
- <NamedValue>
- <Name><emphasis role="bluebold">firstname</emphasis></Name>
- <Value><emphasis role="bluebold">Jim</emphasis></Value>
- </NamedValue>
- <NamedValue>
- <Name><emphasis role="bluebold">lastname</emphasis></Name>
- <Value>JONES</Value>
- </NamedValue>
- </Variables>
- </ExecutePreparedSQLRequest>
- </soap:Body>
- </soap:Envelope>
- </programlisting></para>
- </sect2>
- <sect2 role="brk">
- <title>Request Tag Descriptions</title>
- <para><informaltable colsep="1" frame="all" rowsep="1">
- <tgroup cols="3">
- <colspec colwidth="200 pt" />
- <colspec colwidth="40 pt" />
- <colspec />
- <tbody>
- <row>
- <entry><?dbfo bgcolor="LightCyan"?>Tag Name</entry>
- <entry><?dbfo bgcolor="LightCyan"?>Req?</entry>
- <entry><?dbfo bgcolor="LightCyan"?>Description</entry>
- </row>
- <row>
- <entry><programlisting role="wsig">ExecutePreparedSQLRequest</programlisting></entry>
- <entry>N</entry>
- <entry>Structure containing the request</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> WuId</programlisting></entry>
- <entry>Y</entry>
- <entry>The Workunit ID (WUID)</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> UserName</programlisting></entry>
- <entry>N</entry>
- <entry>The username to use as the job's ownername in the
- HPCC platform</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> TargetCluster</programlisting></entry>
- <entry>Y</entry>
- <entry>If you are executing prepared SQL using a SELECT or
- SELECT JOIN, you can specify the TargetCluster, but it must
- be the same type as the one on which it was prepared</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> SuppressResults</programlisting></entry>
- <entry>N</entry>
- <entry>If set to 1 or true, query results are not included
- in response</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> SuppressXmlSchema</programlisting></entry>
- <entry>N</entry>
- <entry>If set to 1 or true, the query result schema is not
- included in response</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Wait</programlisting></entry>
- <entry>N</entry>
- <entry>Timeout value in milliseconds. Use -1 for no
- timeout.</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> ResultWindowStart</programlisting></entry>
- <entry>N</entry>
- <entry>For use with page-loading, the starting record to
- return</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> ResultWindowCount</programlisting></entry>
- <entry>N</entry>
- <entry>For use with page-loading, the number of records to
- include from the ResultWindowStart</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Variables</programlisting></entry>
- <entry>N</entry>
- <entry>If your prepared SQL has parameters, supply them as
- name/value pairs inside this structure</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> NamedValue</programlisting></entry>
- <entry>N</entry>
- <entry>A structure containing one Name/Value pair</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Name</programlisting></entry>
- <entry>N</entry>
- <entry>Name</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Value</programlisting></entry>
- <entry>N</entry>
- <entry>Value</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable></para>
- </sect2>
- <sect2>
- <title>Response Tag Descriptions</title>
- <para><informaltable colsep="1" frame="all" rowsep="1">
- <tgroup cols="2">
- <colspec colwidth="200pt" />
- <colspec />
- <tbody>
- <row>
- <entry><?dbfo bgcolor="LightCyan"?>Tag Name</entry>
- <entry><?dbfo bgcolor="LightCyan"?>Description</entry>
- </row>
- <row>
- <entry><programlisting role="wsig">ExecutePreparedSQLResponse</programlisting></entry>
- <entry>Structure containing response</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Exceptions</programlisting></entry>
- <entry>Structure containing exceptions. See <link
- linkend="ExceptionStructure">Exceptions Structure</link> in
- Common Structures</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> ParentWuId</programlisting></entry>
- <entry>The Workunit ID for the parent workunit (the one with
- the prepared SQL)</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Result</programlisting></entry>
- <entry>The query result</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> ResultWindowStart</programlisting></entry>
- <entry>The submitted starting record</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> ResultWindowCount</programlisting></entry>
- <entry>The submitted record count</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Workunit</programlisting></entry>
- <entry>Structure containing Workunit details. See <link
- linkend="WUStructure">Workunit Structure</link> in Common
- Structures</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable></para>
- </sect2>
- </sect1>
- <sect1 id="CreateTableAndLoad">
- <title>CreateTableAndLoad</title>
- <para>This method creates a table (HPCC logical file) which can
- subsequently be accessed using WsSQL. The table is assigned the layout
- as specified in the request ECLFields section. The table is then
- populated with data from an existing file. The source data file can
- either reside on the HPCC Landing Zone after being uploaded, or it can
- already have been sprayed on to the system.</para>
- <sect2>
- <title>Sample Input XML</title>
- <para><programlisting><CreateTableAndLoadRequest>
- <TableName><emphasis role="bluebold">JIM::MyNewTable</emphasis></TableName>
- <TableDescription><emphasis role="bluebold">My Description of the new table</emphasis></TableDescription>
- <Overwrite>1</Overwrite>
- <EclFields>
- <EclField>
- <FieldName><emphasis role="bluebold">PersonName</emphasis></FieldName>
- <EclFieldType>
- <emphasis role="greenbold"><!-- Valid types are: BOOLEAN, INTEGER,</emphasis> <emphasis
- role="greenbold">UNSIGNED, REAL, DECIMAL, STRING, -->
- <!-- QSTRING, UNICODE, DATA, VARSTRING, or VARUNICODE -->
- </emphasis> <Type><emphasis role="bluebold">STRING</emphasis></Type>
- <Locale></Locale>
- <Length><emphasis role="bluebold">20</emphasis></Length>
- <Precision></Precision>
- </EclFieldType>
- </EclField>
- <EclField>
- <FieldName><emphasis role="bluebold">PersonID</emphasis></FieldName>
- <EclFieldType>
- <Type><emphasis role="bluebold">INTEGER</emphasis></Type>
- <Locale></Locale>
- <Length><emphasis role="bluebold">2</emphasis></Length>
- <Precision></Precision>
- </EclFieldType>
- </EclField>
- </EclFields>
- <TargetCluster><emphasis role="bluebold">thor</emphasis></TargetCluster>
- <Owner><emphasis role="bluebold">Jimmy</emphasis></Owner>
- <DataSource>
- <emphasis role="greenbold"><!-- Use either SprayedFileName --></emphasis>
- <SprayedFileName><emphasis role="bluebold">Tutorial::JD::OriginalPerson</emphasis></SprayedFileName>
- <emphasis role="greenbold"><!-- or full Landing Zone details, not both --></emphasis>
- <LandingZoneIP><emphasis role="bluebold">127.0.0.1</emphasis></LandingZoneIP>
- <LandingZonePath><emphasis role="bluebold">/var/lib/HPCCSystems/mydropzone</emphasis></LandingZonePath>
- <LandingZoneFileName><emphasis role="bluebold">OriginalPerson</emphasis></LandingZoneFileName>
- </DataSource>
- <DataSourceType>
- <emphasis role="greenbold"><!-- Valid types are: FLAT, CSV, JSON, or XML<emphasis
- role="greenbold"> --> </emphasis></emphasis>
- <Type><emphasis role="bluebold">FLAT</emphasis></Type>
- <Params>
- <Param>
- <Name></Name>
- <Values>
- <Value></Value>
- <Value></Value>
- </Values>
- </Param>
- </Params>
- </DataSourceType>
- <Wait>-1</Wait>
- </CreateTableAndLoadRequest>
- </programlisting></para>
- </sect2>
- <sect2>
- <title>Request Tag Descriptions</title>
- <para><informaltable colsep="1" frame="all" rowsep="1">
- <tgroup cols="3">
- <colspec colwidth="200pt" />
- <colspec colwidth="40 pt" />
- <colspec />
- <tbody>
- <row>
- <entry><?dbfo bgcolor="LightCyan"?>Tag Name</entry>
- <entry><?dbfo bgcolor="LightCyan"?>Req?</entry>
- <entry><?dbfo bgcolor="LightCyan"?>Description</entry>
- </row>
- <row>
- <entry><programlisting role="wsig">TableName</programlisting></entry>
- <entry>Y</entry>
- <entry>The name of the table to create in the HPCC
- Platform's distributed file system.</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> TableDescription</programlisting></entry>
- <entry>N</entry>
- <entry>Your description of the file.</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Overwrite</programlisting></entry>
- <entry>N</entry>
- <entry>Boolean indicator to specify whether to allow the new
- file to overwrite an existing file of the same name.</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> EclFields</programlisting></entry>
- <entry>Y</entry>
- <entry>Structure containing details for the file's record
- layout. This must match layout of the source data
- file</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> EclField</programlisting></entry>
- <entry>Y</entry>
- <entry>Structure containing details for one field</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> FieldName </programlisting></entry>
- <entry>Y</entry>
- <entry>Field Name</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> EclFieldType</programlisting></entry>
- <entry>Y</entry>
- <entry>Structure containing Data Type details</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Type</programlisting></entry>
- <entry>Y</entry>
- <entry>Field type. Valid types are: BOOLEAN, INTEGER,
- UNSIGNED, REAL, DECIMAL, STRING, QSTRING, UNICODE, DATA,
- VARSTRING, or VARUNICODE</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Locale </programlisting></entry>
- <entry>N</entry>
- <entry>Locale</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Length</programlisting></entry>
- <entry>Y*</entry>
- <entry>Field length</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Precision</programlisting></entry>
- <entry>N</entry>
- <entry>Field precision (decimal places)</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> TargetCluster</programlisting></entry>
- <entry>Y</entry>
- <entry>The Target cluster where the job will run.</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Owner</programlisting></entry>
- <entry>N</entry>
- <entry>Owner name for the file</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> DataSource</programlisting></entry>
- <entry>Y</entry>
- <entry>Structure containing Data Source details. Either
- SprayedFileName or LandingZone File details must be
- provided, not both.</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> SprayedFileName</programlisting></entry>
- <entry>Y**</entry>
- <entry>Logical filename of sprayed data file</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> LandingZoneIP</programlisting></entry>
- <entry>Y**</entry>
- <entry>IP address or hostname of the HPCC Landing
- Zone</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> LandingZonePath</programlisting></entry>
- <entry>Y**</entry>
- <entry>Path to the datafile on the Landing Zone</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> LandingZoneFileName</programlisting></entry>
- <entry>Y**</entry>
- <entry>Physical filename</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> DataSourceType</programlisting></entry>
- <entry>N</entry>
- <entry>Structure containing DataSource Type details.</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Type</programlisting></entry>
- <entry>Y</entry>
- <entry>Valid types are: FLAT, CSV, JSON, or XML</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Params</programlisting></entry>
- <entry>N</entry>
- <entry>Structure containing one or more type parameters that
- describe the DataSource. For example, CSV Terminator =
- \n</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Param</programlisting></entry>
- <entry>N</entry>
- <entry>Structure containing one type parameter.</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Name</programlisting></entry>
- <entry>N</entry>
- <entry>Name</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Values</programlisting></entry>
- <entry>N</entry>
- <entry>Structure containing one or more values.</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Value</programlisting></entry>
- <entry>N</entry>
- <entry>Value</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Wait</programlisting></entry>
- <entry>N</entry>
- <entry>Timeout value in milliseconds. Use -1 for no
- timeout</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable></para>
- <para>* <emphasis role="bold">Field length is only required for fixed
- width fields (FLAT files)</emphasis></para>
- <para>** <emphasis role="bold">Either SprayedFileName or LandingZone
- File details must be provided, not both</emphasis></para>
- </sect2>
- <sect2>
- <title>Response Tag Descriptions</title>
- <para>The response structure contains many tags which provide useful
- information for development and debugging of ECL code. Most of them
- are outside of the scope of this document. Only those that are useful
- when using the WsSQL service are listed below.</para>
- <para><informaltable colsep="1" frame="all" rowsep="1">
- <tgroup cols="2">
- <colspec colwidth="200 pt" />
- <colspec />
- <tbody>
- <row>
- <entry><?dbfo bgcolor="LightCyan"?>Tag Name</entry>
- <entry><?dbfo bgcolor="LightCyan"?>Description</entry>
- </row>
- <row>
- <entry><programlisting role="wsig">CreateTableAndLoadResponse</programlisting></entry>
- <entry>Structure containing response</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> TableName</programlisting></entry>
- <entry>Name of the created table</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Success</programlisting></entry>
- <entry>Boolean indicator of success [1 = success]</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> EclRecordDefinition</programlisting></entry>
- <entry>Supplied record definition in ECL format</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Workunit</programlisting></entry>
- <entry>Structure containing Workunit details. See <link
- linkend="WUStructure">Workunit Structure</link> in Common
- Structures</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable></para>
- </sect2>
- </sect1>
- <sect1 id="SetRelatedIndexes">
- <title>SetRelatedIndexes</title>
- <para>This function adds a description to a logical file to be used as
- an annotation indicating an index file which is related to a data file.
- This makes it available to WsSQL for use in an indexed fetch.</para>
- <para></para>
- <sect2>
- <title>Sample Input XML</title>
- <para><programlisting><SetRelatedIndexesRequest>
- <RelatedIndexSets>
- <RelatedIndexSet>
- <FileName><emphasis role="bluebold">Tutorial::JD::TutorialPerson</emphasis></FileName>
- <Indexes>
- <Index><emphasis role="bluebold">Tutorial::JD::TutorialPersonByName</emphasis></Index>
- <Index><emphasis role="bluebold">Tutorial::JD::TutorialPersonByZIP</emphasis></Index>
- </Indexes>
- </RelatedIndexSet>
- <RelatedIndexSet>
- </SetRelatedIndexesRequest>
- </programlisting></para>
- </sect2>
- <sect2>
- <title>Request Tag Descriptions</title>
- <para><informaltable colsep="1" frame="all" rowsep="1">
- <tgroup cols="3">
- <colspec colwidth="200pt" />
- <colspec colwidth="40 pt" />
- <colspec />
- <tbody>
- <row>
- <entry><?dbfo bgcolor="LightCyan"?>Tag Name</entry>
- <entry><?dbfo bgcolor="LightCyan"?>Req?</entry>
- <entry><?dbfo bgcolor="LightCyan"?>Description</entry>
- </row>
- <row>
- <entry><programlisting role="wsig">SetRelatedIndexesRequest</programlisting></entry>
- <entry></entry>
- <entry>Structure containing request</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> RelatedIndexSets</programlisting></entry>
- <entry>Y</entry>
- <entry>Structure containing one or more related index
- sets</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> RelatedIndexSet</programlisting></entry>
- <entry>Y</entry>
- <entry>Structure containing one related index set</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> FileName</programlisting></entry>
- <entry>Y</entry>
- <entry>Logical filename to which the annotation is
- added</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Indexes</programlisting></entry>
- <entry>Y</entry>
- <entry>Structure containing one or more indexes to add to
- annotation</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Index</programlisting></entry>
- <entry>Y</entry>
- <entry>Index to add to annotation</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable></para>
- </sect2>
- <sect2>
- <title>Response Tag Descriptions</title>
- <para><informaltable colsep="1" frame="all" rowsep="1">
- <tgroup cols="2">
- <colspec colwidth="200 pt" />
- <colspec />
- <tbody>
- <row>
- <entry><?dbfo bgcolor="LightCyan"?>Tag Name</entry>
- <entry><?dbfo bgcolor="LightCyan"?>Description</entry>
- </row>
- <row>
- <entry><programlisting role="wsig">SetRelatedIndexesResponse</programlisting></entry>
- <entry>Structure containing response</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> RelatedIndexSets</programlisting></entry>
- <entry>Structure containing one or more related index
- sets</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> RelatedIndexSet</programlisting></entry>
- <entry>Structure containing one related index set</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> FileName</programlisting></entry>
- <entry>Logical filename to which the annotation was
- added</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Indexes</programlisting></entry>
- <entry>Structure containing one or more indexes added to
- annotation</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Index</programlisting></entry>
- <entry>Index added to annotation</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable></para>
- </sect2>
- </sect1>
- <sect1 id="GetRelatedIndexes">
- <title>GetRelatedIndexes</title>
- <para>This function retrieves information from logical file descriptions
- about annotations indicating an index file which is related to a data
- file.</para>
- <para></para>
- <sect2>
- <title>Sample Input XML</title>
- <para><programlisting><GetRelatedIndexesRequest>
- <FileNames>
- <FileName><emphasis role="bluebold">Tutorial::JD::TutorialPerson</emphasis></FileName>
- </FileNames>
- </SetRelatedIndexesRequest>
- </programlisting></para>
- </sect2>
- <sect2>
- <title>Request Tag Descriptions</title>
- <para><informaltable colsep="1" frame="all" rowsep="1">
- <tgroup cols="3">
- <colspec colwidth="200pt" />
- <colspec colwidth="40 pt" />
- <colspec />
- <tbody>
- <row>
- <entry><?dbfo bgcolor="LightCyan"?>Tag Name</entry>
- <entry><?dbfo bgcolor="LightCyan"?>Req?</entry>
- <entry><?dbfo bgcolor="LightCyan"?>Description</entry>
- </row>
- <row>
- <entry><programlisting role="wsig">SetRelatedIndexesRequest</programlisting></entry>
- <entry></entry>
- <entry>Structure containing request</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> FileNames</programlisting></entry>
- <entry>Y</entry>
- <entry>Structure containing one or more related index
- sets</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> FileName</programlisting></entry>
- <entry>Y</entry>
- <entry>Logical filename to which the annotation is
- added</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable></para>
- </sect2>
- <sect2>
- <title>Response Tag Descriptions</title>
- <para><informaltable colsep="1" frame="all" rowsep="1">
- <tgroup cols="2">
- <colspec colwidth="200 pt" />
- <colspec />
- <tbody>
- <row>
- <entry><?dbfo bgcolor="LightCyan"?>Tag Name</entry>
- <entry><?dbfo bgcolor="LightCyan"?>Description</entry>
- </row>
- <row>
- <entry><programlisting role="wsig">GetRelatedIndexesResponse</programlisting></entry>
- <entry>Structure containing response</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> RelatedIndexSets</programlisting></entry>
- <entry>Structure containing one or more related index
- sets</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> RelatedIndexSet</programlisting></entry>
- <entry>Structure containing one related index set</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> FileName</programlisting></entry>
- <entry>Logical filename to which the annotation was
- added</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Indexes</programlisting></entry>
- <entry>Structure containing one or more indexes added to
- annotation</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Index</programlisting></entry>
- <entry>Index added to annotation</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable></para>
- </sect2>
- </sect1>
- <sect1>
- <title>Common Structures</title>
- <para>These structures are returned in several methods.</para>
- <sect2 id="ExceptionStructure">
- <title>Exceptions Structure</title>
- <para><informaltable colsep="1" frame="all" rowsep="1">
- <tgroup cols="2">
- <colspec colwidth="200pt" />
- <colspec />
- <tbody>
- <row>
- <entry><?dbfo bgcolor="LightCyan"?>Tag Name</entry>
- <entry><?dbfo bgcolor="LightCyan"?>Description</entry>
- </row>
- <row>
- <entry><programlisting role="wsig">Exceptions</programlisting></entry>
- <entry>Structure containing one or more exceptions</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Exception</programlisting></entry>
- <entry>Structure containing one exception</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Code</programlisting></entry>
- <entry>Code</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Audience</programlisting></entry>
- <entry>Audience</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Source</programlisting></entry>
- <entry>Source component</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Message</programlisting></entry>
- <entry>Error message</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable></para>
- </sect2>
- <sect2 id="WUStructure">
- <title>Workunit Structure</title>
- <para>The workunit structure contains many tags which provide useful
- information for development and debugging of ECL code. Most of them
- are outside of the scope of this document. Only those that are useful
- when using the WsSQL service are listed here.</para>
- <para><informaltable colsep="1" frame="all" rowsep="1">
- <tgroup cols="2">
- <colspec colwidth="200pt" />
- <colspec />
- <tbody>
- <row>
- <entry><?dbfo bgcolor="LightCyan"?>Tag Name</entry>
- <entry><?dbfo bgcolor="LightCyan"?>Description</entry>
- </row>
- <row>
- <entry><programlisting role="wsig">Workunit</programlisting></entry>
- <entry>Structure containing Workunit details</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Wuid</programlisting></entry>
- <entry>Workunit Id (WUID)</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Owner</programlisting></entry>
- <entry>Job Owner (if any)</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Cluster</programlisting></entry>
- <entry>Target Cluster</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Jobname</programlisting></entry>
- <entry>Job Name (If any)</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> StateID</programlisting></entry>
- <entry>State ID</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> State</programlisting></entry>
- <entry>State (compiled, failed, etc)</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Protected</programlisting></entry>
- <entry>Boolean indicator: Is Workunit protected?</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Snapshot</programlisting></entry>
- <entry>Snapshot</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> IsPausing</programlisting></entry>
- <entry>Boolean indicator of pause state</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> ThorLCR</programlisting></entry>
- <entry>Boolean indicator</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> EventSchedule</programlisting></entry>
- <entry>Boolean indicator</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> TotalCLusterTime</programlisting></entry>
- <entry>Time taken to process on cluster</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Query</programlisting></entry>
- <entry>Query</entry>
- </row>
- <row>
- <entry><programlisting role="wsig"> Result</programlisting></entry>
- <entry>Structure containing result (if any)</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable></para>
- </sect2>
- </sect1>
- </chapter>
- <chapter>
- <title>Supported SQL Grammar</title>
- <sect1 role="nobrk">
- <title>CALL</title>
- <para><emphasis role="bold">Call
- </emphasis><emphasis>queryName</emphasis><emphasis role="bold">
- ([</emphasis><emphasis>paramList</emphasis><emphasis
- role="bold">])</emphasis></para>
- <para><informaltable colsep="1" frame="all" rowsep="1">
- <tgroup cols="2">
- <colspec colwidth="113.65pt" />
- <colspec />
- <tbody>
- <row>
- <entry>queryName</entry>
- <entry>The published query name or alias</entry>
- </row>
- <row>
- <entry>paramList</entry>
- <entry>The parameters exposed by the published query
- (comma-separated)</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable></para>
- <para>Call executes a published ECL query as if it were a stored
- procedure.</para>
- <para>Example:</para>
- <programlisting>Call SearchPeopleByZipService ('33024')</programlisting>
- </sect1>
- <sect1>
- <title>SELECT</title>
- <para><emphasis role="bold">select [</emphasis>distinct<emphasis
- role="bold">]</emphasis> <emphasis>colummList</emphasis> <emphasis
- role="bold">from</emphasis> <emphasis>tableList </emphasis><emphasis>
- </emphasis><emphasis role="bold">[</emphasis>USE
- INDEX<emphasis>(indexFileName</emphasis> | NONE
- <emphasis>)</emphasis><emphasis role="bold">]</emphasis></para>
- <para><emphasis role="bold">[where</emphasis>
- <emphasis>logicalExpression</emphasis><emphasis role="bold">]</emphasis>
- <emphasis role="bold">[group by</emphasis>
- <emphasis>columnList<superscript>1</superscript></emphasis><emphasis
- role="bold">]</emphasis> <emphasis role="bold">[having</emphasis>
- <emphasis>logicalExpression<superscript>2</superscript></emphasis><emphasis
- role="bold">]</emphasis></para>
- <para><emphasis role="bold">[order by</emphasis>
- <emphasis>columnList<superscript>1</superscript> </emphasis>[asc |
- desc]<emphasis> </emphasis>] <emphasis
- role="bold">[LIMIT</emphasis><emphasis> limitNumber</emphasis><emphasis
- role="bold">]</emphasis></para>
- <variablelist>
- <varlistentry>
- <term>NOTE:</term>
- <listitem>
- <para>Identifiers can be unquoted or within double quotes, literal
- string values must be single quoted.</para>
- </listitem>
- </varlistentry>
- </variablelist>
- <para><informaltable colsep="1" frame="all" rowsep="1">
- <tgroup cols="2">
- <colspec colwidth="123.45pt" />
- <colspec />
- <tbody>
- <row>
- <entry><emphasis>columnList</emphasis></entry>
- <entry>columnreference1[,columnreference2,columnreference3,...,columnreference<emphasis>n</emphasis>]</entry>
- </row>
- <row>
- <entry></entry>
- <entry>The column(s) to return (comma-separated list). In
- addition, these aggregate functions are supported : COUNT,
- SUM, MIN, MAX, and AVG. These work in a similar manner as
- their ECL counterparts</entry>
- </row>
- <row>
- <entry>columnreference</entry>
- <entry>[tablename.]columnname[ [AS] alias ]</entry>
- </row>
- <row>
- <entry><emphasis>distinct</emphasis></entry>
- <entry>[distinct] col1, col2,...
- col<emphasis>n</emphasis></entry>
- </row>
- <row>
- <entry><emphasis></emphasis></entry>
- <entry>The result set will only contain distinct (unique)
- values</entry>
- </row>
- <row>
- <entry><emphasis>tableList</emphasis></entry>
- <entry>tableref1[,tableref2,tableref3,...,tableref<emphasis>n</emphasis>]</entry>
- </row>
- <row>
- <entry></entry>
- <entry>One or more tables, separated by commas.</entry>
- </row>
- <row>
- <entry></entry>
- <entry><emphasis role="bold">NOTE: </emphasis>A table list
- with multiple tables creates an (one or more) implicit inner
- join using the where clause logical expression as the join
- condition which must contain an equality condition</entry>
- </row>
- <row>
- <entry>tableref</entry>
- <entry>tableName[ [AS] alias ]</entry>
- </row>
- <row>
- <entry></entry>
- <entry>The Name of the table as referenced, optionally
- defining its alias</entry>
- </row>
- <row>
- <entry><emphasis>alias</emphasis></entry>
- <entry>The alias used to refer to the corresponding table or
- field reference.</entry>
- </row>
- <row>
- <entry><emphasis>logicalExpression</emphasis></entry>
- <entry>Logical expression based on standard SQL filtering
- syntax.</entry>
- </row>
- <row>
- <entry></entry>
- <entry>BOOLEAN Only supports <emphasis>True</emphasis> or
- <emphasis>False</emphasis>, do not use Y, N, 0, or 1</entry>
- </row>
- <row>
- <entry></entry>
- <entry><emphasis role="bold">Valid
- operators:</emphasis></entry>
- </row>
- <row>
- <entry></entry>
- <entry>= Equal (e.g., age=33)</entry>
- </row>
- <row>
- <entry></entry>
- <entry><> Not equal (e.g., age <>33)</entry>
- </row>
- <row>
- <entry></entry>
- <entry>> Greater than (e.g., age >55)</entry>
- </row>
- <row>
- <entry></entry>
- <entry>< Less than (e.g., age < 18)</entry>
- </row>
- <row>
- <entry></entry>
- <entry>>= Greater than or equal (e.g., age >=21)</entry>
- </row>
- <row>
- <entry></entry>
- <entry><= Less than or equal (e.g., age <=21)</entry>
- </row>
- <row>
- <entry></entry>
- <entry>IN(value1,value2,...,value<emphasis>n</emphasis>) where
- values are comma separated homogeneous types</entry>
- </row>
- <row>
- <entry></entry>
- <entry>NOT IN(value1,value2,...,value<emphasis>n</emphasis>)
- where values are comma separated homogeneous types</entry>
- </row>
- <row>
- <entry></entry>
- <entry>LIKE <emphasis>pattern</emphasis> where the pattern
- uses SQL LIKE operators with % and _ wildcards.</entry>
- </row>
- <row>
- <entry></entry>
- <entry>NOT LIKE <emphasis>pattern</emphasis> where the pattern
- uses SQL LIKE operators with % and _ wildcards.</entry>
- </row>
- <row>
- <entry><emphasis>limitNumber</emphasis></entry>
- <entry>The number of rows to return. This overrides the
- default configuration attribute (EclResultLimit ) but cannot
- be set to ALL</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable><superscript>1</superscript>Aliasing not
- supported</para>
- <para><superscript>2</superscript>Can only contain references to
- aggregate functions<superscript></superscript>if used with
- <emphasis>having</emphasis> clause.</para>
- <para>Aggregate functions can only be expressed in logicalExpressions by
- using <emphasis>Group by</emphasis>and
- <emphasis>having</emphasis></para>
- <para>Examples:</para>
- <programlisting>Select * from tableList where Sum(F1 > 100) /* is NOT SUPPORTED */
- Select * from tableList Group by F1 Having Sum (F1 > 100) /* IS SUPPORTED */</programlisting>
- <para>Example:</para>
- <programlisting>Select fname, lname, state from TutorialPerson where
- state='FL' OR (lname='Smith' and fname='Joe')
- //returns data that looks like this:
- John Doe FL
- Jim Smith FL
- Jane Row FL
- Joe Smith CA
- Select fname, lname, state from TutorialPerson where state='FL' AND lname <> 'Smith'
- //returns data that looks like this:
- John Doe FL
- Jane Row FL
- Select fname, lname, state from TutorialPerson where state='FL' AND lname like 'Smi%'
- //returns data that looks like this:
- Jim Smith FL
- Select fname, lname, state from TutorialPerson where
- state='FL' OR (lname='Smith' and fname='Joe') AND fname NOT LIKE 'Ji%'
- //returns data that looks like this:
- John Doe FL
- Jane Row FL
- Joe Smith CA
- </programlisting>
- <para>The interface supports SQL index hints, which gives the SQL user
- the option to specify the most appropriate HPCC index for the current
- SQL query. This also allows you to disable the use of an index.</para>
- <para><emphasis role="bold">select
- </emphasis><emphasis>columnList</emphasis> <emphasis role="bold"> from
- </emphasis><emphasis>tableName </emphasis><emphasis role="bold">USE
- INDEX(</emphasis><emphasis>hpcc::index::file::name</emphasis><emphasis
- role="bold">) where </emphasis><emphasis>logicalExprssions
- </emphasis></para>
- <para><emphasis role="bold">USE INDEX(none) </emphasis>forces the system
- to avoid seeking an index for the current query.</para>
- <para>Example:</para>
- <programlisting>Select fname, lname, zip, state from TutorialPerson
- USEINDEX(TutorialPersonByZipIndex)where zip='33024'
- //returns data that looks like this:
- John Doe FL 33024
- Jim Smith FL 33024
- Jane Row FL 33024
- </programlisting>
- <para>A Select query returns two dataset outputs per request. The second
- dataset (named WsSQLCount) provides the total result count. This is
- useful when paging results.</para>
- <para>Example:</para>
- <programlisting><Dataset name='WsSQLResult'>
- <Row>
- <yearbuilt>1203</yearbuilt>
- <id>4</id></Row>
- <Row>
- <yearbuilt>2003</yearbuilt>
- <id>5</id></Row>
- </Dataset>
- <Dataset name='WsSQLCount'>
- <Row>
- <WSSQLSelectQueryResultCount>2</WSSQLSelectQueryResultCount>
- </Row>
- </Dataset></programlisting>
- </sect1>
- <sect1>
- <title>SELECT JOIN</title>
- <para><emphasis role="bold">select
- </emphasis><emphasis>colummList</emphasis> <emphasis
- role="bold">from</emphasis> <emphasis>tableName <emphasis
- role="bold">[</emphasis></emphasis><emphasis
- role="bold">as</emphasis><emphasis> alias<emphasis
- role="bold">]</emphasis></emphasis><emphasis role="bold">
- </emphasis></para>
- <para><emphasis role="bold">[</emphasis><outer | inner > <emphasis
- role="bold">JOIN </emphasis><emphasis>join TableName
- </emphasis><emphasis role="bold">[ as
- </emphasis><emphasis>alias</emphasis><emphasis role="bold">] on
- </emphasis><emphasis>joinCondition</emphasis><emphasis
- role="bold">]</emphasis></para>
- <para>[USE INDEX<emphasis>(</emphasis>indexFileName | NONE
- <emphasis>)</emphasis>]</para>
- <para>[<emphasis role="bold">where</emphasis>
- <emphasis>logicalExpression] </emphasis>[<emphasis role="bold">group
- by</emphasis> <emphasis>fieldName</emphasis>]</para>
- <para>[<emphasis role="bold">order by</emphasis> <emphasis>columnNames
- </emphasis>[asc | desc]<emphasis> </emphasis>] [<emphasis
- role="bold">LIMIT</emphasis><emphasis> limitNumber</emphasis>]</para>
- <para><informaltable colsep="1" frame="all" rowsep="1">
- <tgroup cols="2">
- <colspec colwidth="123.45pt" />
- <colspec />
- <tbody>
- <row>
- <entry><emphasis>columnList</emphasis></entry>
- <entry>columnreference1[,columnreference2,columnreference3,...,columnreference<emphasis>n</emphasis>]</entry>
- </row>
- <row>
- <entry></entry>
- <entry>The column(s) to return (comma-separated list). In
- addition, these aggregate functions are supported : COUNT,
- SUM, MIN, MAX, and AVG. These work in a similar manner as
- their ECL counterparts.</entry>
- </row>
- <row>
- <entry>columnreference</entry>
- <entry>[tablename.]columnname[ [AS] alias ]</entry>
- </row>
- <row>
- <entry><emphasis>distinct</emphasis></entry>
- <entry>[distinct] col1, col2,...
- col<emphasis>n</emphasis></entry>
- </row>
- <row>
- <entry><emphasis></emphasis></entry>
- <entry>The result set will only contain distinct (unique)
- values.</entry>
- </row>
- <row>
- <entry><emphasis>alias</emphasis></entry>
- <entry>The alias used to refer to the corresponding table or
- field reference.</entry>
- </row>
- <row>
- <entry><emphasis role="bold">outer | inner</emphasis></entry>
- <entry>The type of JOIN to use. Note: The WsSQL service
- currently supports INNER JOIN or OUTER Joins. An OUTER JOIN is
- converted to a FULL OUTER JOIN internally.</entry>
- </row>
- <row>
- <entry><emphasis>joinTableName</emphasis></entry>
- <entry>The JOIN file to use.</entry>
- </row>
- <row>
- <entry><emphasis>joinCondition</emphasis></entry>
- <entry>Specifies the relationship between columns in the
- joined tables using logical expression.</entry>
- </row>
- <row>
- <entry><emphasis>logicalExpression</emphasis></entry>
- <entry>Logical expression based on standard SQL filtering
- syntax.</entry>
- </row>
- <row>
- <entry></entry>
- <entry>BOOLEAN Only supports <emphasis>True</emphasis> or
- <emphasis>False</emphasis>, do not use Y, N, 0, or 1.</entry>
- </row>
- <row>
- <entry></entry>
- <entry><emphasis role="bold">Valid
- operators:</emphasis></entry>
- </row>
- <row>
- <entry></entry>
- <entry>= Equal (e.g., age=33)</entry>
- </row>
- <row>
- <entry></entry>
- <entry><> Not equal (e.g., age <>33)</entry>
- </row>
- <row>
- <entry></entry>
- <entry>> Greater than (e.g., age >55)</entry>
- </row>
- <row>
- <entry></entry>
- <entry>< Less than (e.g., age < 18)</entry>
- </row>
- <row>
- <entry></entry>
- <entry>>= Greater than or equal (e.g., age >=21)</entry>
- </row>
- <row>
- <entry></entry>
- <entry><= Less than or equal (e.g., age <=21)</entry>
- </row>
- <row>
- <entry></entry>
- <entry>IN(value1,value2,...,value<emphasis>n</emphasis>) where
- values are comma separated homogeneous types.</entry>
- </row>
- <row>
- <entry></entry>
- <entry>NOT IN(value1,value2,...,value<emphasis>n</emphasis>)
- where values are comma separated homogeneous types.</entry>
- </row>
- <row>
- <entry></entry>
- <entry>LIKE <emphasis>pattern</emphasis> where the pattern
- uses SQL LIKE operators with % and _ wildcards.</entry>
- </row>
- <row>
- <entry></entry>
- <entry>NOT LIKE <emphasis>pattern</emphasis> where the pattern
- uses SQL LIKE operators with % and _ wildcards.</entry>
- </row>
- <row>
- <entry><emphasis>limitNumber</emphasis></entry>
- <entry>Optional. The number of rows to return. This overrides
- the default configuration attribute (<emphasis
- role="code">EclResultLimit </emphasis>) but cannot be set to
- ALL.</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable></para>
- <para><superscript>1</superscript>Aliasing not supported</para>
- <para><superscript>2</superscript>Can only contain references to
- aggregate functions<superscript></superscript>if used with
- <emphasis>having</emphasis> clause.</para>
- <para>Aggregate functions can only be expressed in logicalExpressions by
- using <emphasis>Group by</emphasis>and
- <emphasis>having</emphasis></para>
- <para>Examples:</para>
- <programlisting>Select * from tableList where Sum(F1 > 100) /* is NOT SUPPORTED */
- Select * from tableList Group by F1 Having Sum (F1 > 100) /* IS SUPPORTED */</programlisting>
- <para>Example:</para>
- <para><programlisting>Select t1.personname, t2.address
- from persontable as t1 inner join addresstable as t2
- on (t1.personid = t2.personid AND
- (t1.firstname = 'jim' AND
- t1.lastname = 'smith' )) </programlisting></para>
- <para></para>
- <para>The interface does not convert parameter list or column list
- values to string literals.</para>
- <para>String values should be single quote encapsulated. Field
- identifier can be left unquoted or double quoted.</para>
- <para>For example, the table <emphasis role="bold">persons</emphasis>
- has columns lastname(String) and Zip (numeric)</para>
- <para><programlisting>Select Firstname from persons where lastname = 'Jones' and zip > 33445 /* works */
- Select Firstname from persons where lastname = 'Jones' and "zip" > 33445 /* also works */
- Select Firstname from persons where lastname = Jones and zip > 33445 /* doesn't work */
- Select Firstname from persons where lastname = 'Jones' and zip > '33445' /* doesn't work */</programlisting></para>
- <para></para>
- </sect1>
- <sect1>
- <title>CREATE / LOAD</title>
- <para><emphasis role="bold">create table</emphasis> <emphasis
- role="bold">[if not exists]</emphasis> <emphasis>newtablename</emphasis>
- <emphasis
- role="bold">'('(</emphasis><emphasis>fieldname</emphasis><emphasis
- role="bold">(</emphasis><emphasis>fieldtype</emphasis><emphasis
- role="bold">[</emphasis><emphasis>fieldlen</emphasis><emphasis
- role="bold">[</emphasis><emphasis>,precision</emphasis><emphasis
- role="bold">]][</emphasis><emphasis
- role="bold">UNSIGNED</emphasis><emphasis role="bold">][,]
- ))+')'</emphasis></para>
- <para><emphasis role="bold">[comment</emphasis> 'commenttext'<emphasis
- role="bold">]<emphasis role="bold">[;]</emphasis></emphasis></para>
- <para><emphasis role="bold">load data infile</emphasis>
- '<emphasis>sourcetablename</emphasis>' <emphasis
- role="bold">[connection</emphasis> '<emphasis>landingzoneIP</emphasis>'
- <emphasis role="bold">directory</emphasis>
- '<emphasis>landingzonepath</emphasis>'<emphasis
- role="bold">]</emphasis></para>
- <para><emphasis role="bold">into table</emphasis> <emphasis>newtablename
- </emphasis></para>
- <para><emphasis role="bold">[(fields | columns) [ terminated by
- '</emphasis><emphasis>fieldDelimiter</emphasis>'<emphasis role="bold">]
- [ enclosed by '</emphasis><emphasis>quoteChar</emphasis><emphasis
- role="bold">']</emphasis><emphasis role="bold"> [ escaped by
- '</emphasis><emphasis>escapeChar</emphasis><emphasis
- role="bold">']]]</emphasis></para>
- <para><emphasis role="bold">[lines [ terminated by
- '</emphasis><emphasis>recordDelimiter</emphasis>'<emphasis
- role="bold">]]<emphasis role="bold">[;]</emphasis></emphasis></para>
- <para>The CREATE TABLE and LOAD DATA SQL statements allow you to create
- a file in an HPCC cluster that is accessible via WsSQL. You can populate
- the new file from data in a logical file already on the HPCC cluster or
- one that is on a landing zone.</para>
- <para>All Create requests MUST be accompanied by a Load request. You
- cannot create a table with the intention to load or insert data
- later.</para>
- <para><informaltable colsep="1" frame="all" rowsep="1">
- <tgroup cols="2">
- <colspec colwidth="123.45pt" />
- <colspec />
- <tbody>
- <row>
- <entry><emphasis>newtablename</emphasis></entry>
- <entry>The logical filename to create on the HPCC cluster.
- <emphasis role="bold">Note: </emphasis>Create and Load must
- target the same file.</entry>
- </row>
- <row>
- <entry><emphasis>commenttext</emphasis></entry>
- <entry>A text comment to add to the logical file's
- description</entry>
- </row>
- <row>
- <entry><emphasis>sourcetablename</emphasis></entry>
- <entry>The source file from which to extract data to load into
- the new table. This can be a logical file on an HPCC cluster
- or a physical file on a landing zone. For a landing zone file,
- you MUST provide a <emphasis role="bold">connection</emphasis>
- '<emphasis>landingzoneIP</emphasis>' and a <emphasis
- role="bold">directory</emphasis>
- '<emphasis>landingzonepath</emphasis>' (the path to the file).
- For a landing zone file, be sure to use matching case for the
- filename.</entry>
- </row>
- <row>
- <entry><emphasis>landingzoneIP</emphasis></entry>
- <entry>The IP Address or hostname of the HPCC Landing
- Zone</entry>
- </row>
- <row>
- <entry><emphasis>landingzonepath</emphasis></entry>
- <entry>The path to the datafile on the Landing Zonebut</entry>
- </row>
- <row>
- <entry><emphasis>fieldDelimiter</emphasis></entry>
- <entry>String value for field delimiter</entry>
- </row>
- <row>
- <entry><emphasis>quoteChar</emphasis></entry>
- <entry>String Value for the quote character</entry>
- </row>
- <row>
- <entry><emphasis>escapeChar</emphasis></entry>
- <entry>String Value for the escape character</entry>
- </row>
- <row>
- <entry><emphasis>recordDelimiter</emphasis></entry>
- <entry>String value for record delimiter</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable></para>
- <para>Examples:</para>
- <programlisting>CREATE TABLE newCustomerFile (id DECIMAL( 30, 5), mytint INT(9),
- mydouble DOUBLE (5,3) UNSIGNED)
- COMMENT 'this file created via WsSQL and populated from file on lz';
- LOAD DATA INFILE 'CustomerData' CONNECTION '127.0.0.1'
- DIRECTORY '/var/lib/HPCCSystems/mydropzone'
- INTO TABLE newCustomerFile;
- CREATE TABLE newCustomerFile2 (id DECIMAL( 30, 5), mytint INT(9),
- mydouble DOUBLE (5,3) UNSIGNED)
- COMMENT 'this file created via WsSQL and populated from sprayed file';
- LOAD DATA INFILE 'thor::customerdata::customers' INTO TABLE newCustomerFile2
- CREATE TABLE IF NOT EXISTS newCustomerFile3 (id DECIMAL( 30, 5), mytint INT(9),
- mydouble DOUBLE (5,3) UNSIGNED)
- COMMENT 'won't overwrite';
- LOAD DATA INFILE 'thor::customerdata::customers' INTO TABLE newCustomerFile3
- CREATE TABLE newCustomerFile4CSV (id DECIMAL( 30, 5), mytint INT(9),
- mydouble DOUBLE (5,3) UNSIGNED)
- COMMENT 'Loading CSV data';
- LOAD DATA INFILE 'somecsvfile.csv' FIELDS TERMINATED BY ',' ENCLOSED BY '"'
- LINES TERMINATED BY 'n'
- INTO TABLE newCustomerFile4CSV
- </programlisting>
- </sect1>
- <sect1>
- <title>Supported Aggregate Functions</title>
- <para><emphasis
- role="bold">COUNT</emphasis>([DISTINCT]<emphasis>columnName</emphasis>)</para>
- <para><emphasis
- role="bold">DISTINCT</emphasis>(<emphasis>columnName</emphasis>)</para>
- <para><emphasis
- role="bold">SUM</emphasis>(<emphasis>columnName</emphasis>)</para>
- <para><emphasis
- role="bold">MIN</emphasis>(<emphasis>columnName</emphasis>)</para>
- <para><emphasis
- role="bold">MAX</emphasis>(<emphasis>columnName</emphasis>)</para>
- <para><emphasis
- role="bold">AVG</emphasis>(<emphasis>columnName</emphasis>)</para>
- <para>These aggregate functions are supported. They behave as their ECL
- counterparts. See the <emphasis role="bold">ECL Language
- Reference</emphasis> for details.</para>
- <para><informaltable colsep="1" frame="all" rowsep="1">
- <tgroup cols="2">
- <colspec colwidth="200pt" />
- <colspec />
- <tbody>
- <row>
- <entry>COUNT</entry>
- <entry>Counts the occurrences of columnName in the result,
- always an integer.</entry>
- </row>
- <row>
- <entry>DISTINCT</entry>
- <entry>Returns only distinct values of columnName in the
- result, output type is dependent on input type.</entry>
- </row>
- <row>
- <entry>SUM</entry>
- <entry>Returns the sum of the values of columnName in the
- result, output type is dependent on input type.</entry>
- </row>
- <row>
- <entry>MIN</entry>
- <entry>Returns the minimum value for of columnName in the
- result, output type is dependent on input type.</entry>
- </row>
- <row>
- <entry>MAX</entry>
- <entry>Returns the minimum value for of columnName in the
- result, output type is dependent on input type.</entry>
- </row>
- <row>
- <entry>AVG</entry>
- <entry>Returns the average of the values of columnName in the
- result, always a real number.</entry>
- </row>
- <row>
- <entry>columnName</entry>
- <entry>The column to aggregate.</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable></para>
- <para>Example:</para>
- <para><programlisting>Select fname, lname, state, COUNT(zip) from TutorialPerson where zip='33024'</programlisting></para>
- <sect2>
- <title>Supported String Modifiers</title>
- <para><emphasis
- role="bold">UPPER</emphasis>(<emphasis>columnName</emphasis>)</para>
- <para><emphasis
- role="bold">LOWER</emphasis>(<emphasis>columnName</emphasis>)</para>
- <para></para>
- <informaltable colsep="1" frame="all" rowsep="1">
- <tgroup cols="2">
- <colspec colwidth="200pt" />
- <colspec />
- <tbody>
- <row>
- <entry>UPPER</entry>
- <entry>Returns with all lower case characters converted to
- upper case.</entry>
- </row>
- <row>
- <entry>LOWER</entry>
- <entry>Returns with all upper case characters converted to
- lower case.</entry>
- </row>
- <row>
- <entry>columnName</entry>
- <entry>The column to aggregate</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
- </sect2>
- <sect2 role="brk">
- <title>Special considerations</title>
- <para>Since this service uses both ECL and SQL, there are a few
- special considerations when designing the backend databases and stored
- procedures.</para>
- <sect3>
- <title>Reserved SQL Keywords</title>
- <para>Your HPCC identifiers (field names, Stored Procedure names,
- etc) cannot use SQL reserved words such as:</para>
- <programlisting>ADD ALL ANY AS ASC AT AVG BETWEEN BOOL BOOLEAN BY CALL COLUMN CONTAINS COUNT
- DESC DISTINCT FALSE FOR FROM GROUP HAVING IN INDEX INNER IS JOIN KEY KEYS LAST
- LEFT LIKE LIMIT LOWER MAX MIN MOD NOT NULL OFFSET ON ORDER OUT OUTER POWER SELECT
- SUM TABLE TRUE UPPER USE WHERE XOR DIV MOD OR AND</programlisting>
- </sect3>
- <sect3>
- <title>Special Characters</title>
- <para>Your HPCC filenames should avoid special characters other
- than:</para>
- <programlisting>( 'A'..'Z' | 'a'..'z' | '' | '$') ( 'A'..'Z' | 'a'..'z' | '' | '$' | '0'..'9' )
- File names can be prefixed with a ~ (tilde) or .::
- </programlisting>
- <para>If a filename is not supported, it will not be returned when
- interrogating the system using GetDBMetaData.</para>
- </sect3>
- </sect2>
- </sect1>
- </chapter>
- </book>
|