How to return to the first record of a multiple row cursor (Forms 6i)
Hi all,
I had a bit of a search through here, but couldn't quite find the answer I'm after.
I have a multiple row cursor, which I feed into a multi-row block in Forms 6i. I have the following code:
OPEN CURSOR;
LOOP
FETCH CURSOR INTO :FIELD1, :FIELD2, :FIELD3, :FIELD4;
... do other code not related with cursor
EXIT WHEN CURSOR%NOTFOUND;
NEXT_RECORD;
END LOOP;Now, I use the Forms built-in NEXT_RECORD to move down through the records on the form and fill in each row from the db. However, once the block loads (this works correctly), the current item (ie where the typing cursor is left) is on the last record.
Obviously, I need the current item (after loading) to be on the first record. I tried using the Forms built-in FIRST_RECORD after the END LOOP command, but that gives me an ORA-06511 error (An attempt was made to open a cursor that was already open).
Does anyone know how I might be able to return to the first record of the block correctly?
Thanks in Advance,
Chris.
Ok, I feel like a bit of a dolt.
I found that all cursors had to be closed before navigating back to the first record.
Case closed! :)
Similar Messages
-
How to return only the first string
Hi Guys,
I have a mapping where I am creating a filename from data in within my data file, I am using one of my variables i.e. Account
The data looks like this
Account:
123
123
123
456
456
456
789
789
789
What I want is to is return only the first row u201C123" and concatenate it with a constant to make up the filename.
Any help will be appreciated.
Kind Regards,
CJ Bestervery simple
use copy value standard function like below.
Account------->copyvalue(0)----------->
CONCAT------------->TARGET
Constant------->
Regards,
Raj -
How to populate only the first record by default when the page opens?
Dear Members,
I am using OAF R12 and my requirement is as follows:-
When the user opens the custom OAF R12 page, I just want to query the first record from the underlying VO.
For example, If the table has 10 rows, I just want to query the first row as soon as the page opens.
I have written the below code:-
Process Request Method of the CO:-_
am.invokeMethod("initHeaders");
Code in AM_
public void initHeaders()
HeadersVOImpl hVO = getHeadersVO1();
hVO.initQueryHeaders();
Code in VO_
public void initQueryHeaders()
executeQuery();
As it is very clear that with the above code all the records will be queried. I have to add something before the executeQuery() method in the VO to just query the first record.
Can any one please help me by guiding me what I should add before the executeQuery() method in the VO?
Many thanks in advance.
Regards,
R4S.Hello Gyan,
Many thanks for your reply.
The below line in your code is throwing incompatible type error:
OARow row = vo.first();
Can you please help me.
Regards,
R4S -
How do i mark the first record in a alv?
Hi all,
whenever i display a ALV on the screen using "set_table_for_first_display" by default i need to mark the first row of that table i.e. the first row gets selected in it how do i achieve this?
Regards,
Srikanthcall the method set_selected_rows after calling set_table_for_first_display and do it.
You have to pass index 1 to the parameter IT_ROW_NO. -
How do I show the first record as selected on the first load of a Master/Detail html page?
I have been looking for any reference to setting a selectrow onload or defaultrow and it seems all references to answers lead to missing pages or examples.
I have created a master detail page using the insert spry function in DW5. I have had no trouble making it work or changing the css to show a selected column 0 (master) after the first click, but I would like to see the default first row shown as selected.
I am such a javascript noob I need an example if possible.
I followed Greg Rowis's example on AdobeTV "Creating A Progressive Enhancement" but this was not addressed.Thank you for the reply but it was not quite what I needed.
My html div was/is
<div spry:region="ds1" class="MasterContainer">
<div class="MasterColumn" spry:repeat="ds1" spry:setrow="ds1" spry:hover="MasterColumnHover" spry:select="MasterColumnSelected" >{Industry}
</div>
</div>
With the col0 renamed Industry and this works when I click (select) an Industry I get a change in my display to show which row is selected.
See http://dev.workway.com/
What I want is to have About Workway selected on page load. It is the default display but is not shown selected.
Thanks again for your help. -
How do I blank my BI Pub report parameter from returning the first record when output to HTML?
Hi all.
I have a report that has several parameters A, B, C D.
I include these at the head of the rtf report.
I run the report WITHOUT entering anything for parameters A & B.
When the report generates (returning all the expected correct records), it enters into parameter fields A & B at the top of the report the first records’ A & B fields when they should be blank.
IS there something I need to do in the rtf form field Help text along with the field name?
ThanksForLoooking..
Malcwithin the rtf of the report, within the form-field-help-text, this should work..
<?xdofx:decode(<parameter name>,'','',<parameter name>)?>
if the parameter is left blank, then don't put anything in the rtf field, otherwise put in anything that is selected in the parameter.
or this..
<?xdofx:if <parameter name>='' then 'All Params Included' else <parameter name> end if?>
..yet, when the parameter is left blank, the parameter field in the report generated is populated with whatever is in the first line of the parameter in the report.
I also can't find anything in the old rdf that is causing this either. Help! -
Oracle Forms returns the first record in the database when performing query
Once in a while when we query for a record on a form, say by first name Tom, then it returns the first record in the database. Other times it return the Tom's record. It only happens once in a while and if you close the form and reopen it and requery for Tom, then it brings Tom's record.
Does anyone know the issue what could be happening. It just happens every now and then that it's hard to reproduce.
ORacle Forms 10GR2
ORacle Application Server 10.1.3
thanksthen it returns the first record in the databaseI'm not sure if i understand you correctly. Do you mean forms ignores the searc-condition you entered? I would check SYSTEM.LAST_QUERY at the moment this happens to check if the condition gets somehow lost.
-
How to take a value of the first record/occurrence and the last record?
Hi experts
Can anyone help me to tell me:
How to make IP can take a value of the first record/occurrence and the last record in CSV file?
I need to take the first and last to put StarTime of first record y StopTime of last record in the target file
This is my Original CSV File
20110820,220DNE0220,140.13 ,0.000 ,E01,0
20110820,240FGC4280,103.80 ,0.000 ,E01,0
20110821,220DNE0220,142.58 ,0.000 ,E01,0
20110821,240FGC4280,88.70 ,0.000 ,E01,0
20110822,220DNE0220,151.92 ,0.000 ,E01,0
20110822,240FGC4280,91.47 ,0.000 ,E01,0
Where:
The firts field is date.
I require it so my Target File
20110820,20110822,140.13 ,0.000 ,E01,0
20110820,20110822,103.80 ,0.000 ,E01,0
20110820,20110822,142.58 ,0.000 ,E01,0
20110820,20110822,88.70 ,0.000 ,E01,0
20110820,20110822,151.92 ,0.000 ,E01,0
20110820,20110822,91.47 ,0.000 ,E01,0
Thaks..Hi lizcam,
A. Use FCC at sender side, it will convert CSV to XML like this
Input XML
<documentName>
<recordset>
<record>
<Time>20110820</Time>
<ID>220DNE0220</ID>
<Quan>140.13</Quan>
<Volume>0.000</Volume>
<Auc>E01</Auc>
<No>0</No>
</record>
</recordset>
</documentName>
Create a target DT like this
Output XML
<recordset>
<record>
<StartTime>20110820</StartTime>
<EndTime>20110822</EndTime>
<Quan>140.13</Quan>
<Volume>0.000</Volume>
<Auc>E01</Auc>
<No>0</No>
</record>
</recordset>
In MM,
1.Time -> CopyValue[0] -> StartTime
2.Time -> below UDF -> EndTime
3.Quan -> Quan
4.Volume -> Volume
5.Auc -> Auc
6.No -> No
UDF u2013 Execution type u2013 All values of Queue
public void getLastTimeValue(String[] inputEndTime, ResultList result, Container container) throws StreamTransformationException{
result.addValue(inputEndTime[inputEndTime.length-1]);
B. At receiver use again FCC to convert XML to CSV.
FYI. If you want to optimize more, you can use
1.globalContainer concept OR
2.u201CAttributes and Methodsu201D, declare are String. Store the EndTime using one UDF and write another UDF to retrieve it.
Regards,
Raghu_Vamsee -
DB Adapter: Polling For New Records returns the First record multiple Times
I Polling for New or Chnaged Records against DB2 on iSeries. The DB Adapter returns the first record from the Table multiple Times. If the Table has 5 records it displays the first record 5 times. I am using BPEL 10.1.3.1 Can anyone help me with this.
Hi there,
please check out the DBAdapter trouble-shooting guide:
http://download-east.oracle.com/docs/cd/B31017_01/integrate.1013/b28994/app_trblshoot.htm#CIHFEHFA
I am copying an entry from there into here:
A.1.21 Some Queried Rows Appear Twice or Not at All in the Query Result
Problem
When you execute a query, you may get the correct number of rows, but some rows appear multiple times and others do not appear at all.
This behavior is typically because the primary key is configured incorrectly. If the database adapter reads two different rows that it thinks are the same (for example, the same primary key), then it writes both rows into the same instance and the first row's values are overwritten by the second row's values.
Solution
Open Application Sources > TopLink > TopLink Mappings. In the Structure window, double-click PHONES. On the first page, you should see Primary Keys. Make sure that the correct columns are selected to make a unique constraint.
Save and then edit the database partner link.
Click Next to the end, and then click Finish and Close.
Open your toplink_mappings.xml file. For the PHONES descriptor, you should see something like this:
<primary-key-fields>
<field>PHONES.ID1</field>
<field>PHONES.ID2</field>
</primary-key-fields>
Thanks
Steve -
How to select the first record?
Hi,
Could anyone tell me how to select the first record of every
group?
ex, I want to find out every customer their first purcaseDate.
CustomerID PurcaseDate Region
A00000001 2001/01/01 AA
A00000001 2001/02/02 AA
A00000002 2001/03/01 AC
A00000002 2001/05/07 AC
A00000003 2001/03/05 DD
result:
A00000001 2001/01/01 AA
A00000002 2001/03/01 AC
A00000003 2001/03/05 DD
ThanksVincent,
You could do it as Carl suggested, with a couple of
corrections. You would need to include the CustomNo column in
the order by clause of your cursor. You would also need to add
a where clause to your update statement, otherwise everywhere
Region in the table would be updated with the same value of the
last CustomNo in the cursor, regardless of the CustomNo in the
table. See corrected code below:
DECLARE
CURSOR cust
IS
SELECT DISTINCT CustomNo, Region, Purchase_Date
FROM my_table
ORDER BY CustomNo, Purchase_Date, Region;
c_customer VARCHAR2 (9) := '...';
c_region VARCHAR2 (2) := '..';
cntr NUMBER := 0;
BEGIN
FOR x IN cust
LOOP
IF x.CustomNo != c_customer
THEN
c_customer := x.CustomNo;
c_region := x.Region;
ELSE
UPDATE my_table
SET Region = c_region
WHERE CustomNo = c_customer;
cntr := cntr + 1;
IF cntr = 25
THEN
COMMIT;
cntr := 0;
END IF;
END IF;
END LOOP;
COMMIT;
EXCEPTION
WHEN OTHERS THEN
NULL;
END;
Another option is that you could just use one update statement,
like this:
UPDATE my_table a
SET Region =
(SELECT DISTINCT Region
FROM my_table b
WHERE (CustomNo, Purchase_Date) IN
(SELECT CustomNo, MIN (Purchase_Date)
FROM my_table
GROUP BY CustomNo)
AND a.CustomNo = b.CustomNo)
Barbara -
In Pages, when I hit the return button, the first letter on the new line is not capitalises. How do I get it to capitalise automatically?
Right click the Back button and choose the page you want to go to from the list.
'''N.B.''' I noticed that your Flash installation is out of date which exposes your system to attack. See: http://www.adobe.com/support/security/bulletins/apsb11-18.html<br><br>
Update via http://get.adobe.com/flashplayer/ -
Hi,
I want to display PDF's with multiple pages as a slideshow.
This is possible with a default Adobe Reader and have this working for ONE pdf file.
But I want do display multiple PDF's as a slideshow, the one after the other.
In Adobe Reader you can define to return to the first page again or it automatically 'stalls/halts' at the last page.
But I want Adobe Reader to close after the last page is displayed so it continues (in a simple DOS-script) with a second, third, etc. PDF to be displayed.
Is this possible?
What kind of simple DOS-script kan be used or an other reader/utility?
Thanks in advance!
GuntherHi Bernd,
I was looking for ways to script this kind of solution.
But do not have good results. There are tools to combine pdf's into one large pdf - but mostly to be selected by hand.
We need it in a scriptable way to automate.
Additionally, we want to be able to combine different types of documents to rotate as a slide show (so not only PDF's but also pictures or other output).
If you or someone else have such scripts, it will be highly appreciated.
Regards -
Hi ,
How to find out the latest Record in per_all_people_f and per_all_assignments_f
Requirement : Need to find out the latest record in per_all_people_f and per_all_assignments_f to update the attribute column with pre defined value . Its not possible to track only with person_id / assignment_id and effective end date
SELECT pp_id
FROM (SELECT app.person_id pp_id,
asf.*
FROM apps.per_all_people_f app,
apps.per_all_assignments_f asf
WHERE --app.person_id=123568 and
asf.person_id = app.person_id AND
app.effective_end_date = to_date('31-dec-4712') AND
asf.effective_end_date = to_date('31-dec-4712')
GROUP BY app.person_id)
HAVING COUNT(pp_id) > 1
GROUP BY pp_id
This query also returns more than 1 value for person_id .
It would be great if you put comment on this .. Thanks in advance ,
AryaI am getting more records with asf.primary_flag='Y' . If you give ur mail id , i will send the sample data
ASSIGNMENT_ID EFFECTIVE_START_DATE EFFECTIVE_END_DATE BUSINESS_GROUP_ID RECRUITER_ID GRADE_ID POSITION_ID JOB_ID ASSIGNMENT_STATUS_TYPE_ID PAYROLL_ID LOCATION_ID PERSON_REFERRED_BY_ID SUPERVISOR_ID SPECIAL_CEILING_STEP_ID PERSON_ID RECRUITMENT_ACTIVITY_ID SOURCE_ORGANIZATION_ID ORGANIZATION_ID PEOPLE_GROUP_ID SOFT_CODING_KEYFLEX_ID VACANCY_ID PAY_BASIS_ID ASSIGNMENT_SEQUENCE ASSIGNMENT_TYPE PRIMARY_FLAG APPLICATION_ID ASSIGNMENT_NUMBER CHANGE_REASON COMMENT_ID DATE_PROBATION_END DEFAULT_CODE_COMB_ID EMPLOYMENT_CATEGORY FREQUENCY INTERNAL_ADDRESS_LINE MANAGER_FLAG NORMAL_HOURS PERF_REVIEW_PERIOD PERF_REVIEW_PERIOD_FREQUENCY PERIOD_OF_SERVICE_ID PROBATION_PERIOD PROBATION_UNIT SAL_REVIEW_PERIOD SAL_REVIEW_PERIOD_FREQUENCY SET_OF_BOOKS_ID SOURCE_TYPE TIME_NORMAL_FINISH TIME_NORMAL_START BARGAINING_UNIT_CODE LABOUR_UNION_MEMBER_FLAG HOURLY_SALARIED_CODE REQUEST_ID PROGRAM_APPLICATION_ID PROGRAM_ID PROGRAM_UPDATE_DATE ASS_ATTRIBUTE_CATEGORY ASS_ATTRIBUTE1 ASS_ATTRIBUTE2 ASS_ATTRIBUTE3 ASS_ATTRIBUTE4 ASS_ATTRIBUTE5 ASS_ATTRIBUTE6 ASS_ATTRIBUTE7 ASS_ATTRIBUTE8 ASS_ATTRIBUTE9 ASS_ATTRIBUTE10 ASS_ATTRIBUTE11 ASS_ATTRIBUTE12 ASS_ATTRIBUTE13 ASS_ATTRIBUTE14 ASS_ATTRIBUTE15 ASS_ATTRIBUTE16 ASS_ATTRIBUTE17 ASS_ATTRIBUTE18 ASS_ATTRIBUTE19 ASS_ATTRIBUTE20 ASS_ATTRIBUTE21 ASS_ATTRIBUTE22 ASS_ATTRIBUTE23 ASS_ATTRIBUTE24 ASS_ATTRIBUTE25 ASS_ATTRIBUTE26 ASS_ATTRIBUTE27 ASS_ATTRIBUTE28 ASS_ATTRIBUTE29 ASS_ATTRIBUTE30 LAST_UPDATE_DATE LAST_UPDATED_BY LAST_UPDATE_LOGIN CREATED_BY CREATION_DATE TITLE OBJECT_VERSION_NUMBER
931510 7-Nov-08 31-Dec-12 122 (null) (null) (null) 3978 1 (null) 14402 (null) 220150 (null) 734956 (null) (null) 476 (null) (null) (null) (null) 2 E Y (null) 100035417-2 (null) (null) (null) 45948739 (null) (null) (null) (null) (null) (null) (null) 868007 (null) (null) (null) (null) 449 (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null)
797386 26-Aug-08 26-Aug-08 122 (null) (null) (null) 3980 3 (null) 14402 (null) 218925 (null) 734956 (null) (null) 476 (null) (null) (null) (null) 1 E Y (null) 100035417 (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) 740071 (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null)
916076 26-Aug-08 31-Dec-12 122 (null) (null) (null) 3980 1 4 14402 (null) 218925 (null) 734956 (null) (null) 476 (null) (null) (null) (null) 1 B Y (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null)
797386 25-Feb-08 25-Aug-08 122 (null) (null) (null) 3980 1 (null) 14402 (null) 218925 (null) 734956 (null) (null) 476 (null) (null) (null) (null) 1 E Y (null) 100035417 (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) 740071 (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) -
The screen on my macbook has malfunction. When I change the brightness to zero and return to the first level of brightness it works briefly but then the screen starts to flicker brightness and quickly extinguished. It seems to be a bad contact, it would not be normal for a quality product that should have, he has less than two years of use. Not because of the bad use or crash. Someone with the same problem or can help me? It's really a contact problem? I've done all the procedures recommended by the online support. Thanks.
Hey everyone in Apple world!
I figured out how to fix the flashing yellow screen problem that I've been having on my MBP! Yessssss!!!
I found this super handy website with the golden answer: http://support.apple.com/kb/HT1379
I followed the instructions on this page and here's what I did:
Resetting NVRAM / PRAM
Shut down your Mac.
Locate the following keys on the keyboard: Command (⌘), Option, P, and R. You will need to hold these keys down simultaneously in step 4.
Turn on the computer.
Press and hold the Command-Option-P-R keys before the gray screen appears.
Hold the keys down until the computer restarts and you hear the startup sound for the second time.
Release the keys.
I went through the 6 steps above twice, just to make sure I got rid of whatever stuff was holding up my bootup process. Since I did that, my MBP boots up just like normal. No flashing yellow screen anymore!!
(Note that I arrived at this solution when I first saw this page: http://support.apple.com/kb/TS2570?viewlocale=en_US)
Let me know if this works for you!
Elaine -
How to Highlight the CURRENT RECORD in a Table with Report Form
Hi,
I have created a Table with Report Form....let suppose the table is - EMP
Report page - 1
Form page - 2
Now, when I do Create / Update on Page 2,....the control is back on Page1.
Suppose in the Report Page (Page1)..we have 10 records....NOW how should I highlight the CURRENT RECORD in Page 1 with some color to identify the record which I have updated/created just now...
Thanks,
DeepakHi Deepak,
You could do that with a custom report template. I've done that here: [http://apex.oracle.com/pls/otn/f?p=267:175]
Go to Shared Components, Templates and create a new Report template as a copy of your existing one. Then edit your template. In the above example, the Column Template 1 setting was:
<td #ALIGNMENT# headers="#COLUMN_HEADER#" class="t18data">#COLUMN_VALUE#</td>I copied this into the Column Template 2 setting and updated the Column Template 1 setting to:
<td #ALIGNMENT# headers="#COLUMN_HEADER#" class="t18data" style="background-color:red; color:yellow;">#COLUMN_VALUE#</td>I then set the Column Template 1 Condition to: Use Based on PL/SQL Expression
and the Column Template 1 Expression to: '#EMPNO#' = '&P178_EMPNO.'
(In my example, P178_EMPNO is the single item on the linked to page.
Save those changes and go to your report and change its template to the new one. As long as a selection has been made and P178_EMPNO has a value, the condition will make sure that the report uses the first template for the row with the matching EMPNO value. All other rows get the template from Column Template 2.
Andy
Maybe you are looking for
-
How can i create a button with a dynamic picture?
How can i create a button with a dynamic picture using mcLoader.loadClip I did create one with it doesnt seem to be working. It loses all its functions (eg onPress onRelease) Thanks
-
Timed access restriction in jsp
Dear Friends, While working on a website development, I've faced the following problem:- I want to display a Webpage (written in HTML and JSP) in between a particular timing. [e.g. the page will be displayed in between 09:45 AM to 11:30 AM and again
-
AMT VPRO Enrollment Point Certificate Issue
I am having issues provisioning some machines in ConfigMgr 2012 SP1. They get to the point where they say Not Provisioned in the console and detect the version, but they won't provision. I have a cert from GoDaddy with the right hash and have follo
-
Imovie not reading my external drive
Have a bunch of imovie events I dragged from iMac at work to my Lacie 1tb ext drive. Have connected it to my MBP for editing at home. IMovie recognizes the external drive but the events are not showing up under the drive symbol after opening it (arro
-
How do I make embedded OC4J use IBM Db2 schema mapping
I am using JDeveloper 903 with a datasource which happens to be of type IBM DB2. Whenever, I try to deploy and test an entity bean from withinn JDeveloper, the embedded OC4J seems to be using a different database schema mapping scheme than what is re