How to include variable on block's query [message #238442] |
Fri, 18 May 2007 01:22 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
anna marie
Messages: 26 Registered: June 2006 Location: Philippines
|
Junior Member |
|
|
I have a block where I fetch data using Query with sub-querry on Query data source name. The problem is that I need to put a variable in a sub-query, but it returned error: ORA-01008 not all variables bound. I'm retrieving multiple records here.
SELECT DISTINCT --fields
FROM table1 a, table2 b, table3 c, table4 d
WHERE a.line_cd = b.line_cd
AND a.line_cd = 21
--other conditions
AND a.clm_seq_no = 7100003
AND d.eff_dt = (SELECT MAX(eff_dt)
FROM table4
WHERE 1=1
AND srvc_code = a.srvc_code
AND line_cd = a.line_cd
AND sched_no = a.sched_no
AND cover_code = a.cover_code
AND eff_dt <= :global.variable --problem
)
|
|
|
|
|
Re: How to include variable on block's query [message #238903 is a reply to message #238442] |
Sun, 20 May 2007 21:37 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
anna marie
Messages: 26 Registered: June 2006 Location: Philippines
|
Junior Member |
|
|
How to do that? The only available options in Query data source type are None, Table, Procedure, transactional triggers and from clause query. I'am using table.
Flyhard, I already use package for my variable instead of global.
AND eff_dt <= variables.v_eff_dt
..now the error is ora-00904, "variables.v_ef_dt":invalid identifier.
vitas_haiyi, can you give me exactly what you did.
|
|
|
|
Re: How to include variable on block's query [message #240931 is a reply to message #238442] |
Sun, 27 May 2007 21:54 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
anna marie
Messages: 26 Registered: June 2006 Location: Philippines
|
Junior Member |
|
|
it's not working on my side. The problem is on the query data source arguments. the Type Name gives me an error. example, if I specify "pgk.x", it gives me pgk.x must be declared error on query-procedure trigger.
I noticed on your sample that you specify "B_PKG.BONTAB", yet ther's no BONTAB procedure on your package(I downloaded file on your other post).
Can you explain a little more about it?
[edit] - don't bother, I got it, I just forgot the SYNONYM. thanks
[Updated on: Sun, 27 May 2007 22:53] Report message to a moderator
|
|
|
|