{"id":262,"date":"2023-02-22T17:37:15","date_gmt":"2023-02-22T16:37:15","guid":{"rendered":"http:\/\/www.sepchat.com\/SC\/?p=262"},"modified":"2023-02-23T15:01:38","modified_gmt":"2023-02-23T14:01:38","slug":"sql-creer-une-table-temporaire","status":"publish","type":"post","link":"http:\/\/www.sepchat.com\/SC\/index.php\/2023\/02\/22\/sql-creer-une-table-temporaire\/","title":{"rendered":"SQL\u00a0&#8211; Cr\u00e9er une table temporaire"},"content":{"rendered":"\n<p>L\u2019instruction SQL DECLARE GLOBAL TEMPORARY TABLE permet de cr\u00e9er une table dans QTEMP.<\/p>\n\n\n\n<p>DECLARE GLOBAL TEMPORARY TABLE FICHIER AS (<br>SELECT * FROM PERSPHY) WITH DATA WITH REPLACE NOT LOGGED<\/p>\n\n\n\n<p>DECLARE GLOBAL TEMPORARY TABLE CLIENTS (<br>&nbsp;CODE integer,<br>&nbsp;RAISOC char(50), &nbsp; &nbsp; &nbsp; &nbsp;<br>&nbsp;ADR1 varchar(50),<br>&nbsp;ADR2 varchar(50),<br>&nbsp;VILLE varCHAR(50)<br>&nbsp;)<br>WITH REPLACE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;<strong>WITH DATA<\/strong>&nbsp;permet de copier les donn\u00e9es si la table est cr\u00e9\u00e9e \u00e0 partir d\u2019une requ\u00eate sur des donn\u00e9es existantes.<br>&nbsp;&nbsp;&nbsp;<strong>WITH REPLACE<\/strong>&nbsp;permet une cr\u00e9ation avec remplacement, si la table existe d\u00e9ja dans QTEMP.<br>&nbsp;&nbsp;&nbsp;<strong>NOT LOGGED<\/strong>, indique une table non journalis\u00e9e (insensible aux ROLLBACK).<br>&nbsp;&nbsp;&nbsp;La table n\u2019apparait pas dans les catalogues SQL et est d\u00e9truite en fin de session.<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized size-full has-custom-border\"><a href=\"sql2\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.sepchat.com\/SC\/wp-content\/uploads\/2023\/02\/fleche-r-edited.png\" alt=\"\" width=\"57\" height=\"57\"\/><\/a><\/figure>\n\n\n\n<div class=\"wp-block-buttons is-layout-flex\">\n<div class=\"wp-block-button is-style-outline\"><a class=\"wp-block-button__link wp-element-button\" style=\"border-radius:100px\">Cet article vous a \u00e9t\u00e9 utile ? N\u2019h\u00e9sitez pas \u00e0 le partager.<\/a><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>L\u2019instruction SQL DECLARE GLOBAL TEMPORARY TABLE permet de cr\u00e9er une table dans QTEMP. DECLARE GLOBAL TEMPORARY TABLE FICHIER AS (SELECT * FROM PERSPHY) WITH DATA WITH REPLACE NOT LOGGED DECLARE GLOBAL TEMPORARY TABLE CLIENTS (&nbsp;CODE integer,&nbsp;RAISOC char(50), &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;ADR1 varchar(50),&nbsp;ADR2 varchar(50),&nbsp;VILLE varCHAR(50)&nbsp;)WITH REPLACE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[8],"tags":[],"_links":{"self":[{"href":"http:\/\/www.sepchat.com\/SC\/index.php\/wp-json\/wp\/v2\/posts\/262"}],"collection":[{"href":"http:\/\/www.sepchat.com\/SC\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.sepchat.com\/SC\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.sepchat.com\/SC\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.sepchat.com\/SC\/index.php\/wp-json\/wp\/v2\/comments?post=262"}],"version-history":[{"count":3,"href":"http:\/\/www.sepchat.com\/SC\/index.php\/wp-json\/wp\/v2\/posts\/262\/revisions"}],"predecessor-version":[{"id":333,"href":"http:\/\/www.sepchat.com\/SC\/index.php\/wp-json\/wp\/v2\/posts\/262\/revisions\/333"}],"wp:attachment":[{"href":"http:\/\/www.sepchat.com\/SC\/index.php\/wp-json\/wp\/v2\/media?parent=262"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.sepchat.com\/SC\/index.php\/wp-json\/wp\/v2\/categories?post=262"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.sepchat.com\/SC\/index.php\/wp-json\/wp\/v2\/tags?post=262"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}