tion1976
2nd February 2023, 12:11
What exactly {1} means in the following statement
select tfgld010.dimx:beneficiar, tfgld010.desc:beneficiar.dsca
from tfgld010
where tfgld010._index1 = {1}

RobertP
2nd February 2023, 12:28
Hello Tion,

Please post the entire select statement. By the looks of it, 1 has been bound, but without the entire script we cannot tell you.

Rob

JaapJD
2nd February 2023, 12:29
It is just the dimension type 1

OmeLuuk
2nd February 2023, 18:07
As in: in the statement "where tfgld010._index1 = {1}" you should want to know which fields make up the _index1.
On the 10.7 system here: in the RDD file I readI
:IDNO:001
:KEYF:tfgld010.c001
:ACTI:1meaning the active (ACTI:1) index number 1 (IDNO:001) consists of (KEYF:tfgld010.c001) key field tfgld010.c001.
From this tablefield the RDD file readsF
:NAME:tfgld010.c001
:DBAS:0
:CHIL:tfgld010.dtyp tfgld010.dimx
saying that the children of this field are 2: tfgld010.dtype and tfgld010.dimx.
So: tfgld010._index1 translates to tfgld010.c001 which translates to {tfgld010.dtyp, tfgld010.dimx}
In your case the query selects only the first field and only with value 1 (dtyp is a field with domain tfgld.dimn which has data type Byte).

tion1976
3rd February 2023, 10:10
Hi all,

1) index tfgld010._index1 is composed only of composed field c001 of type tfgld010.c001 Type Dimension / Dimension


2) The full select is like this:

select tfgld010.dimx:beneficiar, tfgld010.desc:beneficiar.dsca
from tfgld010
where tfgld010._index1 = {1}
selectdo
valoare = 0

|masini

select tiitt502.*, tiitt110.cmtg
from tiitt502, tiitt505, tiitt110
where (tiitt505.tarz <> tgyenox.yes and tiitt505.date between :prima.zi and :ultima.zi or
tiitt505.tarz = tgyenox.yes and tiitt505.altd between :prima.zi and :ultima.zi)
and tiitt502.dimx = :beneficiar
and tiitt502.enno refers to tiitt505
and tiitt505.motr refers to tiitt110
selectdo
data = tiitt502.addt

ore = 0
|ore = tiitt502.adrt / 100 + (tiitt502.adrt \ 100) / 60.0

|calcul tarif
select tiitt506.*
from tiitt506
where tiitt506._index2 = {tiitc.tipp.auto, :tiitt110.cmtg}
and tiitt506.data <= :data
order by tiitt506.data desc
as set with 1 rows
selectdo
if double.cmp( tiitt502.kmoras, 0.0, 0.0001 ) = 1 then
valoare = valoare + tiitt506.prlk * tiitt502.kmoras + tiitt506.prik * tiitt502.kmafara + tiitt506.prlo * ore
else
valoare = valoare + tiitt506.prlk * tiitt502.kmoras + tiitt506.prik * tiitt502.kmafara
endif
endselect
endselect

|utilaje

select tsitt520.*, tsitt102.ctyp
from tsitt520, tsitt102
where tsitt520._index1 inrange {:prima.zi} and {:ultima.zi}
and tsitt520.dimx = :beneficiar
and tsitt520.cins refers to tsitt102
selectdo
data = tsitt520.data

|calcul tarif
select tiitt506.*
from tiitt506
where tiitt506._index2 = {tiitc.tipp.utilaj, " ", :tsitt102.ctyp}
and tiitt506.data <= :data
order by tiitt506.data desc
as set with 1 rows
selectdo
selectempty
tiitt506.lucr = 0
tiitt506.stat = 0
endselect

valoare = valoare + tiitt506.stat * tsitt520.disp + tiitt506.lucr * tsitt520.efec
endselect

if double.cmp(valoare, 0.0, 0.0001) <> 0 then
select tiitt507.*
from tiitt507
where tiitt507._index1 = {:anul, :luna, :beneficiar}
selectdo
selectempty
tiitt507.anul = anul
tiitt507.luna = luna
tiitt507.dimx = beneficiar
tiitt507.amnt = valoare
tiitt507.data = date.num()
tiitt507.inch = tcyesno.yes
db.insert(ttiitt507, db.retry)
endselect

rprt_send()
endif
endselect