Subject | Master-Detail query and much more... Help. |
---|---|
Author | Isildo Mendes |
Post date | 2002-02-15T23:31:45Z |
What's the best way to this:
I have a form with two grids (master-detail)
The master grid is the header of the invoices, and the
detail is the detail (lines) of the invoices.
SQL for master query:
SELECT ENC_GERAL_DATA_ENC, ENC_GERAL_CLIENTE,
ENC_GERAL_DOCUMENTO, ENC_GERAL_SERIE,
ENC_GERAL_DOC_NUM,
ENC_GERAL_DATA_SAT, ENC_GERAL_TOTAL_ENC,
ENC_GERAL_ESTADO,
ENC_GERAL_NUM_ENC
FROM ENC_GERAL
WHERE ENC_GERAL_ESTADO = 'PS'
OR ENC_GERAL_ESTADO = 'PAS'
AND ENC_GERAL_DOCUMENTO IS NOT NULL
AND ENC_GERAL_CLIENTE = :cliente
SQL for detail query:
SELECT ENC_DET_NUM_ENC, ENC_DET_ARTIGO,
ENC_DET_ARMAZEM,
ENC_DET_QT_ENC, ENC_DET_QT_A_SATISFAZER,
ENC_DET_QT_ANULADA,
ENC_DET_QT_SATISFEITA
FROM ENC_DETALHE
WHERE ENC_DET_NUM_ENC = :num_enc
AND ENC_DET_ARMAZEM = :arm
AND ENC_DET_ARTIGO = :artigo
I use the TIBOQuery component for each grid.
The fields thas links the two tables is the
ENC_GERAL_NUM_ENC and ENC_DET_NUM_ENC
How can I make de relation master/detail between the
two queries?
The problem is that the first query (master) have a
parameter (the customer number), and the detail
query have three parameters (invoice_num, product_num
and warehouse_num).
I want to show only the invoices for that client, and
in the detail only those products and warehouse.
The detail query should be editable, the user can edit
only one field (qty_to_sat).
I want that the user update this value within the
grid. How can I pass the value in that grid column to
update the field in the table? Should I use a
TIBOUpdateSQL ?
How can I do that?
Thank you
isildo@...
__________________________________________________
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
http://sports.yahoo.com
I have a form with two grids (master-detail)
The master grid is the header of the invoices, and the
detail is the detail (lines) of the invoices.
SQL for master query:
SELECT ENC_GERAL_DATA_ENC, ENC_GERAL_CLIENTE,
ENC_GERAL_DOCUMENTO, ENC_GERAL_SERIE,
ENC_GERAL_DOC_NUM,
ENC_GERAL_DATA_SAT, ENC_GERAL_TOTAL_ENC,
ENC_GERAL_ESTADO,
ENC_GERAL_NUM_ENC
FROM ENC_GERAL
WHERE ENC_GERAL_ESTADO = 'PS'
OR ENC_GERAL_ESTADO = 'PAS'
AND ENC_GERAL_DOCUMENTO IS NOT NULL
AND ENC_GERAL_CLIENTE = :cliente
SQL for detail query:
SELECT ENC_DET_NUM_ENC, ENC_DET_ARTIGO,
ENC_DET_ARMAZEM,
ENC_DET_QT_ENC, ENC_DET_QT_A_SATISFAZER,
ENC_DET_QT_ANULADA,
ENC_DET_QT_SATISFEITA
FROM ENC_DETALHE
WHERE ENC_DET_NUM_ENC = :num_enc
AND ENC_DET_ARMAZEM = :arm
AND ENC_DET_ARTIGO = :artigo
I use the TIBOQuery component for each grid.
The fields thas links the two tables is the
ENC_GERAL_NUM_ENC and ENC_DET_NUM_ENC
How can I make de relation master/detail between the
two queries?
The problem is that the first query (master) have a
parameter (the customer number), and the detail
query have three parameters (invoice_num, product_num
and warehouse_num).
I want to show only the invoices for that client, and
in the detail only those products and warehouse.
The detail query should be editable, the user can edit
only one field (qty_to_sat).
I want that the user update this value within the
grid. How can I pass the value in that grid column to
update the field in the table? Should I use a
TIBOUpdateSQL ?
How can I do that?
Thank you
isildo@...
__________________________________________________
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
http://sports.yahoo.com