Query from multiple data blocks
Hello professionals,
I having difficulty in finding solutions to query data from multiple data blocks. By the way I'm using Oracle Forms 10g
I have 4 data blocks and all items are database items
Below are the blocks,
1. student_main (columns : student_id, student_name, student_state)
2. subject_main (columns : subject_id, subject_desc, subject_student_id)
3. invoice_main (columns : invoice_no, invoice_amt, invoice_student_id)
4. receipt_main (columns : receipt_no, receipt_amt, receipt_invoice_ref)
The form will need to allow user to be able to query from any of the items/fields from the data blocks as listed above
For eg,
: if user query student_id then all related value items from table subject_main, invoice_main, receipt_main need to be displayed
: if user query invoice_no then all related value items from table student_main, subject_main, receipt_main need to be displayed
However the tricky part is that some student might have or might not have invoice / receipt data
I tried using relations but it didn't work both ways
I even create relations in every table (student_main to subject_main, subject_main to student_main, invoice_main to student_main, student_main to invoice_main and etc.) but it just make my running process hang
Need help on this matter
Thank you
Edited by: 990092 on Feb 25, 2013 12:15 AM
990092 wrote:
Hello professionals,
I having difficulty in finding solutions to query data from multiple data blocks. By the way I'm using Oracle Forms 10g
I have 4 data blocks and all items are database items
Below are the blocks,
1. student_main (columns : student_id, student_name, student_state)
2. subject_main (columns : subject_id, subject_desc, subject_student_id)
3. invoice_main (columns : invoice_no, invoice_amt, invoice_student_id)
4. receipt_main (columns : receipt_no, receipt_amt, receipt_invoice_ref)
The form will need to allow user to be able to query from any of the items/fields from the data blocks as listed above
For eg,
: if user query student_id then all related value items from table subject_main, invoice_main, receipt_main need to be displayed
: if user query invoice_no then all related value items from table student_main, subject_main, receipt_main need to be displayed
However the tricky part is that some student might have or might not have invoice / receipt data
I tried using relations but it didn't work both ways
I even create relations in every table (student_main to subject_main, subject_main to student_main, invoice_main to student_main, student_main to invoice_main and etc.) but it just make my running process hang
In general, relation will work. your relation creating was wrong, i think.
do as
1. student_main master to subject_main details
2. student_main master to invoice_main details
3. invoice_main master to receipt_main details
Hope this helps
Hamid
Similar Messages
-
Multiple Selection from a data block
Hello,
I have a data block returning the names and surnames of employees. Can I select multiple rows from that data block?
Thank youYou could put a checkbox on the row and if it is ticked then interpret this as a selected row.
Sometimes it is useful to store this type of selection in some type of structure like a record group or index by table and process those rows rather than read the data block -
Query from the data abse and pass values to a pdf form
query from the data abse and pass values to a pdf form
Hello
Hello i have this html report that i have written to output a
report.
now, i am assigned to pass the same fields to a pdf form so
the fields in the adaobe form can be populated or the term
Pre-populate the form.
can anyone help me get started.
first i would like to know if it can be done.
second, what do i need to get started (tools )
third how do i do this.
i am really lost at this point.
can anyone give me tips in how to approach this
subject??It can be one using Adobe Acrobat Designer which is packaged
with Acrobat
Professional Pro 7. It uses all XML to create and populate
forms.
If you had the time, you can also create <cfdocument
type="pdf"> to have
them ready and just pass the info to it so it autogenerates
the PDF on the
fly. -
Dbms_xmlgen.newcontext query from multiple tables and ||
I have two questions
How do I get a dbms_xmlgen.context to query from multiple tables? I have been able to make it work with using one table only, but not with multiple tables.
And how to get the || (concat) to work within my query for my output to an xml file?
Here is my current query:
create or replace function get_xml return clob is
result clob;
qryctx dbms_xmlgen.ctxHandle;
SELECT DBMS_XMLGEN.getxml('select prefix, suffix, fiscal_yr
FROM rcv.recv_accessions ra
where ra.prefix = 8 and ra.fiscal_yr = 11')xml into result FROM dual;
result := DBMS_XMLGEN.getXML(qryCtx);
This is what I desire:
SELECT DBMS_XMLGEN.getxml('select ra.prefix||'-'|| ra.suffix||'-'|| ra.fiscal_yr accession, ss.date_in, st.test
FROM rcv.recv_accessions ra, ser.sero_samples ss, ser.sero_tests st
where ra.prefix = 8 and ra.fiscal_yr = 11 and ss.raid = ra.id and st.ssid = ss.id')xml into result FROM dual;
On this both the reference to multiple tables and the concat function cause errors.
Thank you
Edited by: user583094 on Mar 2, 2011 3:36 PMHi,
for the concat do I use xmlconcat?No, XMLConcat is used to concatenate XMLType fragments.
The || operator will do fine, but you must escape any single quote inside the string :
SELECT DBMS_XMLGEN.getxml(
'SELECT ra.prefix ||''-''|| ra.suffix ||''-''|| ra.fiscal_yr as accession,
ss.date_in,
st.test
FROM rcv.recv_accessions ra,
ser.sero_samples ss,
ser.sero_tests st
WHERE ra.prefix = 8
AND ra.fiscal_yr = 11
AND ss.raid = ra.id
AND st.ssid = ss.id'
INTO result
FROM dual;Or, use the quoting operator to define a custom string delimiter :
SELECT DBMS_XMLGEN.getxml(
q'{SELECT ra.prefix ||'-'|| ra.suffix ||'-'|| ra.fiscal_yr as accession,
ss.date_in,
st.test
FROM rcv.recv_accessions ra,
ser.sero_samples ss,
ser.sero_tests st
WHERE ra.prefix = 8
AND ra.fiscal_yr = 11
AND ss.raid = ra.id
AND st.ssid = ss.id
INTO result
FROM dual;BTW, a good practice would be to use bind variables for the query. DBMS_XMLGEN can handle them nicely :
CREATE OR REPLACE FUNCTION get_xml
RETURN CLOB
IS
qryctx DBMS_XMLGEN.ctxHandle;
v_out CLOB;
qrystr VARCHAR2(4000) :=
'SELECT ra.prefix ||''-''|| ra.suffix ||''-''|| ra.fiscal_yr as accession,
ss.date_in,
st.test
FROM rcv.recv_accessions ra,
ser.sero_samples ss,
ser.sero_tests st
WHERE ra.prefix = :b_prefix
AND ra.fiscal_yr = :b_fiscal_yr
AND ss.raid = ra.id
AND st.ssid = ss.id';
BEGIN
qryctx := DBMS_XMLGEN.newContext(qrystr);
DBMS_XMLGEN.setBindValue(qryctx, 'b_prefix', '8');
DBMS_XMLGEN.setBindValue(qryctx, 'b_fiscal_yr', '11');
-- to generate empty elements if necessary :
DBMS_XMLGEN.setNullHandling(qryctx, DBMS_XMLGEN.EMPTY_TAG);
v_out := DBMS_XMLGEN.getXML(qryctx);
DBMS_XMLGEN.closeContext(qryctx);
RETURN v_out;
END; -
Data Extraction from Multiple data sources into a single Infoprovider
Hi Experts,
Can anyone send me links or examples on how to extract data from multiple data sources into 1 Cube/DSO.
Can anyone send me example scenarios for extracting data from 2 data sources into a single Cube/DSO.
Thanks
KumarHi Ashok,
Check the following link from SAP help. Ths is probably what you are looking for.
[ Multiple data sources into single infoprovider|http://help.sap.com/saphelp_nw70/helpdata/en/e3/e60138fede083de10000009b38f8cf/frameset.htm]
Data from multiple data sources which are logically related and technicall have the same key can be combined into single record.
For example, if you have Sales order item and sales order item status .
These both have the same key - sales order and item and are logically related.
The Sales order item - provides information on Sales order item - material , price, quantity, plant etc.
The item status - povides information on delivery status, billing status, rejection status....
These are two different data sources 2LIS_!1_VAITM ad 2LIS_11_VASTI.
In case you have few master data attributes coming from different systems ie tow data sources in different systems say completely defines your master data. Then you could use a DSO or infoobject to combine the records.
If you want to see aggregated data you use a cube.
ie say you want to analyzae the customer revenue on a particular material and a particular project.
The project details would come from Project syatem and Sales details fom sales flow.
The data is then combined in the DSO with key cutomer and sales area say.
Then it is aggregated at cube level...by not using sales order in the cube model...so all sales order of the same customer would add while loading the cube.. to give direct customer spend values for your sales area at aggregated level.
Hope this helps,
Best regards,
Sunmit. -
Hi Experts
Is it possible to create a query from multiple queries? if yes, how can I do it?
Thanks
HachimHi Hachim EL ALAMI ,
I am giving you some insight to do this but I am not sure whether we can acheive this or not.
Assigning a query to another InfoSet (Enhanced copy functions) -> Maybe this can to some extent give you the idea.
The standard copy functions of transactions SQ01 and SQ02 were extended by report RSAQCOPY.For example, you can copy an InfoSet including all dependent queries or copy a query into another InfoSet.For further information see note 324393. By doing so we can make a fresh query from already existing queries.
General link to SAP Query..
http://help.sap.com/saphelp_nw04/helpdata/en/7f/af0c36932211d194f60000e82de14a/frameset.htm
http://www.saptechies.com/sap-query/
Regards,
Vvieks
Note : This is not the detailed answer for your query -
How to load data into Planning/Essbase from multiple data column
Dear All,
I have a interface file which contains multiple data column as follows.
Year,Department,Account,Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec
FY10,Department1,Account1,1,2,3,4,5,6,7,8,9,10,11,12
FY10,Department2,Account1,1,2,3,4,5,6,7,8,9,10,11,12
FY10,Department3,Account1,1,2,3,4,5,6,7,8,9,10,11,12
I created a data rule to load these interface file.
I want to use ODI to upload this interface. I try to specify the rule name in ODI and run the interface.
But, it came out following errors.
2010-02-22 11:40:25,609 DEBUG [DwgCmdExecutionThread]: Error occured in sending record chunk...Cannot end dataload. Analytic Server Error(1003014): Unknown Member [FY09,032003,910201,99,0,0,0,0,0,0,0,0,0,0,0,0] in Data Load, [1] Records Completed
Any idea to fix the column, I sure the member name is correct as I can load data from data load rule correctly.
ThanksDear John,
I updated the data load rule delimter to "," and found different error message as follows.
'A910201.99','HSP_InputValue','HKDepart','No_WT','032003','NO_Lease','FY09','Actual','Final','Local','0','0','0','0','0','0','0','0','0','0','0','0','Cannot end dataload. Analytic Server Error(1003014): Unknown Member [0] in Data Load, [1] Records Completed'
It seems that the data load rule can recognize the some member except the figures of Jan to Dec..
thanks for your help -
Multiple data blocks on the same canvas
Forms newbie question:
Is it possible to have 2 data blocks with two different sets of transactional triggers (ON-UPDATE, ON-LOCK, etc.) on the same canvas?
I've got an example where i've got two data blocks (one sourced from a view, and one that is a CTL block) on the same canvas. The block sourced from the view is working fine. When I make updates, they are reflected, etc. But, i've got one field in the control block that I need to update from as well, and I can't seem to get it (or any of the CTL block items) to show up as "updateable", regardless of the set_item_property....theyre always grayed out.
Do i need to take the user to a new canvas to be able to utilize the update of the ctl field?A second canvas is not needed. Normally, control-block items are always updateable, so there is something going on in your form to prevent it.
> I can't seem to get it (or any of the CTL block items) to show up as "updateable",
regardless of the set_item_property....theyre always grayed out.
What... Is there code someplace in the form that sets them to Enabled, false? If that is the case, then to get them working again, besides setting Enabled to true, you also must set Updateable and Navigable to Property_True. (This is documented at the end of the on-line help on Set_Item_Property.) -
SELECT query from multiple databases
Hi,
Is it possible to run a SELECT query using multiple DBs' tables, like outer joining them. One of the DBs is Sybase.
Thanks in advanceA TopLink session can span multiple databases if they can be accessed through a single connection. A single select would require the database to handle the aggregation as mentioned in the other post.
Alternatively TopLink's session broker will support making a single session present persistent types from multiple independent databases. This approach will not support a single SELECT spanning the databases though.
Doug -
Retrieving records from a Data Block same as retrieving records from cursor
Dear Gurus,
Is it possible to retrieve records from a datablock same as retrieving records from a cursor,
Eg:
I am having two data blocks in two different tabs, Say B1 in Tab1, B2 in Tab2
B1 is filled with two records, now when I switch to Tab2,
I want all records of B1 in B2, assuming that blocks are having the same structure.
The code I wish to write is,
Goto B1,
Take all the records like a cursor,
Goto B2,
loop
insert
end loop;
Is this possible???I need to show it before saving,
I tried this and it is successful somehow, do not know about any further problems,
I took the record count of both blocks
if :B1.reccount <> :B2.reccount
then
go_block('B1');
first_record;
for i in 1..:B1.reccount
loop
go_block('B1');
go_record(i);
assign values from B1 to variables.
go_block('B2');
assign values from variables to B2
next_record;
end loop;
clear_record;
end if;
This is working, Now I just want to know, if my block is having numerous fields, say more than 100 (may not be a value for large databases)
how can I replace these variables here.
I mean is it possible to declare something like a cursor record type.
For eg : r1 cursor%rowtype -
Does OBIEE has ability to create a single cube from multiple data sources?
Hi all,
Does OBIEE has the ability to create a single cube from multiple sources and does it has the ability to join multiple cubes?
Looking forward to ur reply.Hi
OBIEE can join multiple data sources to make a single data model, but it's not a cube in the multi-dimensional sense like Essbase or Oracle OLAP.
To be able to join datasources together they need to have a common dimension or FK relationship depending on what the source is and what you want to do with it.
Ed -
Report from multiple data sources
Hello All,
I have a requirement to create a report based on the data coming from XML file and needs to be joined with the data from SQL query extract.
I did research on this and found this link helpful: http://blogs.oracle.com/xmlpublisher/2008/07/multiple_datasources_i.html
But our data source will be FILE for xml files and can any one please suggest me the how can i define XML file in a data template.
Please guide.
Thanks.To link more than one universe all of them have to have the same connection.
to solve your issue, i think you need to read more about Business Objects DATA FEDERATOR
which allows you to integrate data and create one virtual data source from different data sources
its really helpfull in your case.
your Option 2 i think is still valid, integrate all the information into BW and create one OLAP universe
good luck
Amr -
Selecting records from multiple dates but specific time
Hi:
I've to select records of multiple dates but the time should be 00:00:00 to 06:00:00 (i.e. 12 AM - 6 AM)
For date part this can be done:
WHERE
START_TIME BETWEEN TO_DATE('04-01-2012', 'MM-DD-YYYY') AND TO_DATE('04-05-2012', 'MM-DD-YYYY')
But how can I fix the time mentioed above.
Please let me know.
Thanks/TanvirWHERE
START_TIME BETWEEN TO_DATE('04-01-2012', 'MM-DD-YYYY') AND TO_DATE('04-05-2012', 'MM-DD-YYYY')
and start_time - trunc(start_time) between 0 and 6/24start_time - trunc(start_time) will give you the fraction of a day. So 6/24 means 06:00.
(When you use to_char(trunc(sysdate,'hh'),'hh24') between 0 and 6 you will also retrieve records with start_time 06:01 for example. So this would not meet your requirements as far as I understood.)
Edited by: hm on 10.04.2012 01:26 -
9i Forms Challenge! Query records from a data block based on this view
According to Oracle Support, it is not unusual that complicated views like the one shown below fail to work in Forms. They recommend that I "try using a When-validate trigger" to solve the problem. I would be grateful if someone could show me how. It would also be helpful if someone could explain why Forms would have a problem querying such a view in the first place.
Thanks very much!
CREATE TABLE t (
id NUMBER,
property VARCHAR2(2),
val NUMBER
INSERT INTO t VALUES ( 1, 'A', 10 );
INSERT INTO t VALUES ( 1, 'B', 11 );
INSERT INTO t VALUES ( 2, 'A', 12 );
INSERT INTO t VALUES ( 2, 'B', 13 );
INSERT INTO t VALUES ( 3, 'A', 14 );
|| This view produces an ORA-01403 no data found error
|| in Oracle Forms 9i.
CREATE OR REPLACE VIEW t_v
AS
SELECT id,
MAX( DECODE( property, 'A', val, NULL ) ) AS a_val,
MAX( DECODE( property, 'B', val, NULL ) ) AS b_val
FROM t
GROUP BY id;Steve,
Your suggestion to put the view definition into the tablename field of the forms properties sheet was fruitful.
Instead of the ORA-01403 error (No data found), I get ORA-24347 (Warning of a NULL column in an aggregate function). This error led me to discover bug 2457121, filed 11-Jul-2002, through Metalink. This bug is reported to only be a problem in Forms 9.0.2.7. It is reported to be fixed in Forms version 9.0.2.12.
Thanks for your interest and help.
- Doug -
Building a session query from multiple queries of same name
I have a SQL query that runs with the name="getcamp" multiple times within a page, then uses a template to display results.
The criteria is different on each run, but the data retrieved is exactly the same.
On another page I need all of the data, so I can loop over it as if it was one query. The idea is to pass the query to the other page in a name="session.getcamp" , so that the data from the query is stored in a session.
The issue I have is that there are the 5 queries with the same name in the first page. Could anybody tell me how I would merge each one into a session query that would have the one name session.getcamp but contain the results of all 5 queries
Thanks
MarkACS LLC wrote:
I have a SQL query that runs with the name="getcamp" multiple times within a page, then uses a template to display results.
The criteria is different on each run, but the data retrieved is exactly the same.
On another page I need all of the data, so I can loop over it as if it was one query. The idea is to pass the query to the other page in a name="session.getcamp" , so that the data from the query is stored in a session.
The issue I have is that there are the 5 queries with the same name in the first page. Could anybody tell me how I would merge each one into a session query that would have the one name session.getcamp but contain the results of all 5 queries
I would suggest the following design:
1) Indeed use the session scope to store the part-queries. However, I would store each of them in the session scope, and union them only where a union is required. You thereby achieve more power and flexibility, as each of the queries will continue to be available to requests throughout the session.
2) I would use the duplicate function to avoid any further reference to the original query. Something like:
First query, name= "getCamp"
<cfset session.getCamp1 = duplicate(getCamp)>
Second query, name= "getCamp"
<cfset session.getCamp2 = duplicate(getCamp)>
etc., etc.
3) On the page where you need to merge the 5 queries:
<cfquery name="getCamp_merged" dbtype="query">
select * from session.getCamp1
union
select * from session.getCamp2
union
select * from session.getCamp3
union
select * from session.getCamp4
union
select * from session.getCamp5
</cfquery>
It's Sunday today, at least where I am. As far as CPU consumption is concerned, whether or not what I've suggested turns out to be the devil's work is up to you to find out.
Maybe you are looking for
-
How do I get rid of the "Loading Next Page" thing?
Recently my Firefox started pre-loading pages. As I scroll to the bottom of a web page I get a notification pop-up at bottom right, saying "Loading next page" ... but all it seems to do is reload the page I'm already on, creating a situation where I
-
[QM] How to create an inspection lot with task list assigned?
Hello, everyone. I know, the similar questions have been asked plenty of times, but I am still unable to find a suitable receipe of the inspection lot creation. My goal is to create an inspection lot programmatically and be able to record its results
-
Connect Mac Pro 1,1 to WiFi
How can I connect to a wireless router on my Mac Pro 1,1.
-
Hi. When you use the brush tool and down in the properties you have the edge slider from 0 to 100. I always use it on 0 and continually have to keep adjusting it everytime i go back to the brush tool. Is there any way it can be set to 0? Steve
-
Most of the videos I have purchased from Itunes have disappeared from the screen and I have no idea how to get them back...help ????