mig28mx
10th July 2009, 01:52
Hello All,
I´m trying to develop a consult session that query table tiitm001 with a certain description on field tiitm001.dsca I´m using dynamic SQL but my problem is the following: For the output I´m using multiocurrence screen (due to is a consult session) but I´m only can see the last record found.
Here is my code:
before.program:
import ("name",name)
import ("fami",fami)
field.regs1.cia:
before.display:
str.stoc = " "
str.pc = " "
str.dt = " "
item.dsca = " "
sql = sql.parse("select tiitm001.* " &
"from tiitm001 " &
"where tiitm001._compnr = 123 " &
"and tiitm001.dsca like """ & name & """ ")
sql.exec(sql)
while not sql.fetch(sql)
str.stoc = sprintf$("%14.2f",tiitm001.stoc)
regs1.cia = tiitm001.item & " " & tiitm001.dsca & " " & str.stoc
nombre.cia835 = "company name"
endwhile
sql.close(sql)
Any suggestion?
Thank you in advance.
I´m trying to develop a consult session that query table tiitm001 with a certain description on field tiitm001.dsca I´m using dynamic SQL but my problem is the following: For the output I´m using multiocurrence screen (due to is a consult session) but I´m only can see the last record found.
Here is my code:
before.program:
import ("name",name)
import ("fami",fami)
field.regs1.cia:
before.display:
str.stoc = " "
str.pc = " "
str.dt = " "
item.dsca = " "
sql = sql.parse("select tiitm001.* " &
"from tiitm001 " &
"where tiitm001._compnr = 123 " &
"and tiitm001.dsca like """ & name & """ ")
sql.exec(sql)
while not sql.fetch(sql)
str.stoc = sprintf$("%14.2f",tiitm001.stoc)
regs1.cia = tiitm001.item & " " & tiitm001.dsca & " " & str.stoc
nombre.cia835 = "company name"
endwhile
sql.close(sql)
Any suggestion?
Thank you in advance.