|
[WD24] SQL: how to create a temporary table? |
Débuté par VEGEboss, 16 jan. 2020 09:51 - 1 réponse |
| |
| | | |
|
| |
Membre enregistré 88 messages Popularité : +2 (2 votes) |
|
Posté le 16 janvier 2020 - 09:51 |
hello everybody
please consider the sql code below, use on a "simple" HF table
CREATE TABLE Shoes_Temp AS SELECT Shoes_Tag.Data AS Data, Shoes_Tag.Numero AS Numero, Shoes_Tag.Fornitore AS Fornitore, Shoes_Tag.Brand AS Brand, Shoes_Tag.FTY AS FTY, Shoes_Tag.TFS AS TFS, Shoes_Tag.Esito AS Esito, Shoes_Tag.FULL AS FULL, Shoes_Tag.Minor AS Minor, Shoes_Tag.Sostituiti AS Sostituiti, Shoes_Tag.Riparati AS Riparati, Shoes_Tag."Non Conformi" AS Non_Conformi, Shoes_Tag."Da Sostituire" AS Da_Sostituire, Shoes_Tag."Da Riparare" AS Da_Riparare, Shoes_Tag."Non Conformi1" AS Non_Conformi1, Shoes_Tag.Note AS Note, Shoes_Tag.TFS1 AS TFS1, Shoes_Tag.FTY1 AS FTY1, Shoes_Tag.Filename AS Filename, Shoes_Tag."Num# Foto" AS "Num#_Foto" FROM Shoes_Tag WHERE LEFT (Shoes_Tag.Numero, 6) = ParamNumero ORDER BY Numero DESC
the idea is to create a phisical copy of some data present in the "main" table but I get errors when I try to pass the parameter
I would like to use something like
HExecuteQuery(QRY_NoName_AQL_Shoes_Boss1, hQueryDefault, "123456")
but if you have other ideas, you're welcome
(I would like, also, use a sql sintax like "SELECT … INTO TABLE …" but I can't find this type of syntax
thank you very much |
| |
| |
| | | |
|
| | |
| |
Posté le 17 janvier 2020 - 15:37 |
Did you try something like this: my_sql is string=[ CREATE TABLE Shoes_Temp AS SELECT Shoes_Tag.Data AS Data, Shoes_Tag.Numero AS Numero, Shoes_Tag.Fornitore AS Fornitore, Shoes_Tag.Brand AS Brand, Shoes_Tag.FTY AS FTY, Shoes_Tag.TFS AS TFS, Shoes_Tag.Esito AS Esito, Shoes_Tag.Full AS FULL, Shoes_Tag.Minor AS Minor, Shoes_Tag.Sostituiti AS Sostituiti, Shoes_Tag.Riparati AS Riparati, Shoes_Tag."Non Conformi" AS Non_Conformi, Shoes_Tag."Da Sostituire" AS Da_Sostituire, Shoes_Tag."Da Riparare" AS Da_Riparare, Shoes_Tag."Non Conformi1" AS Non_Conformi1, Shoes_Tag.Note AS Note, Shoes_Tag.TFS1 AS TFS1, Shoes_Tag.FTY1 AS FTY1, Shoes_Tag.Filename AS Filename, Shoes_Tag."Num# Foto" AS "Num#_Foto" FROM Shoes_Tag WHERE LEFT (Shoes_Tag.Numero, 6) = '%1' ORDER BY Numero DESC ] my_sql=hbuildstring(my_sql,,"123456")
my_qry is data source HExecuteSQLQuery(my_qry,my_sql) |
| |
| |
| | | |
|
| | | | |
| | |
|