RavCOder
3rd September 2019, 11:13
Hi ,
I have these errors in my script:

ptdsls05010 ( 84): Error: '}' not expected
ptdsls05010 ( 87): Fatal Error : FUNCTION within function 'create.records' not expected


this is my code:


---------FUNCTION SECTION------------
functions:
function create.records()
{
select tdsls400.*
from tdsls400
selectdo
select tdsls401.*
from tdsls401
where tdsls401.orno = tdsls401.orno
selectdo
endselect
}

JaapJD
3rd September 2019, 11:34
You are missing an "endselect".

RavCOder
3rd September 2019, 11:46
I have another errors:

ptdsls05010 (82): Warning: missing selectdo; break generated.
ptdsls05010 (83): Error SELECTDO already present
ptdsls05010 (93): Error SQL: SQLState 42I00: Unexpected token ':' (error 302)
ptdsls05010 (97): Error SQL: SQLState 42I60: FROM clause not found where expected. Found ':' instead (error 302)
ptdsls05010 (103): Error: '}' not expected
ptdsls05010 (105): Fatal Error: FUNCTION within function 'sum.quantity' not expected.


my code:

function sum.quantity()
{
select tdsls400.item, tccom100.bpid
from tdsls400, tccom100
where tdsls400.orno = tdsls400.orno
group by select tdsls400.item, tccom100.bpid
selectdo
select sum (a.qoor) : sum.qoor
from tdsls400 a, tccom100 b
where a.item =: tdsls400.item
and b.bpid = : tccom100.bpid

endselect
}



thanks and regards,
-RavCoder-

mark_h
3rd September 2019, 15:25
Do you have spaces after the colons - i removed them below. PLus for the select sum I would include the selectdo and endselect.

function sum.quantity()
{
select tdsls400.item, tccom100.bpid
from tdsls400, tccom100
where tdsls400.orno = tdsls400.orno
group by select tdsls400.item, tccom100.bpid
selectdo
select sum (a.qoor):sum.qoor
from tdsls400 a, tccom100 b
where a.item = :tdsls400.item
and b.bpid = :tccom100.bpid
selectdo
endselect
endselect
}

RavCOder
3rd September 2019, 15:28
Hi, thanks you I have resolve !!!
Regards,
-RavCoder-