delete from ips_ng where guid='ZestWysylki';
delete from ips_po where guid_ng='ZestWysylki';
delete from ips_params where guid_ng='ZestWysylki';

create table tmp_ips_ng select * from ips_ng where guid='DUMMYSEBA';
create table tmp_ips_po select * from ips_po where guid_ng='DUMMYSEBA';
create table tmp_ips_params select * from ips_params where guid_ng='DUMMYSEBA';

--
-- Host: localhost    Database: polaszek
-- ------------------------------------------------------


--
-- Dumping data for table `tmp_ips_ng`
--
-- WHERE:  guid='ZestWysylki'

INSERT INTO `tmp_ips_ng` VALUES (0,'ZestWysylki','Zestawienie wysyłki','create table _ZestWysylki\r\nSELECT nrzamwkontr, zamawiajacy, terminrealizacji, info2  FROM zmng where rodzaj=52 and kontrsymbol=\'KHG\' \r\nand terminrealizacji between \"#dataod#\" and \"#datado#\" and info2 like \"%#miejsce#%\" group by zamawiajacy;\r\n\r\nset @lp::=0;\r\ncreate table _ZestWysylkiLP\r\nselect @lp::=@lp+1 as lp, nrzamwkontr, zamawiajacy, terminrealizacji from _ZestWysylki order by terminrealizacji',NULL,'drop table _ZestWysylki;\r\ndrop table _ZestWysylkiLP;','CIT',1,'Zestawienie wysyłki',NULL,NULL,NULL,'','',22,'','',NULL);


--
-- Host: localhost    Database: polaszek
-- ------------------------------------------------------


--
-- Dumping data for table `tmp_ips_po`
--
-- WHERE:  guid_ng='ZestWysylki'

INSERT INTO `tmp_ips_po` VALUES (0,'ZestWysylki','symbol','Symbol formularza',1,0,0,'ZestWysylki'),(0,'ZestWysylki','calc','Obliczać?',1,0,0,'1'),(0,'ZestWysylki','edit','Edytować?',1,0,0,'1'),(0,'ZestWysylki','pNAG.01','Numer',1,3,0,'numer'),(0,'ZestWysylki','pNAG.02','BiezacaData',1,1,0,'SELECT Current_Date'),(0,'ZestWysylki','p.0.1','DataDostawy',1,3,0,'dostawa'),(0,'ZestWysylki','p.2.1','Pole02.1',1,1,0,'select ifnull ((select nrzamwkontr from _ZestWysylkiLP where lp=2),\'-\') as nr2'),(0,'ZestWysylki','p.3.1','Pole03.1',1,1,0,'select ifnull ((select nrzamwkontr from _ZestWysylkiLP where lp=3),\'-\') as nr3'),(0,'ZestWysylki','p.4.1','Pole04.1',1,1,0,'select ifnull ((select nrzamwkontr from _ZestWysylkiLP where lp=4),\'-\') as nr4'),(0,'ZestWysylki','p.1.1','Pole01.1',1,1,0,'select ifnull ((select nrzamwkontr from _ZestWysylkiLP where lp=1),\'-\') as nr1'),(0,'ZestWysylki','p.5.1','Pole05.1',1,1,0,'select ifnull ((select nrzamwkontr from _ZestWysylkiLP where lp=5),\'-\') as nr5'),(0,'ZestWysylki','p.6.1','Pole06.1',1,1,0,'select ifnull ((select nrzamwkontr from _ZestWysylkiLP where lp=6),\'-\') as nr6'),(0,'ZestWysylki','p.7.1','Pole07.1',1,1,0,'select ifnull ((select nrzamwkontr from _ZestWysylkiLP where lp=7),\'-\') as nr7'),(0,'ZestWysylki','p.8.1','Pole08.1',1,1,0,'select ifnull ((select nrzamwkontr from _ZestWysylkiLP where lp=8),\'-\') as nr8'),(0,'ZestWysylki','p.9.1','Pole09.1',1,1,0,'select ifnull ((select nrzamwkontr from _ZestWysylkiLP where lp=9),\'-\') as nr9'),(0,'ZestWysylki','p.10.1','Pole10.1',1,1,0,'select ifnull ((select nrzamwkontr from _ZestWysylkiLP where lp=10),\'-\') as nr10'),(0,'ZestWysylki','p.11.1','Pole11.1',1,1,0,'select ifnull ((select nrzamwkontr from _ZestWysylkiLP where lp=11),\'-\') as nr11'),(0,'ZestWysylki','p.12.1','Pole12.1',1,1,0,'select ifnull ((select nrzamwkontr from _ZestWysylkiLP where lp=12),\'-\') as nr12'),(0,'ZestWysylki','p.13.1','Pole13.1',1,1,0,'select ifnull ((select nrzamwkontr from _ZestWysylkiLP where lp=13),\'-\') as nr13'),(0,'ZestWysylki','p.14.1','Pole14.1',1,1,0,'select ifnull ((select nrzamwkontr from _ZestWysylkiLP where lp=14),\'-\') as nr14'),(0,'ZestWysylki','p.15.1','Pole15.1',1,1,0,'select ifnull ((select nrzamwkontr from _ZestWysylkiLP where lp=15),\'-\') as nr15'),(0,'ZestWysylki','p.16.1','Pole16.1',1,1,0,'select ifnull ((select nrzamwkontr from _ZestWysylkiLP where lp=16),\'-\') as nr16'),(0,'ZestWysylki','p.17.1','Pole17.1',1,1,0,'select ifnull ((select nrzamwkontr from _ZestWysylkiLP where lp=17),\'-\') as nr17'),(0,'ZestWysylki','p.18.1','Pole18.1',1,1,0,'select ifnull ((select nrzamwkontr from _ZestWysylkiLP where lp=18),\'-\') as nr18'),(0,'ZestWysylki','p.19.1','Pole19.1',1,1,0,'select ifnull ((select nrzamwkontr from _ZestWysylkiLP where lp=19),\'-\') as nr19'),(0,'ZestWysylki','p.20.1','Pole20.1',1,1,0,'select ifnull ((select nrzamwkontr from _ZestWysylkiLP where lp=20),\'-\') as nr20'),(0,'ZestWysylki','p.21.1','Pole21.1',1,1,0,'select ifnull ((select nrzamwkontr from _ZestWysylkiLP where lp=21),\'-\') as nr21'),(0,'ZestWysylki','p.22.1','Pole22.1',1,1,0,'select ifnull ((select nrzamwkontr from _ZestWysylkiLP where lp=22),\'-\') as nr22'),(0,'ZestWysylki','p.23.1','Pole23.1',1,1,0,'select ifnull ((select nrzamwkontr from _ZestWysylkiLP where lp=23),\'-\') as nr23'),(0,'ZestWysylki','p.24.1','Pole24.1',1,1,0,'select ifnull ((select nrzamwkontr from _ZestWysylkiLP where lp=24),\'-\') as nr24'),(0,'ZestWysylki','p.25.1','Pole25.1',1,1,0,'select ifnull ((select nrzamwkontr from _ZestWysylkiLP where lp=25),\'-\') as nr25'),(0,'ZestWysylki','p.26.1','Pole26.1',1,1,0,'select ifnull ((select nrzamwkontr from _ZestWysylkiLP where lp=26),\'-\') as nr26'),(0,'ZestWysylki','p.27.1','Pole27.1',1,1,0,'select ifnull ((select nrzamwkontr from _ZestWysylkiLP where lp=27),\'-\') as nr27'),(0,'ZestWysylki','p.28.1','Pole28.1',1,1,0,'select ifnull ((select nrzamwkontr from _ZestWysylkiLP where lp=28),\'-\') as nr28'),(0,'ZestWysylki','p.1.2','Pole01.2',1,1,0,'select ifnull ((select zamawiajacy from _ZestWysylkiLP where lp=1),\'-\') as nr1'),(0,'ZestWysylki','p.2.2','Pole02.2',1,1,0,'select ifnull ((select zamawiajacy from _ZestWysylkiLP where lp=2),\'-\') as nr2'),(0,'ZestWysylki','p.3.2','Pole03.2',1,1,0,'select ifnull ((select zamawiajacy from _ZestWysylkiLP where lp=3),\'-\') as nr3'),(0,'ZestWysylki','p.4.2','Pole04.2',1,1,0,'select ifnull ((select zamawiajacy from _ZestWysylkiLP where lp=4),\'-\') as nr4'),(0,'ZestWysylki','p.5.2','Pole05.2',1,1,0,'select ifnull ((select zamawiajacy from _ZestWysylkiLP where lp=5),\'-\') as nr5'),(0,'ZestWysylki','p.6.2','Pole06.2',1,1,0,'select ifnull ((select zamawiajacy from _ZestWysylkiLP where lp=6),\'-\') as nr6'),(0,'ZestWysylki','p.7.2','Pole07.2',1,1,0,'select ifnull ((select zamawiajacy from _ZestWysylkiLP where lp=7),\'-\') as nr7'),(0,'ZestWysylki','p.8.2','Pole08.2',1,1,0,'select ifnull ((select zamawiajacy from _ZestWysylkiLP where lp=8),\'-\') as nr8'),(0,'ZestWysylki','p.9.2','Pole09.2',1,1,0,'select ifnull ((select zamawiajacy from _ZestWysylkiLP where lp=9),\'-\') as nr9'),(0,'ZestWysylki','p.10.2','Pole10.2',1,1,0,'select ifnull ((select zamawiajacy from _ZestWysylkiLP where lp=10),\'-\') as nr10'),(0,'ZestWysylki','p.11.2','Pole11.2',1,1,0,'select ifnull ((select zamawiajacy from _ZestWysylkiLP where lp=11),\'-\') as nr11'),(0,'ZestWysylki','p.12.2','Pole12.2',1,1,0,'select ifnull ((select zamawiajacy from _ZestWysylkiLP where lp=12),\'-\') as nr12'),(0,'ZestWysylki','p.13.2','Pole13.2',1,1,0,'select ifnull ((select zamawiajacy from _ZestWysylkiLP where lp=13),\'-\') as nr13'),(0,'ZestWysylki','p.14.2','Pole14.2',1,1,0,'select ifnull ((select zamawiajacy from _ZestWysylkiLP where lp=14),\'-\') as nr14'),(0,'ZestWysylki','p.15.2','Pole15.2',1,1,0,'select ifnull ((select zamawiajacy from _ZestWysylkiLP where lp=15),\'-\') as nr15'),(0,'ZestWysylki','p.16.2','Pole16.2',1,1,0,'select ifnull ((select zamawiajacy from _ZestWysylkiLP where lp=16),\'-\') as nr16'),(0,'ZestWysylki','p.17.2','Pole17.2',1,1,0,'select ifnull ((select zamawiajacy from _ZestWysylkiLP where lp=17),\'-\') as nr17'),(0,'ZestWysylki','p.18.2','Pole18.2',1,1,0,'select ifnull ((select zamawiajacy from _ZestWysylkiLP where lp=18),\'-\') as nr18'),(0,'ZestWysylki','p.19.2','Pole19.2',1,1,0,'select ifnull ((select zamawiajacy from _ZestWysylkiLP where lp=19),\'-\') as nr19'),(0,'ZestWysylki','p.20.2','Pole20.2',1,1,0,'select ifnull ((select zamawiajacy from _ZestWysylkiLP where lp=20),\'-\') as nr20'),(0,'ZestWysylki','p.21.2','Pole21.2',1,1,0,'select ifnull ((select zamawiajacy from _ZestWysylkiLP where lp=21),\'-\') as nr21'),(0,'ZestWysylki','p.22.2','Pole22.2',1,1,0,'select ifnull ((select zamawiajacy from _ZestWysylkiLP where lp=22),\'-\') as nr22'),(0,'ZestWysylki','p.23.2','Pole23.2',1,1,0,'select ifnull ((select zamawiajacy from _ZestWysylkiLP where lp=23),\'-\') as nr23'),(0,'ZestWysylki','p.24.2','Pole24.2',1,1,0,'select ifnull ((select zamawiajacy from _ZestWysylkiLP where lp=24),\'-\') as nr24'),(0,'ZestWysylki','p.25.2','Pole25.2',1,1,0,'select ifnull ((select zamawiajacy from _ZestWysylkiLP where lp=25),\'-\') as nr25'),(0,'ZestWysylki','p.26.2','Pole26.2',1,1,0,'select ifnull ((select zamawiajacy from _ZestWysylkiLP where lp=26),\'-\') as nr26'),(0,'ZestWysylki','p.27.2','Pole27.2',1,1,0,'select ifnull ((select zamawiajacy from _ZestWysylkiLP where lp=27),\'-\') as nr27'),(0,'ZestWysylki','p.28.2','Pole28.2',1,1,0,'select ifnull ((select zamawiajacy from _ZestWysylkiLP where lp=28),\'-\') as nr28'),(0,'ZestWysylki','p.0.2','Magazyn',1,3,0,'miejsce');


--
-- Host: localhost    Database: polaszek
-- ------------------------------------------------------


--
-- Dumping data for table `tmp_ips_params`
--
-- WHERE:  guid_ng='ZestWysylki'

INSERT INTO `tmp_ips_params` VALUES (0,'ZestWysylki','dostawa','Termin dostawy',9,0,NULL,0),(0,'ZestWysylki','numer','Numer',1,0,NULL,0),(0,'ZestWysylki','dataod','Data Od',9,0,NULL,0),(0,'ZestWysylki','datado','Data Do',9,0,NULL,0),(0,'ZestWysylki','miejsce','Magazyn',1,0,NULL,0);


insert ignore into ips_ng select * from tmp_ips_ng;
insert ignore into ips_po select * from tmp_ips_po;
insert ignore into ips_params select * from tmp_ips_params;


