generation of XML for each record
I have a table db with a few thousand records in it. I need to generate an xml file for each record so that it can power a search machine.
Can someone help me with this? I could not get it. Here is the example of table.
create table test_xml)
number of U_ID
title varchar2 (500),
VARCHAR2 (500) keywords.
Description varchar2 (500),
VARCHAR2 (500) of the user.
e-mail varchar2 (500),
initiator_function varchar2 (500),
function_impacted varchar2 (500),
old_request_num varchar2 (500),
project_region varchar2 (500)
);
insert into test_xml values (1, "Heading1 test", "blah bla1", "test 123 ', 1234567',' [email protected]', 'test init funct', 'funct hit test', '55556677', 'abc' ');
insert into test_xml values (2, 'Title2 test', 'blah bla2', ' test 1232', 1234522',' [email protected]', 'test init funct2 ',' test power supply impacted2', ' 55556679', 'abcccs' ");
the end result is an XML for each record in this format.
<? XML version = "1.0" encoding = "utf-8"? >
<! DOCTYPE gsafeed PUBLIC "-//Google//DTD GSA RSS / / IN" "" > "".
< gsafeed >
< header >
< datasource > ID 1 < / datasource >
< feedtype > full < / feedtype >
< / header >
<>Group
" < analysis record immediately = 'true' url = ' http://test.com/SearchResult.php?id=1 "action = 'Add' mimetype =" text/html"lock ="true"> "
< content > <! [CDATA]
< html >
< head >
Heading1 test < title > < /title >
< meta name = "Keywords" content = "bla bla1" / >
< name meta = "description" content = "testing 123" / >
< name meta = "user" content = "1234567" / >
" < name meta = 'EMAIL' content = ' [email protected] " />
< name meta = "Source" content = "1" / >
< / head >
< body >
< p > user: 1234567
< p > EMAIL: bob . [email protected]
< p > INITIATOR_FUNCTION: test init funct
< p > FUNCTION_IMPACTED: test hit funct
< p > OLD_REQUEST_NUM: 555566777
< p > PROJECT_REGION: abc
< /p > < / body >
< / html >
[]] > < / content / >
< / recording >
< / Group >
< / gsafeed >
Thanks for any help.
I'd use SQL/XML functions, more rapid way to generate XML from relational data data.
Something like the following should you get.
It displays a document (such as a CLOB) per line in the base table:
with html_content as ( select xmlcdata( xmlserialize(document xmlelement("html" , xmlelement("head" , xmlelement("title", t.title) , xmlelement("meta", xmlattributes('Keywords' as "name", t.keywords as "content")) , xmlelement("meta", xmlattributes('description' as "name", t.description as "content")) , xmlelement("meta", xmlattributes('user' as "name", t.user_ as "content")) , xmlelement("meta", xmlattributes('EMAIL' as "name", t.email as "content")) , xmlelement("meta", xmlattributes('Source' as "name", t.u_id as "content")) -- ?? ) , xmlelement("body" , xmlelement("p", 'EMAIL: '||t.email) , xmlelement("p", 'INITIATOR_FUNCTION: '||t.initiator_function) , xmlelement("p", 'FUNCTION_IMPACTED: '||t.function_impacted) , xmlelement("p", 'OLD_REQUEST_NUM: '||t.old_request_num) , xmlelement("p", 'PROJECT_REGION: '||t.project_region) ) ) indent ) ) as content from test_xml t ) select '' || '' || xmlserialize(document xmlelement("gsafeed" , xmlelement("header" , xmlelement("datasource", 'ID 1') , xmlelement("feedtype", 'full') ) , xmlelement("group" , xmlelement("record" , xmlattributes( 'true' as "crawl-immediately" , 'http://test.com/searchresult.php?ID=1' as "url" , 'add' as "action" , 'text/html' as "mimetype" , 'true' as "lock" ) , xmlelement("content", html.content) ) ) ) indent ) from html_content html ;
NB: indent option is to print only, you can remove it if you don't need.
Tags: Database
Similar Questions
-
Hallo,
I need to create a page that displays the records of a VO, but I would not use a table.
Instead, I would like to display a form for each record to be displayed.
Forms must appear one above the other and each form should have 2 buttons: one to remove the file/form itself and one to add a new file/form.
When you press the button Add a new empty form should be dynamically added to the page (so that the user can fill) and created related record.
When REMOVE button is pressed the form (which contains the operated button) should be disappear and the record shuould be deleted.
Creations and destruction must be applied only if the user clicks a button on CONFIRMATION / COMMIT.
Maybe this http://digilander.libero.it/flattit82/OTN_FILES/MultiFormPage.png picture can help to understand what I want to do.
You kindly help me?
Thank you
Federico
Hi Federico
I was saying that your page layout can be achieved using af: table
See this image:
This provision is af:table (I think same as yours), just add a column in the table and put all the fields in this column then correct layout allows to design as a provision on the form or group layouts
I'm not saying it's the best approach, but you can try this
Thank you
-
Hi all
I have a requirement where I need to get all the records, for each record in double, I need to get a single column with null or 0.
create table a1
(
Identification number,
VARCHAR2 (100), the point
part varchar2 (100));
Insert into a1
values (1, 'ABC', 'A1');
Insert into a1
values (2, 'DEF', 'A2');
TABLE A
PART ITEM ID
1 ABC A1
1 ABC A1
1 ABC A1
DEF 2 A2
DEF 2 A2
3 DEF A2
O/P
PART ITEM ID
1 ABC A1
1 ABC 0
1 ABC 0
DEF 2 A2
2 DEF 0
3 DEF 0
Thanks in advance.
Thanks for your help FrankKalush...
This one will work.
WITH got_r_num AS
(
SELECT NVL (a1.id, a1.id) as id
NVL (a1.item, a1.item) AS element
NVL (a1.part, a1.part) IN the framework
a1.id AS a_id
ROW_NUMBER () OVER (PARTITION BY a1.id
ORDER BY NULL
) AS r_num
BY the a1
)
SELECT id
element
CASE
WHEN a_id IS NOT NULL
AND r_num = 1
THEN part
ELSE ' 0'
END in the framework
OF got_r_num
;
-
Create id, id of the update with the date for each record
Hello
Please give me brief idea or document for this concept:
I need to create id, date, update id, updated for each record inserted or updated in the database (multiple tables).
(1) how the user id can be obtained?
(2) is it better if I use views instead of tables for this?
(3) is it possible for each record?
Please show me the full scenario. a piece of code can also be useful.
Thanks in advance.http://psoug.org/reference/table_trigger.html
Concerning
Biju -
number for each record that is extracted (query)
Hello
I want to what a number for each record that is retrieved from the recording which was released by this query
For example
For the first line/recored
Number generated, ksnumber, date
1, gg111 11/05/05
2, oo235 06/12/05
the query returned 2 records 1 and 2 are the number generated by this code.
In addition if it is built in function, where in the code can I put it?
< cfquery = name "gelov datasource ="kl90">"
SELECT
-------------------------------------------
Of
--------------------------------
WHERE
-----------------------------------------
-----------------------------------------------------
ORDER BY
< cfswitch expression = "#Form.orderBy #" >
< cfks value = "KSNUMBER" >
KS. KS_NBR
< / cfks >
< cfks value = "DATECREATED" >
KS. KREATDAT
< / cfks >
< / cfswitch >
< / cfquery >
<! - report html - >
< cfswitch expression = "#Form.outputFormat #" >
< cfks value = "HTML" >
<! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional / / IN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
"< html xmlns =" http://www.w3.org/1999/xhtml "> "
< head >
< meta http-equiv = "Content-Type" content = text/html"; charset = iso-8859-1 "/ >"
Report Kss Ctwye < title > < / title >
< / head >
< style type = "text/css" >
table {}
do-family: Arial, Helvetica, without serif.
do-size: 10px;
}
TD {}
do-family: Arial, Helvetica, without serif.
do-size: 10px;
}
Th {}
do-family: Arial, Helvetica, without serif.
do-size: 10px;
}
H2 {}
do-family: Arial, Helvetica, without serif.
do-size: 12px;
}
H3 {}
do-family: Arial, Helvetica, without serif.
font-size: 13px;
}
< / style >
< body >
< cfoutput >
< table border = "0" cellpadding = "3" cellspacing = "0" >
< b >
< td align = "center" >
Kss Ctwye report < h3 > < / h3 > < br > < br > < table >
< /tr >
< b >
< td align = "center" >
< / h2 > report returned #getCtwyeKss.RecordCount # entries < / h2 > < table >
< /tr >
< b >
< td >
< table border = "1" cellpadding = "2" cellspacing = "0" >
< b >
< td width = "160" > Ks number < table >
Date of creation of the < td > < table >
<!-< class = 'dataField' td > address < table >
< class td 'dataField' = > Type < table >
< class td 'dataField' = >-> Description < table >
< /tr >
< cfloop query = "getCtwyeKss" >
< tr bgcolor = "< cfif currentrow mod 2 > F8F8FF < cfelse > WHITE < / cfif >" >
< td > #KS_NBR # < table >
< td > #dateformat(KREATDAT,"mm/dd/yyyy") # < table >
< /tr >
< / cfloop >
< /table >
< table >
< /tr >
< /table >
< / BODY >
< / HTML >
< / cfoutput >
< / cfks >
< cfks value = "CSV" >
< NAME CFHEADER = "Content-Disposition" VALUE = "attachment; filename = ctwye.csv">
< cfcontent type = "application/msexcel" > "Ks number", "Date of creation".
< cfoutput query = "getCtwyeKss" > #ltrim (KS_NBR) #, "#dateformat(KREATDAT,"mm/dd/yyyy")" # "< tr #IIF (getCtwyeKss.CurrentRow MOD 2, OF (»), DE('backgroundColor="##999"')) # >"
<!-< tr bgcolor = "< cfif currentrow mod 2 > # 808080 < cfelse > ##ffffff < / cfif >" >-->
< / cfoutput >
< / cfks >
< / cfswitch >
is not a Coldfusion tag. Use instead. The following code prints line numbers
Select ksnumber, date
from yourTable
#currentrow #, #ksnumber #, #date #.
-
My input XML file is...
I get this XML using file adapter...
<? XML version = "1.0" encoding = "UTF-8"? >
-< root xmlns:ns2 = "http://www.w3.org/2001/XMLSchema" >
-< ns2:ReceiptBatch >
< ns2:FileID > "99999" < / ns2:FileID >
< ns2:Warehouse > in THE < / ns2:Warehouse >
'L' < ns2:Revision > < / ns2:Revision >
< ns2:DocID > A4 < / ns2:DocID >
-< ns2:Receipt >
< ns2:DeliveryNo > 123 - OP < / ns2:DeliveryNo >
< ns2:ProcessDate > 112138 < / ns2:ProcessDate >
< ns2:ContainerNo > 98765 < / ns2:ContainerNo >
< ns2:Instructions > TREKAU < / ns2:Instructions >
< ns2:ReceiptType > 1 < / ns2:ReceiptType >
< ns2:SuppCustCode > 111 < / ns2:SuppCustCode >
TREK-Cycle < ns2:SuppCustName > < / ns2:SuppCustName >
-< ns2:ReceiptDetails >
< ns2:Line > 1 < / ns2:Line >
< ns2:ProductCode > 1000 < / ns2:ProductCode >
< ns2:QuantityAdvised > 1 < / ns2:QuantityAdvised >
< ns2:QuantityReceived > 1 < / ns2:QuantityReceived >
< / ns2:ReceiptDetails >
-< ns2:ReceiptDetails >
< ns2:Line > 2 < / ns2:Line >
< ns2:ProductCode > 2000 < / ns2:ProductCode >
< ns2:QuantityAdvised > 2 < / ns2:QuantityAdvised >
< ns2:QuantityReceived > 2 < / ns2:QuantityReceived >
< / ns2:ReceiptDetails >
-< ns2:ReceiptDetails >
< ns2:Line > 3 < / ns2:Line >
< ns2:ProductCode > 2000 < / ns2:ProductCode >
< ns2:QuantityAdvised > 3 < / ns2:QuantityAdvised >
< ns2:QuantityReceived > 3 < / ns2:QuantityReceived >
< / ns2:ReceiptDetails >
< / ns2:Receipt >
< / ns2:ReceiptBatch >
< / root >
There are 2 tables in the database.
Table 1 = T1743512
Table 2 = T2743002
table - structure
T1743512-
DOCO KCOO DTCO LNID LNIX LITM NOTICE USR JOBN UPMJ PID'M CKNU UREC
123 00026 1 1 1000 1 1 123 - OP OP
124 00026 1 1 1000 1 1 124 - OP OP
123 00026 2 2 1000 2 2 123 - OP OP
123 00026 3 3 1000 3 2 123 - OP OP
Things to do are:--
1. Research Notice T1743512 (table) with the following keys:
1.T1743512. CKNU = < DeliveryNo > XML
2.T1743512. LNIX = XML < row >
II. write a record in the T2743002 table for each < RecieptDetails >. (See map below)
Mapping of the records in the table T2743002 to < ReceiptDetails >
EDU - "SABSSV".
EDBT - < EDBT > (the same for all records)
EDTN - < DeliveryNo > (from the section < reception > XML)
EDLN - < row > (from < ReceiptDetails > section in XML format)
EDSP - white
DOCO - white
DCTO - white
KCOO - white
LNID - white
LITM - < ProductCode > < ReceiptDetails > section
UORG - < QuantityAdvised > < ReceiptDetails > section
UREC - < QuantityReceived > < ReceiptDetails > section
USER - "SABSSV".
JOBN - "SOA - 3PL".
PID - 'PO-ENTRANTS ".
UPMJ - current Date Julian
- Hour current HHMMSS
Please suggest the solution.
Published by: Prashant_AP on June 22, 2012 12:24 AMHello
Solution by using a loop in BPEL;
1 count the number of nodes for ReceiptDetails.
2 create a counter for loop through each node ReceiptDetails. Use a while loop in BPEL
3 search T1743512 (table) with DeliveryNo and the line. Make sure that you select the correct line from the ReceiptDetails node element node. This can be done using the counter example of xpatch ns2:ReceiptBatch / ns2:Receipt / ns2:ReceiptDetails [counter] / ns2:Line. Please use the DB adapter.
I guess that the DeliveryNo can only appear once in the document following your example.
4. for each receiptDetails you write a record in table too T2743002. Please use the DB adapter.
5. Since the time increment the counter. This is to ensure that the while loop stops at the point where the counter is greater then the number of nodes to ReceiptDetails.I think a better solution is to make the loop in PL/SQL. It will be faster. You specify an input of type of collection in your pl/sql package parameter. Assign all items receiptDetails and DeliverNo line to the PL/SQL package. Within PL/SQL unravel you the closure. With a little luck, you have the T2743002 in the same schema to create the record too. Otherwise create synonyms of the database or database links.
Good luck
Thank you
Sander
-
Media Center is Reporting insufficient disk space for each record programmed
Since the upgrade to Windows 8 Media Center reports that there is not enough disk space for each scheduled TV recording despite there are currently more than 1 TB of free space. The programs record very well, but it is impossible to tell when it is a genuine issue (for example, a program conflict) as an indicator of each scheduled recording is also problematic.
There is a simple solution to this in Media Center as an administrator (which implies that there may be a problem of permissions with Windows 8). However, I also use an XBox 360 as an Extender and there is no known method to apply this workaround to an Extender then it continues to be a lack of disk space for each unique record.
I tried completely removing the recorded TV folder, followed by a reboot to allow Media Center services recreate the folder, but it does not solve the problem. I checked all the settings and Media Center reports that it has enough free space to save more than 400 hours of television, but he's still complaining lack of disk space for each individual scheduled recording.
Any ideas?
I found a solution that worked for me on another thread.
See the post from Steve Scoltock on executing a recovery job in the computer management application, here:http://answers.Microsoft.com/en-us/Windows/Forum/windows_8-Winapps/Windows-8-TV-recording-problem-with-Windows-Media/f9695954-246F-4C59-8d1b-3729a81feee9?page=1&TM=1352456456164It worked for me. I hope this guy helps too. -
Activate auto sequence number for each records
Hi team,
I try to create a project in DRM for details. So I need a Unique ID (ID project) to create when I enter each record on the lower level. Basically, I need an Auto activated sequence so that whenever I have create a folder I get an Auto-generated number that I can use as a Unique ID. Please advice on how this can be validated in DRM.
Thank you
Roshi
Please go through the below document as a solution step by step to activate AutoID
http://blog.checkpointllc.com/Auto-ID-in-DRM-no-problem
Thank you
~ KKT ~.
-
Several records displayed on the form to a time-2 lines for each record
Hello
I have a Web in which I want to display to 8 records at the time, in the data block, I've specified 8 as value "number of records".
However, the record includes too many fields to display on 1 vertical line, I wish so to divide the fields into two separate lines, there will always be 8 folders, but each in two lines.
How do I do that?
I use form 10g. The block is a block of database using QUERY CLAUSE, and the canvas is stacked.
Thank youSandy,
You will need set the 'Distance between Records' property for each item in the block for multiple registration. This will increase the space between the lines, so you can stack them in two rows. Unfortunately, you cannot set this property to the block - so you must set for each display element.Hope this helps,
Craig B-)If someone useful or appropriate, please mark accordingly.
-
Determine a value for each record for the whole group
< < Sorry I pasted erroneous results earlier > >
Hello
I have a table (in production, join the many tables, but for simplicity, I created a table), which has a few related accounts grouped by ACCT_GRP_ID I have to write a SQL (not a PL/SQL), who should have all columns of this table and an extra column "FLAG". For GA_CD = BBC, FLAG must have a value of 'No Show', if the APP_DT of at least a recording with the group is less than the current year also all the records in the group will have a value of 'Show '. For the record no BBC FLAG must always be 'Show '.
DDLS
{code}
CREATE TABLE ACCOUNTS
(NUMBER OF ACCT_GRP_ID,
GA_CD VARCHAR2 (10),
AGNT_NAME VARCHAR2 (50).
NUMBER OF CASE_NUM
NUMBER OF FUND_AMT
DATE OF APP_DT,
STATUS VARCHAR2 (10));
INSERT INTO ACCOUNT VALUES (1, 'BBC', 'SAMANTHA, JOSE, 12345, 234.33, 2 AUG 2008', ' PLACED');
INSERT INTO ACCOUNT VALUES (1, 'BBC', 'SAMANTHA, JOSE, 12346, 331,13, 24 APR 2009', ' PLACED');
INSERT INTO ACCOUNT VALUES (1, 'BBC', 'SAMANTHA, JOSE, 12347, 201,27, 13 FEB 2009', ' PLACED');
INSERT INTO ACCOUNT VALUES (2, 'BBC', ' MARK, ROSS, 12348, 98.12, 31 MAY 2009', 'PLACE' ");
INSERT INTO ACCOUNT VALUES (2, 'BBC', ' MARK, ROSS, 12349, 121.00, 25 JUNE 2009', 'PLACE' ");
INSERT INTO ACCOUNT VALUES (2, 'BBC', 'BRAND, ROSS, 12350, 11.00, 27 JUNE 2009', 'CLOSED');
INSERT INTO ACCOUNT VALUES (3, 'BBC', "RAJ MALIK", 12351, 89.00, 31 DEC 2008', 'PLACED');
INSERT INTO ACCOUNT VALUES (3, 'BBC', "RAJ MALIK", 12352, 22.00, 26 OCT 2008', 'PLACED');
INSERT INTO ACCOUNT VALUES (4, 'BBC', 'SHANE, WILLS', 12353, 443.00, 7 JUNE 2009', 'PLACE');
INSERT INTO ACCOUNT VALUES (5, 'BBC', 'JANE, WALLACE, 12354, 74.00, 17 JAN 2009', ' PLACED');
INSERT INTO ACCOUNT VALUES (NULL, 'BBC', 'ROSY, BETH', 12355, 124.00, 21 MAR 2009', 'PLACE');
INSERT INTO ACCOUNT VALUES (NULL, 'STAR', 'TINA, WZWICK', 22330, 89.00, 31 DEC 2008', 'PLACED');
INSERT INTO ACCOUNT VALUES (NULL, 'STAR', 'YANA, KORVIN', 27351, 22.00, 26 OCT 2008', 'PLACED');
INSERT INTO ACCOUNT VALUES (NULL, 'STAR', 'SARA, YUI', 22352, 443.00, 7 JUNE 2009', 'PLACE');
INSERT INTO ACCOUNT VALUES (NULL, 'STAR', 'MIKE, TROY, 22453, 74.00, 17 JAN 2009', ' PLACED');
COMMIT;
{code}
Required result:
{code}
APP_DT GA_CD AGNT_NAME STATE BOITE_ FUND_ ACCT_ INDICATOR
AMT NUM GRP_ID
1 SAMANTHA, JOSE PLACE 12347 201.27 BBC 13/02/2009 no show
1 SAMANTHA, JOSE PLACE 12346 331.13 BBC 24/04/2009 no show
1 SAMANTHA, JOSE PLACE 12345 234.33 BBC 08/02/2008 no show
MD2 BBC BRAND, ROSS CLOSED 12350 11 6/27/2009 see the
MD2 BBC BRAND, ROSS PLACED 12349 121 6/25/2009 see the
2 BRAND of BBC, ROSS PLACE 12348 98.12 show of 31/05/2009
3 BBC RAJ MALIK not PLACED 12352 22 10/26/2008 no show
3 BBC RAJ MALIK not PLACED 12351 89 12/31/2008 no show
4 BBC SHANE, WILLS PLACE 12353 443 6/7/2009 see the
5 BBC JANE, WALLACE PLACE 12354 74 1/17/2009 see the
STARS of MIKE, TROY PLACED 22453 74 1/17/2009 see the
See the BBC ROSE, BETH PLACED 12355 124 3/21/2009
STAR SARA, YUI PLACED 22352 443 6/7/2009 see the
TINA, WZWICK STAR PLACED 22330 89 12/31/2008 see the
YANA STAR, KORVIN PLACED 27351 22 10/26/2008 see the
{code}
As in the results Group 1 has a record with the date of 2008 for the whole group getting 'No Show'. Group 2 has all the records this year, so he gets the 'Show '.
Help, please!
Published by: Kuul13 on June 25, 2009 13:31
Published by: Kuul13 on June 25, 2009 13:43
I think I'm really having a BAD BAD day... Sorry again... I don't need the domain TOT_FUND_AMT...Hello
Thanks for posting the DDL and DML statements. This helps a lot.
I don't understand the output, however. Do you want to really two rows of output for each row in the table? The tot_fund_amt is copied from somewhere else? More important still, the results do not include the new flag column. Isn't the point of all of this question? It's good to describe how the indicator is calculated, but you have to show, too.
I think you want analytical MIN function to find the first app_dt in each group, like this:
SELECT a.* , CASE WHEN ga_cd = 'BBC' AND MIN (app_dt) OVER ( PARTITION BY ga_cd , acct_grp_id ) < TRUNC (SYSDATE, 'YYYY') THEN 'No Show' ELSE 'Show' END AS flag FROM accounts a ;
Output:
. ACCT _GRP GA CASE FUND _ID _CD AGNT_NAME _NUM _AMT APP_DT STATUS FLAG ------ ---- --------------- ------ -------- ---------- ------ ------- 1 BBC SAMANTHA, JOSE 12345 234.33 08/02/2008 PLACED No Show 1 BBC SAMANTHA, JOSE 12346 331.13 04/24/2009 PLACED No Show 1 BBC SAMANTHA, JOSE 12347 201.27 02/13/2009 PLACED No Show 2 BBC MARK, ROSS 12348 98.12 05/31/2009 PLACED Show 2 BBC MARK, ROSS 12349 121.00 06/25/2009 PLACED Show 2 BBC MARK, ROSS 12350 11.00 06/27/2009 CLOSED Show 3 BBC RAJ, MALIK 12351 89.00 12/31/2008 PLACED No Show 3 BBC RAJ, MALIK 12352 22.00 10/26/2008 PLACED No Show 4 BBC SHANE, WILLS 12353 443.00 06/07/2009 PLACED Show 5 BBC JANE, WALLACE 12354 74.00 01/17/2009 PLACED Show BBC ROSY, BETH 12355 124.00 03/21/2009 PLACED Show STAR TINA, WZWICK 22330 89.00 12/31/2008 PLACED Show STAR SARA, YUI 22352 443.00 06/07/2009 PLACED Show STAR MIKE, TROY 22453 74.00 01/17/2009 PLACED Show STAR YANA, KORVIN 27351 22.00 10/26/2008 PLACED Show
Note that the NULL acct_grp_id is a group. PARTITION BY acct_grp_id is of course necessary, but we must also, PARTITION BY ga_cd all non-BBC lines will be included in this group. In other words, we are unwilling reported as 'No Show', all ROSY just because TINA or JANA had an early app_dt.
-
Get the Parent for each record in the child
Dear Experts,
I have a table that contains the parent and child information. I need to make a request to get the parents of each book of the child table. I tried to write the query but does not get the expected results. Please help me.
Table: relationship
Parent of the child
102 101
103 102
104 103
106 105
107 106
109 108
110 109
Output:
Expected child
102 101
103 102; 101
104 103, 102, 101
106 105
107 106; 105
109 108
110 109
Thank you very much
Hello
MU * 443499 * TR wrote:
Dear Experts,
I have a table that contains the parent and child information. I need to make a request to get the parents of each book of the child table. I tried to write the query but does not get the expected results. Please help me.
Table: relationship
Parent of the child
102 101
103 102
104 103
106 105
107 106
109 108
110 109
Output:
Expected child
102 101
103 102; 101
104 103, 102, 101
106 105
107 106; 105
109 108
110 109
Thank you very much
Why do you want to
Expected child
----- ---------------
110 109
Instead of
Expected child
----- ---------------
110 109; 108
?
You may want something like this:
CONNECT_BY_ROOT SELECT AS children
SYS_CONNECT_BY_PATH (parent, ';') AS expected_output
FROM table_x
WHERE CONNECT_BY_ISLEAF = 1
CONNECT BY child = parent PRIOR
;
If you would care to post CREATE TABLE and INSERT statements for your sample data, and then I could test this.
-
Audit for each record in a table using PL/SQL
Hello gurus,
I would need your help to find the best approach to address to the below analysis using PL/SQL.
I have a table that contains two columns
Username and months
I want to know the users who made orders each month during the first half of the 2012.That is the user ordered on Jan 2012, Feb2012... and June 2012.
The table is huge and has more than 1 million records. How do I approach this in PL/SQL.
--
JoeYou can use the cursor if you wish...
Try thisdeclare
cursor c1 is
SELECT user name, counting the months (separate months)
From your_table
Months WHERE the ("Jan 2012', ' February 2012', ' March 2012',..., 'June 2012'" ' ")
GROUP BY userid
HAVING COUNT (distinct months) = 6;Start
I'm looping c1insert into insert_table (userid) values (i.userid);
end loop;
end;
/ -
Displaying an icon for each record, based on a condition
Hi people,
I'm developing an application that uses forms 6i with oracle 10g. I have the "Grant" and "Deny" options in my application. I have also two icons is TICK icon and next is WRONG icon.according to the corresponding status icons ("granted" or "Refused") should be displayed for me.for this i have used multi-record block composed of 10 documents. Here is my sample code.
Using this code, I am able to get the visibility of icons, but it affects the entire column. For example, if the first status of cases is "granted" then TICK icon should appear to runtime.similarly if second status of cases is "denied" then ERROR icon should be displayed for me.but for me that the TICK icon is displayed for all 10 records if the State of the first record is "granted". How do the visibled corresponding icons according to status ("Granted" or "Refused"). Kindly give me a solution.IF :STATUS.C_STATUS = 'GRANTED' THEN Set_Item_instance_Property('status.tick',VISIBLE,PROPERTY_TRUE); Set_Item_instance_Property('status.tick',DISPLAYED,PROPERTY_TRUE); Set_Item_Property('status.wrong',VISIBLE,PROPERTY_FALSE); set_item_property('status.wrong',DISPLAYED,PROPERTY_FALSE); .............
Published by: vidusnat on May 2, 2012 12:26Hello
Well, I don't think you can do it by making visible or invisible button/item. I can share an idea to create two image files a given and one for refuse. Multi record block you create an element of the image (non-database) and read the image on this element in the post (at the block level) based on the State values that you so condition...
TRIGGER = POST-QUERY (BLOCK-LEVEL) IF :STATUS.C_STATUS = 'GRANTED' THEN READ_IMAGE_FILE('image_path\access_given.JPG','JPG','BLOCK_NAME.IMAGE_ITEM_NAME'); ELSE READ_IMAGE_FILE('image_path\access_denied.JPG','JPG','BLOCK_NAME.IMAGE_ITEM_NAME'); END IF;
-Clément
-
calculate an average for each record
Hello
what I want is: I have a table
SCHOOLBOY (id, first_name, last_name,...)
and another table
BRANDS (id, schoolboy_id, discipline_id, mark, mark_type). a schoolboy
on a discipline (math, for example), a schoolboy may have more points. I want to calculate the average mark, but for every schoolchild. then, for example I want to generate a report that contains the first name, the family name of the schoolboy and nearby, the average of the marks.
How can I calculate the average of all brands for every schoolchild ?
Thank you!
Edited by: Roger22 06.06.2009 at 01:43Maybe something like:
SELECT first_name, last_name, b1.avg_mark FROM schoolboys a1, ( SELECT schoolboy_id, AVG (mark) avg_mark FROM marks WHERE discipline_id = 4 -- specify whatever discipline_id you want GROUP BY schoolboy_id) b1 WHERE a1.id = b1.schoolboy_id /
Kind regards
JOEdit: Corrected the Code tags
-
View the overlap period for each record.
Hi all
I have a report in which I have 2 columns to date (start date of say "a" and say 'b' end date). In my posts, I chose a time interval. My start date and end date will fall in this interval of time.
Time slot is 05/01/2009 to 03/16/2009
Beginning Date of end 1/5/2009 12/1/2009 1/19/2009 1/26/2009 2/2/2009 2/9/2009 2/16/2009 2/23/2009 3/2/2009 3/9/2009 3/16/2009
19/1/2009 6 / 8 / 2009 0 0 1 1 1 1 1 1 1 1 1
20/4/2009 5/25/2009 0 0 0 0 0 0 0 0 0 0 0
16/3/2009/2009 5 / 18 0 0 0 0 0 0 0 0 0 0 1
19/1/2009 6 / 8 / 2009 0 0 1 1 1 1 1 1 1 1 1
1/5/2009 2009-8-3 1 1 1 1 1 1 1 1 1 0 0
16/3/2009/2009 5 / 18 0 0 0 0 0 0 0 0 0 0 1
As stated above, I need to stamp '0' if the week (horizontal line) does not fall into the time period a - b and '1' if it falls.
How can I achieve this.
Thank you and best regards,Very delicate, but it can be done.
1. create the view that returns all the week start date between guests (if you are on oracle play around with a select againts the object).
2 bring this perspective as a dimension in your SPR and create a join dummy againts your fact table.
3. in your report, use a box when determining if your period is valid or not.
4 put in a PivotTable.
concerning
John
http://obiee101.blogspot.com/
Published by: John Minkjan, June 26, 2009 06:03
Maybe you are looking for
-
want to 4-1112TX: could not set the brightness screen &; long power
Hi, now I use HP ENVY ultrabook TX 4-1112 I installed win 8.1 to win 10 any driver has been installed correctly (there no problem in the Device Manager list) my problems are: -I could not find where I can adjust brightness of the screen, the shortcut
-
How to connect 2 screens on a HPE-210y PC?
How to connect 2 monitors to a HPE-210y PC? I have 2 monitors HP2010i . Behind the PC, there is a VGA - DVI input and an HDMI input. I have connected a monitor to the PC with a VGA - DVI adapter. I saw a VGA input which was covered with a plastic pla
-
TPG error: Windows cannot be installed to this disk
Can't do my valid Bootcamp drive to install W8 after formatting win installation, what is the problem? Also I don't get the option to choose the size of the partition before BC starts the first time... Pro Mac OSX 10.11.3 - Windows 8.1 on DVD
-
This only ever video 1 to 7 I chose stays lit in the upper left corner of the screen, how can I down it to close?
-
Is it possible to substitute the connected mode? I load my rocket using my laptop but must use the radio feature. If anyone has a suggestion, I would be happy.