Update Query in Report
Hi
Is there any option in Oracle Report Builder to execute Query in repeating frame ??
Waiting for suggestions
I'm not sure, but maybe you need a dynamic query.
For dynamic query you can use lexical parameters (see on line help in Reports)
or dynamic ref cursors:
http://www.dulcian.com
FAQs - SQL & PL/SQL FAQs - FAQ ID# 5:
"How can you use 'dynamic' ref cursors in Oracle Reports 3.0 / 6i?"
More dynamic ref cursor examples:
"Dynamic Table in the Second Query with Oracle Reports"
http://www.quest-pipelines.com/pipelines/plsql/tips03.htm#JULY
"Using a Collection Instead of a Temporary Table in Complex Reports"
http://www.quest-pipelines.com/pipelines/plsql/tips03.htm#NOVEMBER
Regards,
Zlatko Sirotic
Similar Messages
-
Update Field On Change For A SQL Query (updateable report)
Hi,
I'd like to request help from anyone with ideas on how to solve this.
We are using APEX 4.2, 10GR2, RedHat5.
I have a report that comes from SQL Query (updateable report).
I'm using the apex_item.text and apex_item.hidden on fields.
I'm using a button to submit and after submit process to add some logic that I need.
There could be 1 - 10 records in the report.
There is only 1 field that is needed to enter a value, but the value of this field determines the value of another field.
I think that I can do this with a submit button and an after submit process where I loop through all the records. I think I have this handled.
This is the question
When the value of that field is changed then the value of another field in the same row changes immediately.
Is this possible?
All the examples I've seen so far are for a single record and that doesn't work for us.
I guess this is a MRU process but I haven't seen an example where a dynamic action is possible on a Multi Row Update.
Could anyone direct me to where I can see an example or help me get directions?
I appreciate all your help an comments and I thank you in advance.Yes why not...what you looking for is a ajax call
See {message:id=10390979}
Please note:-you can also do this as a dynamic action as shown below
Event: Change
Selection type: jQuery Selector
jQuery Selector: input[name="f01"]
True action with Execute JavaScript Code and put all code inside the test funtion, you may need to amend the code to use this.triggeringElemnt in place of this -
SQL Query updateable report with row selector. Update process.
I have a SQL Query updateable report with the row selector(s).
How would I identify the row selector in an update process on the page.
I would like to update certain columns to a value of a select box on the page.
Using the basic:
UPDATE table_name
SET column1=value
WHERE some_column=some_value
I would need to do:
UPDATE table_name
SET column1= :P1_select
WHERE [row selector] = ?
Now sure how to identify the [row selector] and/or validate it is checked.
Thanks,
BobI don't have the apex_application.g_f01(i) referenced in the page source...In the page source you wouldn't find anything by that name
Identify the tabular form's checkbox column in the page(firebug/chrome developer panel makes this easy)
It should be like
<input id="..." value="" type="checkbox" name="fXX" >we are interested in the name attribute , get that number (between 01 and 50)
Replace that number in the code, for instance if it was f05 , the code would use
apex_application.g_f05
--i'th checked record' primary keyWhen you loop through a checkbox array, it only contains the rows which are checked and it is common practice to returns the record's primary key as the value of the checkbox(available as the the i'th array index as apex_application.g_f05(i) , where i is sequence position of the checked row) so that you can identify the record. -
SQL Query (updateable report) Region - Conditionally Hide and Set Values
SQL Query (updateable report) Region - Conditionally Hide and Set Values
Outline of requirement :-
Master / Detail page with Detail updated on same page using SQL Query (updateable report).
The detail region has the following source
SELECT item_id,
contract_id,
CASE WHEN hardware_id IS NOT NULL THEN
'HA'
WHEN backup_dev_id IS NOT NULL THEN
'BD'
WHEN hardware_os_id IS NOT NULL THEN
'HS'
END item_type,
hardware_id,
backup_dev_id,
hardware_os_id
FROM "#OWNER#".support_items
WHERE contract_id = :P26_CONTRACT_IDThe table support_items implements arced relationships and has the following columns
CREATE TABLE SUPPORT_ITEMS
ITEM_ID NUMBER NOT NULL,
CONTRACT_ID NUMBER NOT NULL,
HARDWARE_ID NUMBER,
BACKUP_DEV_ID NUMBER,
HARDWARE_OS_ID NUMBER
)A check type constaint on support_items ensures that only one of the fk's is present.
( hardware_id IS NOT NULL
AND backup_dev_id IS NULL
AND hardware_os_id IS NULL
OR ( hardware_id IS NULL
AND backup_dev_id IS NOT NULL
AND hardware_os_id IS NULL
OR ( hardware_id IS NULL
AND backup_dev_id IS NULL
AND hardware_os_id IS NOT NULL
) Hardware_Id is a FK to Hardware_Assets
Backup_dev_id is a FK to Backup_Devices
Hardware_os_id is a FK to Hardware_op_systems
The Tabular Form Element based on item_type column of SQL query is Displayed As Select List (based on LOV) referencing a named list of values which have the following properties
Display Value Return Value
Hardware Asset HA
Backup Device BD
Computer System HSThe Tabular Form Elements for the report attributes for hardware_id, backup_dev_id and hardware_os_id are all Displayed As Select List (Based on LOV).
What I want to do is only display the Select List for the FK depending on the value of the Select List on Item Type, e.g.
Item_Type is 'HA' then display Select List for hardware_id, do not display and set to NULL the Select Lists for backup_dev_id and hardware_os_id.
Item_Type is 'BB' then display Select List for backup_dev_id, do not display and set to NULL the Select Lists for hardware_id and hardware_os_id.
Item_Type is 'HS' then display Select List for hardware_os_id, do not display and set to NULL the Select Lists backup_dev_id and hardware_id.
There are properties on elements to conditionally display it but how do we reference the values of the SQL query Updateable region? they are not given a page item name?
Also on the Tabular For Elements there is an Edit tick against a report item - however when you go to the Column Attributes there is not a property with which you can control the Edit setting.
What's the best way of implementing this requirement in APEX 3.1?
Thanks.>
Welcome to the forum: please read the FAQ and forum sticky threads (if you haven't done so already), and update your profile with a real handle instead of "user13515136".
When you have a problem you'll get a faster, more effective response by including as much relevant information as possible upfront. This should include:
<li>Full APEX version
<li>Full DB/version/edition/host OS
<li>Web server architecture (EPG, OHS or APEX listener/host OS)
<li>Browser(s) and version(s) used
<li>Theme
<li>Template(s)
<li>Region/item type(s) (making particular distinction as to whether a "report" is a standard report, an interactive report, or in fact an "updateable report" (i.e. a tabular form)
With APEX we're also fortunate to have a great resource in apex.oracle.com where we can reproduce and share problems. Reproducing things there is the best way to troubleshoot most issues, especially those relating to layout and visual formatting. If you expect a detailed answer then it's appropriate for you to take on a significant part of the effort by getting as far as possible with an example of the problem on apex.oracle.com before asking for assistance with specific issues, which we can then see at first hand.
I have a multi-row region that displays values and allows entries in a number of fields.Provide exact details of how this has been implemented. (An example on apex.oracle.com is always a good way to do this.)
I should like the fields to be conditional in that they do not permit entry, but still display, if certain conditions apply (e.g. older rows greyed out). Can this be done? Almost anything can be done, often in multiple ways. Which are appropriate may be dependent on a particular implementation, the skills available to implement it, and the effort you're willing to expend on it. Hence it's necessary to provide full details of what you've done so far... -
SQL Query (updateable report) - Can't figure out how to make one
Hi folks,
Can someone tell me how to make a report where the data can be updated? Not an interactive report, a SQL report that selects only one row. The only options in the drop down I see are "SQL Query" and "SQL Query (PL/SQL function body returning SQL query)", but I have a report elsewhere that says it's type is "SQL Query (updateable report)", but I can't remember how to do it :(
Thanks very much,
-AdamHi Adam,
An Updatable Report is a "Tabular Form" - see: http://download.oracle.com/docs/cd/E10513_01/doc/appdev.310/e10497/frm_tabular.htm#CHDFBHDB
Andy -
Hi,
I want to update the salary to 5000,for all the employees to whom the highest number of people report.
Could any one help me on this.I agree with the solutions above...
But, we dont know how your emp table is structured, I want to make a guess about your table structure and the query you might be looking for:
This is open for discussion though...
CREATE TABLE emp
emp_id NUMBER,
emp_name VARCHAR2 (100),
emp_supv_id NUMBER,
emp_salary NUMBER
INSERT INTO SCOTT.EMP
(EMP_ID, EMP_NAME, EMP_SALARY)
VALUES
(1, 'King', 1000);
INSERT INTO SCOTT.EMP
(EMP_ID, EMP_NAME, EMP_SUPV_ID, EMP_SALARY)
VALUES
(2, 'emp1', 1, 100);
INSERT INTO SCOTT.EMP
(EMP_ID, EMP_NAME, EMP_SUPV_ID, EMP_SALARY)
VALUES
(4, 'emp2', 1, 100);
INSERT INTO SCOTT.EMP
(EMP_ID, EMP_NAME, EMP_SUPV_ID, EMP_SALARY)
VALUES
(5, 'emp3', 1, 100);
INSERT INTO SCOTT.EMP
(EMP_ID, EMP_NAME, EMP_SUPV_ID, EMP_SALARY)
VALUES
(6, 'Minister', 1, 200);
INSERT INTO SCOTT.EMP
(EMP_ID, EMP_NAME, EMP_SUPV_ID, EMP_SALARY)
VALUES
(7, 'Soldier', 6, 10);
INSERT INTO SCOTT.EMP
(EMP_ID, EMP_NAME, EMP_SALARY)
VALUES
(3, 'Queen', 1000);
INSERT INTO SCOTT.EMP
(EMP_ID, EMP_NAME, EMP_SUPV_ID, EMP_SALARY)
VALUES
(8, 'Maid', 3, 10);
INSERT INTO SCOTT.EMP
(EMP_ID, EMP_NAME, EMP_SUPV_ID, EMP_SALARY)
VALUES
(9, 'Maid1', 3, 10);
INSERT INTO SCOTT.EMP
(EMP_ID, EMP_NAME, EMP_SUPV_ID, EMP_SALARY)
VALUES
(10, 'Maid2', 3, 10);
INSERT INTO SCOTT.EMP
(EMP_ID, EMP_NAME, EMP_SUPV_ID, EMP_SALARY)
VALUES
(11, 'Soldier1', 6, 100);
INSERT INTO SCOTT.EMP
(EMP_ID, EMP_NAME, EMP_SUPV_ID, EMP_SALARY)
VALUES
(12, 'Maid3', 3, 10);
COMMIT;input :
emp_id emp_name emp_supv_id emp_salary
1 King 1000
2 emp1 1 100
4 emp2 1 100
5 emp3 1 100
6 Minister 1 200
7 Soldier 6 10
3 Queen 1000
8 Maid 3 10
9 Maid1 3 10
10 Maid2 3 10
11 Soldier1 6 100
12 Maid3 3 10The update query follows...
UPDATE emp
SET emp_salary = 5000
WHERE emp_id IN
(WITH tmp AS
( SELECT LPAD (' ', 2 * (LEVEL - 1)) || emp_id emp_id
FROM emp
START WITH emp_supv_id IS NULL
CONNECT BY PRIOR emp_id = emp_supv_id),
tmp1 AS
(SELECT a.*,
DENSE_RANK ()
OVER (PARTITION BY 1
ORDER BY REGEXP_COUNT (emp_id, ' ') ASC)
rnk
FROM tmp a)
SELECT emp_id
FROM tmp1
WHERE rnk = 1);
commit; output :
emp_id emp_name emp_supv_id emp_salary
1 King 5000
2 emp1 1 100
4 emp2 1 100
5 emp3 1 100
6 Minister 1 200
7 Soldier 6 10
3 Queen 5000
8 Maid 3 10
9 Maid1 3 10
10 Maid2 3 10
11 Soldier1 6 100
12 Maid3 3 10Cheers,
Manik -
Update query in sql taking more time
Hi
I am running an update query which takeing more time any help to run this fast.
update arm538e_tmp t
set t.qtr5 =(select (sum(nvl(m.net_sales_value,0))/1000) from mnthly_sales_actvty m
where m.vndr#=t.vndr#
and m.cust_type_cd=t.cust_type
and m.cust_type_cd<>13
and m.yymm between 201301 and 201303
group by m.vndr#,m.cust_type_cd;
help will be appreciable
thank youThis is the Reports forum. Ask this in the SQL and PL/SQL forum.
-
Using nested IIF expressions in an update query - is it possible?
Hi everyone,
I've been tasked by my manager to build a database which replicates a large, complicated Excel spreadsheet that consumes too much of our team's time and system resources. I've just about got most of it, but there is one particular required field that, in
Excel, requires multi-layered nested If/Then formulae. I have to ask if building something similar in Access is possible. Here is the problem and the logic:
Let us assume two established fields, Field 1 and Field 2; and then one field to be created via Update query, Field 3.
Let us further assume that in Fields 1 and 2, there are three specific alphanumeric sequences occurring (“X1A”, “X1”, and “Z1”) that need to be identified and then called out as either “S1” or “U1” in field 3.
If an Update Query were to be written to populate Field 3 with either “S1” or “U1” depending on one of the three alphanumeric sequences appearing in either Field 1 or Field 2, could it be written as the following expression, using the IIF and OR operators?
And if so, is the syntax of the following expression correct?
IIf([FIELD 1]="* X1A", "U1", OR IIf([FIELD 2]="* X1", "U1", OR IIf([FIELD 2]="* Z1", "U1", OR IIf([FIELD 1]="* X1", "U1", OR IIf([FIELD 1]="* Z1", "U1", "S1")))))
Any help, critiques, or guidance would be appreciated.IMHO, a main consideration when "migrating" from Excel to Access is that a relational database is fundamentally different from a spreadsheet (although there can be much overlap). In Excel, calculated values are "live" (unless you paste the values only
into some other cells). To replicate this "live" quality in Access, you can use a query with a calculation to display (not create or update) Field 3 in your case; Field 3 really wouldn't be a field, just a representation (query, form, report) or snapshot
(export, print). One reason for this is to avoid conflicts and redundancy. In other words, if Field 3 is based solely on Fields 1 & 2 and some rule, then usually there is no need to waste disk space to store Field 3 and you don't risk Field
3 being wrong as in the case when the rule changes.
So here are a couple of options.
1) Create view only query to display Field 3. In query design view, enter the following where you would normally select a field:
[FIELD 3]: IIf([FIELD 1]="* X1A", "U1", IIf([FIELD 2]="* X1", "U1", IIf([FIELD 2]="* Z1", "U1", IIf([FIELD 1]="* X1", "U1", IIf([FIELD 1]="* Z1", "U1", "S1")))))
I assume you literally mean the asterisk character and are not trying to invoke a wildcard for the LIKE operator.
There are other ways of doing this (e.g. with the LIKE operator or multiple queries and UNION), but I leave that up to you to explore.
2) Actually update the value of FIELD 3 in a table. Create two update queries and use your rules as conditions (i.e. the criteria in the bottom of query design).
a) Update query 1 (run first): set [FIELD 3] = "U1" where [FIELD 1] = "* X1A" OR [FIELD 1] = "* X1" OR [FIELD 1] = "* Z1" OR [FIELD 2] = "* X1" OR [FIELD 2] = "* Z1"
b) Update query 2 (run after): set [FIELD 3] = "S1" where [FIELD 3] is null
Again, there are other ways of doing this such as setting the default value of [FIELD 3] in the table to "S1" and just running update query 1.
Good luck. -
This is my update query in oracle but it is giving error:
Update (select NM.Nominal_Amount,NM.Number_of_Units,NM.Current_Spot,NM.Published_Spot,NM.Strike_Price
from note_master NM ,
( select NORM.Note_Master_ID, NORM.Asset, NORM.Currency , 50 as Spot_Price_Calc, NVL(TOADD.NA,0) As NA, NVL(TOADD.NS,0)
As NS, NVL(TOADD.NA_P,0) As NA_P, NVL(TOADD.NS_P,0) As NS_P, NVL(TOADD.SA,0) As SA, (50 * (NORM.Strike_Price_Per/100)) as
rike_Price_Calc, (Case When UPPER(NORM.Misc2) = 'Q' THEN (NORM.No_Of_Shares * 50 * (NORM.Strike_Price_Per/100)) Else
NORM.Nominal_Amount End )as Nominal_Amount_Calc, (Case When UPPER(NORM.Misc2) ='N' THEN (NORM.Nominal_Amount /( 50 * (NORM.Strike_Price_Per/100)))
Else NORM.No_Of_Shares End )as NO_Of_Shares_Calc, (Case When UPPER(NORM.Misc2) = 'Q' THEN (NORM.No_Of_Shares * 50 * (NORM.Strike_Price_Per/100) * NORM.Issue_Price )/100
Else (NORM.Nominal_Amount * NORM.Issue_Price )/100 End )as Settlement_Amt_Calc from ( select Note_Master_Id, MIN(Spot_Price) as Spot_Price, Min(Strike_Price) as
Strike_Price, SUM(Nominal_Amount) as Nominal_Amount, SUM(No_Of_Shares) as No_Of_Shares , MIN(Issue_Price) as Issue_Price, MIN(Asset) as Asset, MIN(Currency) as Currency,
MIN(Strike_Price_Per) as Strike_Price_Per, MIN(Misc2) as Misc2 from ( Select Note_Master_Id, Spot_Price, Strike_Price, Nominal_Amount, No_Of_Shares, Issue_Price, Asset,
Currency , Strike_Price_Per,Misc2 from Sample_ADF_FinIQ_Common.Note_Order_RM Where Order_Status_Flag = 'YYYYYYNNNNNNNNNN' And RO_ID = 'R000000002' ) NORM Group by Note_Master_Id ) NORM
Left Outer JOIN Sample_ADF_FinIQ_Common.RATESSPOTBIDASK RSBA On RSBA.PairCode = (NORM.Asset ) Left Outer JOIN ( select Note_Master_ID,sum(Nominal_Amount)
as NA, sum(No_Of_Shares) as NS, sum(NominalAmt_Pending) as NA_P, sum(NoOfShares_Pending) as NS_P,sum(Settlement_Amt) as SA from Note_Order_RM
Where RO_ID <> 'R000000002' group by Note_Master_ID ) TOADD On TOADD.Note_Master_ID = NORM.Note_Master_ID ) RESULT1 where NM.Note_Master_ID = RESULT1.Note_Master_ID )
set Price_Updated_YN = 'Y' ,
Nominal_Amount = RESULT1.NA + RESULT1.Nominal_Amount_Calc , Number_Of_Units = RESULT1.NS + RESULT1.NO_Of_Shares_Calc ,
Current_Spot = RESULT1.Spot_Price_Calc , Published_Spot = RESULT1.Spot_Price_Calc , Strike_Price = RESULT1.Strike_Price_Calc
where NM.Note_Master_ID = RESULT1.Note_Master_ID;
error :
rror at Command Line:17 Column:105
Error report:
SQL Error: ORA-00904: "RESULT1"."STRIKE_PRICE_CALC": invalid identifier
00904. 00000 - "%s: invalid identifier"
can anybody help.
ThanksStill one more typo problem exists in you sql stament , equal to(=) operator is missing in your original statement look below
original
Where RO_ID 'R000000002' group by Note_Master_ID ) TOADD On TOADD.Note_Master_ID = NORM.Note_Master_ID ) RESULT1 where NM.Note_Master_ID = RESULT1.Note_Master_ID )
set Price_Updated_YN = 'Y'
modified
Where RO_ID='R000000002' group by Note_Master_ID ) TOADD On TOADD.Note_Master_ID = NORM.Note_Master_ID ) RESULT1 where NM.Note_Master_ID = RESULT1.Note_Master_ID )
set Price_Updated_YN = 'Y' Ok, once try with this code, some syntax prob i modified it.
Update (select NM.Nominal_Amount,NM.Number_of_Units,NM.Current_Spot,NM.Published_Spot,NM.Strike_Price
from note_master NM ,
( select NORM.Note_Master_ID, NORM.Asset, NORM.Currency , 50 as Spot_Price_Calc, NVL(TOADD.NA,0) As NA, NVL(TOADD.NS,0)
As NS, NVL(TOADD.NA_P,0) As NA_P, NVL(TOADD.NS_P,0) As NS_P, NVL(TOADD.SA,0) As SA, (50 * (NORM.Strike_Price_Per/100)) as
Strike_Price_Calc, (Case When UPPER(NORM.Misc2) = 'Q' THEN (NORM.No_Of_Shares * 50 * (NORM.Strike_Price_Per/100)) Else
NORM.Nominal_Amount End )as Nominal_Amount_Calc, (Case When UPPER(NORM.Misc2) ='N' THEN (NORM.Nominal_Amount /( 50 * (NORM.Strike_Price_Per/100)))
Else NORM.No_Of_Shares End )as NO_Of_Shares_Calc, (Case When UPPER(NORM.Misc2) = 'Q' THEN (NORM.No_Of_Shares * 50 * (NORM.Strike_Price_Per/100) * NORM.Issue_Price )/100
Else (NORM.Nominal_Amount * NORM.Issue_Price )/100 End )as Settlement_Amt_Calc from ( select Note_Master_Id, MIN(Spot_Price) as Spot_Price, Min(Strike_Price) as
Strike_Price, SUM(Nominal_Amount) as Nominal_Amount, SUM(No_Of_Shares) as No_Of_Shares , MIN(Issue_Price) as Issue_Price, MIN(Asset) as Asset, MIN(Currency) as Currency,
MIN(Strike_Price_Per) as Strike_Price_Per, MIN(Misc2) as Misc2 from ( Select Note_Master_Id, Spot_Price, Strike_Price, Nominal_Amount, No_Of_Shares, Issue_Price, Asset,
Currency , Strike_Price_Per,Misc2 from Sample_ADF_FinIQ_Common.Note_Order_RM Where Order_Status_Flag = 'YYYYYYNNNNNNNNNN' And RO_ID = 'R000000002' ) NORM Group by Note_Master_Id ) NORM
Left Outer JOIN Sample_ADF_FinIQ_Common.RATESSPOTBIDASK RSBA On RSBA.PairCode = (NORM.Asset ) Left Outer JOIN ( select Note_Master_ID,sum(Nominal_Amount)
as NA, sum(No_Of_Shares) as NS, sum(NominalAmt_Pending) as NA_P, sum(NoOfShares_Pending) as NS_P,sum(Settlement_Amt) as SA from Note_Order_RM
Where RO_ID 'R000000002' group by Note_Master_ID ) TOADD On TOADD.Note_Master_ID = NORM.Note_Master_ID ) RESULT1 where NM.Note_Master_ID = RESULT1.Note_Master_ID )
set Price_Updated_YN = 'Y' ,
Nominal_Amount = RESULT1.NA + RESULT1.Nominal_Amount_Calc , Number_Of_Units = RESULT1.NS + RESULT1.NO_Of_Shares_Calc ,
Current_Spot = RESULT1.Spot_Price_Calc , Published_Spot = RESULT1.Spot_Price_Calc , Strike_Price = RESULT1.Strike_Price_Calc
where NM.Note_Master_ID = RESULT1.Note_Master_ID;Edited by: darkStargate on Dec 8, 2011 7:42 PM -
DML(Update) in a report
I have a report, with a query that includes a ROWNUM,
How can I do UPDATE of the table of the query with the printed rownum?
For example, query report is:
SELECT rownum, a.* from mytable a order by ......;
I have to UPDATE one of column, say x of my mytable.
UPDATE mytable Set x = rownum WHERE id_mytable = y;
where (y is column of table mytable printed too)
Thanks in advance for any helpI forgot
I could implement something like
-- start report
--check report progress
LOOP
l_report_status:= report_object_status(l_job_id);
exit when (l_report_status not in('ENQUEUED', 'OPENING_REPORT', 'RUNNING'));
END LOOP;
-- report ended (with/without errors)
IF (l_report_status='FINISHED')
THEN
-- Report run was successful: update database
ELSE
-- Report generation errors
END IF;
but how can i get back rownum printed?
and If it were possible, I would not like to create a TEMP table.
Thanks again -
Hello All
This is my first post here, am hoping some of the more experienced guys/girls can help me. I just started using apex a few weeks ago for a College project.
I am having a problem that has had me stuck for hours now.
I have an interactive report on a page. What i want to do is run an update query that will pass values into another collum for each row everytime the page is opened.
This is the query:
UPDATE confectionary d
SET itemprice_test = (SELECT price_per_item
FROM confectionary c
WHERE d.confect_id = c.confect_id )
I have tried, what feels like every option for this as well as many google searches.
Does anyone have a suggestion that could solve this problem?
Thanksnot sure if i completely understand you..
just my 2 cents..
if you want to run the same update command that you posted..
go to you page..
create a ""onload before header process" --> PL/SQL with the following code.
{code}
begin
UPDATE confectionary d
SET itemprice_test = (SELECT price_per_item
FROM confectionary c
WHERE d.confect_id = c.confect_id )
end;
{code}
For creating ""onload before header process"
1)edit the page
2) create process
3)select PL/SQL
4)select ""point as"" : On load before header
sorry..if i a am wrong.. -
Update query against InfoPath form data
Hi,
We are using SharePoint Enterprise 2010, and have set up a series of InfoPath forms to manage various aspects of the projects we run (request forms, change control, toll gating, status reports, etc). The forms are all created in InfoPath and save the
data to form libraries on SharePoint.
We are in the process of revamping the status report. The fields for Accomplishments, Planned Activities, Risks and Dependencies were origianally set up as plain text. We are moving to a bullted field for each. My concern is that once we
add the new fields to the published form, the old ones will disappear fom view. So if we pull up an older status report, the information wont be available to view.
Is there any way to write an update query against this form data? Supposed I add a new bulleted field for "Accomplishments_NEW" and change the existing field to "Accomplishments_OLD". If I were working with in Access, it would
be a simple update query where the field selected would be "Accomplishments_NEW" and the update value would be "Accomplishments_OLD". I have actually tried this through Access but we only seem to be able to read this data through
Access, not write to it.
Is there any way to make such a change on the SharePoint side?
DennisYes.
The approach is to add two fields:
- Accomplishments_v2 and Accomplishments_v1_Loaded (true/false)
when the form loads, if _v1_Loaded is false, migrate the data from the old field into _v2, and then set _v1_loaded = true
Scott Brickey
MCTS, MCPD, MCITP
www.sbrickey.com
Strategic Data Systems - for all your SharePoint needs -
Possible APEX BUG - Export to CSV from SQL Query (updateable report)
I'm getting a the following sql error - just by enabling the Export to a CSV file from a SQL Query (updateable report) and selecting the export link - anyone have an idea what I could as a workaround?
ORA-06550: line 1, column 45: PLS-00103: Encountered the symbol "1" when expecting one of the following: begin case declare exit for goto if loop mod null pragma raise return select update while with <an identifier> <a double-quoted delimited-identifier> <a bind variable> << close current delete fetch lock insert open rollback savepoint set sql execute commit forall merge pipe
Error ERR-1000 Unable to determine LOV from "declare function x return varchar2 is begin 1 Not Checked;1 Not Checked,2 Review Passed;2 Review Passed,3 Reviewed w/ Issues;3 Reviewed w/ Issues,4 Not Applicable;4 Not Applicable return null; end; begin wwv_flow_utilities.g_query := x; end;".
OK
report error:
ORA-20001: Error fetching column value: ORA-20001: Query must begin with SELECT or WITHFrank,
I received your email with this same question so I'll just respond here. Our internet-facing hosted site apex.oracle.com allows you to request a workspace and, after the request is approved and the workspace provisioned, to develop applications there. If you already have an application that you need some help with, you can import/install it into your workspace on apex.oracle.com. This makes it easy to demonstrate problems to others who might be able to help.
Sometimes it will be necessary for you to create developer accounts in your workspace in order for others to use your Application Builder. You can post usernames/passwords here or you can convey those privately to those offering their services. In either case, you'd want to remove or disable those accounts as soon as the problem is resolved. For problems that I ask to see demonstrated on apex.oracle.com, it is not necessary for you to create an account for me. I can do that as our group runs the site. I just need to know your workspace name and application ID.
Scott -
Query to Report on Parallel Jobs Running
Morning!
I would like to get a query that reports on my parallel jobs.
For each minute that a procedure is running I would like to know what stages are running.
I log the whole procedure in a table called run_details and the start and end of each stage in a table called incident.
I'm running Oracle 9i
Here is some sample data based on 2 threads Expected output at the bottom
SQL>CREATE TABLE run_details
2 (run_details_key NUMBER(10)
3 ,start_time DATE
4 ,end_time DATE
5 ,description VARCHAR2(50)
6 );
SQL>CREATE TABLE incident
2 (run_details_key NUMBER(10)
3 ,stage VARCHAR2(20)
4 ,severity VARCHAR2(20)
5 ,time_stamp DATE
6 );
SQL>INSERT INTO run_details
2 VALUES (1
3 ,TO_DATE('08/10/2007 08:00','DD/MM/YYYY HH24:MI')
4 ,TO_DATE('08/10/2007 08:10','DD/MM/YYYY HH24:MI')
5 ,'Test'
6 );
SQL>INSERT INTO incident
2 VALUES (1
3 ,'Stage1'
4 ,'START'
5 ,TO_DATE('08/10/2007 08:00','DD/MM/YYYY HH24:MI')
6 );
SQL>INSERT INTO incident
2 VALUES (1
3 ,'Stage1'
4 ,'END'
5 ,TO_DATE('08/10/2007 08:08:53','DD/MM/YYYY HH24:MI:SS')
6 );
SQL>INSERT INTO incident
2 VALUES (1
3 ,'Stage2'
4 ,'START'
5 ,TO_DATE('08/10/2007 08:00','DD/MM/YYYY HH24:MI')
6 );
SQL>INSERT INTO incident
2 VALUES (1
3 ,'Stage2'
4 ,'END'
5 ,TO_DATE('08/10/2007 08:04:23','DD/MM/YYYY HH24:MI:SS')
6 );
SQL>INSERT INTO incident
2 VALUES (1
3 ,'Stage3'
4 ,'START'
5 ,TO_DATE('08/10/2007 08:04:24','DD/MM/YYYY HH24:MI:SS')
6 );
SQL>INSERT INTO incident
2 VALUES (1
3 ,'Stage3'
4 ,'END'
5 ,TO_DATE('08/10/2007 08:10','DD/MM/YYYY HH24:MI')
6 );
SQL>select * from incident;
RUN_DETAILS_KEY STAGE SEVERITY TIME_STAMP
1 Stage1 START 08/10/2007 08:00:00
1 Stage1 END 08/10/2007 08:08:53
1 Stage2 START 08/10/2007 08:00:00
1 Stage2 END 08/10/2007 08:04:23
1 Stage3 START 08/10/2007 08:04:24
1 Stage3 END 08/10/2007 08:10:00 So stages 1 and 2 run in parallel from 08:00, then at 08:04:23 stage 2 stops and a second later stage 3 starts.
set some variables
SQL>define start_time = null
SQL>col start_time new_value start_time
SQL>define end_time = null
SQL>col end_time new_value end_time
SQL>
SQL>SELECT start_time-(1/(24*60)) start_time
2 ,end_time
3 FROM run_details
4 WHERE run_details_key = 1;
START_TIME END_TIME
08/10/2007 07:59:00 08/10/2007 08:10:00Get every minute that the process is running for:
SQL>WITH t AS (SELECT TRUNC(TO_DATE('&start_time','dd/mm/yyyy hh24:mi:ss'),'MI') + rownum/24/60 tm
2 FROM dual
3 CONNECT BY ROWNUM <= (TO_DATE('&end_time','dd/mm/yyyy hh24:mi:ss')
4 -TO_DATE('&start_time','dd/mm/yyyy hh24:mi:ss')
5 )*24*60
6 )
7 SELECT tm
8 FROM t;
old 1: WITH t AS (SELECT TRUNC(TO_DATE('&start_time','dd/mm/yyyy hh24:mi:ss'),'MI') + rownum/24/60 tm
new 1: WITH t AS (SELECT TRUNC(TO_DATE('08/10/2007 07:59:00','dd/mm/yyyy hh24:mi:ss'),'MI') + rownum/24/60 tm
old 3: CONNECT BY ROWNUM <= (TO_DATE('&end_time','dd/mm/yyyy hh24:mi:ss')
new 3: CONNECT BY ROWNUM <= (TO_DATE('08/10/2007 08:10:00','dd/mm/yyyy hh24:mi:ss')
old 4: -TO_DATE('&start_time','dd/mm/yyyy hh24:mi:ss')
new 4: -TO_DATE('08/10/2007 07:59:00','dd/mm/yyyy hh24:mi:ss')
TM
08/10/2007 08:00:00
08/10/2007 08:01:00
08/10/2007 08:02:00
08/10/2007 08:03:00
08/10/2007 08:04:00
08/10/2007 08:05:00
08/10/2007 08:06:00
08/10/2007 08:07:00
08/10/2007 08:08:00
08/10/2007 08:09:00
08/10/2007 08:10:00
11 rows selected.Get stage, start & end times and duration
SQL>SELECT ai1.stage
2 ,ai1.time_stamp start_time
3 ,ai2.time_stamp end_time
4 ,SUBSTR(numtodsinterval(ai2.time_stamp-ai1.time_stamp, 'DAY'), 12, 8) duration
5 FROM dw2.incident ai1
6 JOIN dw2.incident ai2
7 ON ai1.run_details_key = ai2.run_details_key
8 AND ai1.stage = ai2.stage
9 WHERE ai1.severity = 'START'
10 AND ai2.severity = 'END'
11 AND ai1.run_details_key = 1
12 ORDER BY ai1.time_stamp
13 /
STAGE START_TIME END_TIME DURATION
Stage1 08/10/2007 08:00:00 08/10/2007 08:08:53 00:08:52
Stage2 08/10/2007 08:00:00 08/10/2007 08:04:23 00:04:22
Stage3 08/10/2007 08:04:24 08/10/2007 08:10:00 00:05:36Then combine both (or do something else) to get this:
TM THREAD_1 THREAD_2
08/10/2007 08:00:00 Stage1 Stage2
08/10/2007 08:01:00 Stage1 Stage2
08/10/2007 08:02:00 Stage1 Stage2
08/10/2007 08:03:00 Stage1 Stage2
08/10/2007 08:04:00 Stage1 Stage2
08/10/2007 08:05:00 Stage1 Stage3
08/10/2007 08:06:00 Stage1 Stage3
08/10/2007 08:07:00 Stage1 Stage3
08/10/2007 08:08:00 Stage1 Stage3
08/10/2007 08:09:00 Stage3
08/10/2007 08:10:00 Stage3Ideally I'd like this to work for n-threads, as I want this to run on different environments that have different numbers of CPUs.
Thank you for your time.> Ideally I'd like this to work for n-threads, as I want this to run on
different environments that have different numbers of CPUs.
The number of CPUs are not always a good indication of the processing load that a platform can take - especially when the processing load involves a lot of I/O.
You can have 99% CPU idle time with a 1000 active processes... as that idle time is in fact CPU time spend waiting on I/O completion. Courtesy of a severely strained I/O channel that is the bottleneck.
Another factor is memory (resources). You for example have 4 CPUs with 8GB physical memory.. where a single process (typically a Java VM for a complex process) grabs a huge amount of memory. Assuming that 4 threads/CPU or 1 threads/CPU can be a severe overestimate due to the amount of memory needed. Getting this wrong leads in turn to excessive virtual memory paging and reduces the platform's performance drastically.
CPU alone is a very poor choice when deciding on the platform's capacity to run parallel processes. -
I was wondering if you could have a cfif statement inside of a update query. See example below. Is there a better way of doing it? thanks.
<cfquery DATASOURCE="xxx" name="update">
UPDATE plant_gen_info
SET levels_complete = #URL.var0#
<cfif IsDefined("URLvar13">
,Q1_answer = #URL.var13#
</cfif>
WHERE ID = #session.member_id#
</cfquery>TheScarecrow,
Yes, dynamic query statements can be assembled using <cfif>. I would suggest you switch your IsDefined() to a StructKeyExists() and strongly suggest you make good use of <cfqueryparam>:
<cfquery DATASOURCE="xxx" name="update">
UPDATE plant_gen_info
SET levels_complete = <cfqueryparam value="#URL.var0#" cfsqltype="****">
<cfif StructKeyExists(URL, "var13")>
,Q1_answer = <cfqueryparam value="#URL.var13#" cfsqltype="****">
</cfif>
WHERE ID = <cfqueryparam value="#session.member_id#" cfsqltype="****">
</cfquery>
I put a "****" placeholder for cfsqltype attributes because I'm not sure which would be appropriate for your variables. See the help docs for more on the cfqueryparam and cfsqltype.
-Carl V.
Maybe you are looking for
-
Point me in the right direction: want to resize image & store in mysql db
I finally accomplished one of my tasks! Which was trying to upload a jpeg image into my mysql database, and then display it in a jsp page via a servlet. I extend my thanks to the java forums greatly:) Now my next task I find is going to be trickier t
-
Using ATT i have no signal at home, what wifi app is best, confused by potential cost
using att i have no service at home, what wifi app works for calls/text, confused by potential cost with "free" apps, international calls are not an issue
-
Error -9812 everytime i try to sync iphone??
so i just restored my mom's iphone and i wanted to put all the files back in but then it said 'cannot complete your itunes store request. an unknown error occurred (-9812)' and i was wondering why it is like this? i have little experience with comput
-
Sync Sound, Easy Answer Come on guys
Wow Can;t Belive I am asking this one, I am syncing sound from a dat recorder to dv captured footage. For the life of me I cannot create independant subclips. Our original capture was not broken down into takes, so we have sub clipped all of the clip
-
Store an Object in Oracle?
Anyone can tell me how to store an java Object data in Oracle table? Thanks, joy