Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Lost qv table field with reload

Hello, i have a problem with the incremental reload , the error is

Field <HORA> isnt found.

Below the code......Help please i made many tests and nothing work.

My clue its arround the some drop table or change the name but......

Anyone?


Trace 'Loading variables from file and QVD';
Directory;
LET QVDFILE='tb_qv';
SET datatable='tb_qv';
LET Listqvdexists=isnull(FileSize('$(QvdPath)\$(QVDFILE)'));///if qvd exists then 0 else -1
LET QvdPath='X:';
LET QvdFieldName=QvdFieldName('$(QvdPath)\$(QVDFILE)',1);

if $(Listqvdexists)<0 then //if qvd file doesn't exist then make a full load
Trace 'Se cargan Datos a tabla virtual='$(datatable);
Trace 'No existe Qvd'$(QvdPath)\$(QVDFILE);
$(datatable):
SQL Select
HOUR(current timestamp+1 hour) as Hora
,count(NUMBER_ID) as Q
from DB_table;

STORE $(datatable) INTO $(QvdPath)\$(QVDFILE);

Else //if qvd Exists then make a full load.
Trace 'Exists Qvd doing incremental';
Trace 'Exists field?';
tb_qv:
SQL Select
HOUR(current timestamp+1 hour) as Hora
,count(NUMBER_ID) as Q
from DB_table;
Concatenate
LOAD Hora,Q FROM $(QvdPath)\$(QVDFILE) (qvd)
WHERE NOT EXISTS ('$(QvdFieldName)');
STORE $(datatable) INTO $(QvdPath)\$(QVDFILE);
//Msj for load
Trace 'Termina Incremental';
end if
exit script;






1 Solution

Accepted Solutions
Not applicable
Author


Fernando D. T. wrote:
Now I got it.
See the example atached. Looks like de address "$(QvdPath)\$(QVDFILE)" is wrong because the "\" is already there when the variable is defined.
Changing it to "$(QvdPath)$(QVDFILE)" solves the problem. See my example.
Regards
Fernando<div></div>


In my model works the relod the change i made was de lines


Concatenate (tb_qv_Peticion)
LOAD * FROM $(QvdPath)\$(QVDFILE) (qvd)
WHERE NOT EXISTS ('$(QvdFieldName)');


But......i have the problem with de condition exists because doesnt filter the table and insert a new HORA and Q in the table....

View solution in original post

7 Replies
Not applicable
Author

The error:

Campo no encontrado - <Hora>

(Field not found)

Concatenate

LOAD Hora,Q FROM X:tb_qv.qvd (qvd)

WHERE NOT EXISTS ('HORA')



fernandotoledo
Partner - Specialist
Partner - Specialist

The problem seems to be the "full load" case, because you use an EXISTS clause witch uses a field that were not loaded before, since your IF detected that there was no QVD before.

Besides that, you use concatenate load that might return another error since there is no table loaded before this one.

Regards.

Fernando

Not applicable
Author

The Full load dont present any problem if i try alone, i saw the xml generated and its OK, and the table in the "model" appears with the field

fernandotoledo
Partner - Specialist
Partner - Specialist

I think the problem is in the line"WHERE NOT EXISTS ('$(QvdFieldName)');"

Try without it.

Not applicable
Author


Fernando D. T. wrote:
I think the problem is in the line"WHERE NOT EXISTS ('$(QvdFieldName)');"
Try without it. <div></div>


I try it but and failed....but for the record i lose the incremental condition for loading QV table.

......and Thnks for your help and quick answers Mr. Fernando

fernandotoledo
Partner - Specialist
Partner - Specialist

Now I got it.

See the example atached. Looks like de address "$(QvdPath)\$(QVDFILE)" is wrong because the "\" is already there when the variable is defined.

Changing it to "$(QvdPath)$(QVDFILE)" solves the problem. See my example.

Regards

Fernando

Not applicable
Author


Fernando D. T. wrote:
Now I got it.
See the example atached. Looks like de address "$(QvdPath)\$(QVDFILE)" is wrong because the "\" is already there when the variable is defined.
Changing it to "$(QvdPath)$(QVDFILE)" solves the problem. See my example.
Regards
Fernando<div></div>


In my model works the relod the change i made was de lines


Concatenate (tb_qv_Peticion)
LOAD * FROM $(QvdPath)\$(QVDFILE) (qvd)
WHERE NOT EXISTS ('$(QvdFieldName)');


But......i have the problem with de condition exists because doesnt filter the table and insert a new HORA and Q in the table....