Loop through pages using /M
I have a power query created that connects to a vendor created API.
Note in the underlined/bold portion, the API accepts a page and records per page parameter. In the example below, it is page 0 and 50 records per page. The problem is that I can only run this for one page at a time. If I raise the records
per page number to a high value, like 99999, the request times out. I need to loop or iterate through the pages and combine the results into a single set.
Any feedback is appreciated.
let
Source = Xml.Tables(Web.Contents("https://api.vendorname.com/v1/timecards/modifiedsince/2014-12-31/page/0/50")),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"RecordCount", Int64.Type}, {"PageIndex", Int64.Type}, {"PageSize", Int64.Type}, {"PageCount", Int64.Type}}),
List = #"Changed Type"{0}[List],
Timecard = List{0}[Timecard],
#"Changed Type1" = Table.TransformColumnTypes(Timecard,{{"OriginalId", Int64.Type}, {"Id", Int64.Type}, {"CreatedDate", type datetime}, {"CreatedUserId", Int64.Type}, {"ModifiedDate",
type datetime}, {"ModifiedUserId", Int64.Type}, {"Submit", type logical}, {"SubmitDate", type datetime}, {"Row", Int64.Type}, {"TimecardDate", type datetime}, {"HoursAdjust", Int64.Type}, {"HoursBreak",
Int64.Type}, {"HoursDay", Int64.Type}, {"ApprovedStatus", type text}, {"DateApproved", type datetime}, {"ProcessId", Int64.Type}, {"ProcessDate", type datetime}, {"BillableId", Int64.Type}, {"BillableDate",
type datetime}, {"PayableId", Int64.Type}, {"InvoicedDate", type datetime}, {"BillRateBase", Int64.Type}, {"BillRateMult", Int64.Type}, {"PayRateBase", Int64.Type}, {"PayRateMult", Int64.Type}}),
#"Expand User" = Table.ExpandTableColumn(#"Changed Type1", "User", {"Id", "LoginName"}, {"User.Id", "User.LoginName"})
in
#"Expand User"
Please read
Masson's blog post -His post will guide you through the desired solution.
Similar Messages
-
Help looping through page items
Hello,
I'm new to InDesign scripting and I need a way to programmatically loop through the items on a page of a document and get all of the text frame IDs (Using javascript). Once I find a match of the text frame I am looking for, I will need to update its contents. Is there an easy way to do this?
Thanks in advance!
- LloydHey!
var myTextFrames = app.activeDocument.textFrames;
var myTextFramesNo = myTextFrames.length;
Now myTextFramesNo holds number of text frames in document and myTextFrames holds text frame objects. Now you can run through text frames and set contents for each of them like this:
myTextFrames[0].contents = "My Frame Contents";
That's for start
tomaxxi
http://indisnip.wordpress.com/ -
How to loop through dates using For Loop?
Hi All,
I assume the For Loop is the best way to loop through days in a date range, but I can't figure out how to add a day in the "AssignExpression" box. The following gets the errors "The expression contains unrecognized token 'DAY'",
and "Attempt to parse the expression 'DATEADD(DAY, 1, @CounterPlayer)' failed and returned error code 0xC00470A4."
InitExpression: @CounterPlayer = @DownloadFileDatePlayer
EvalExpression: @CounterPlayer <= @Today
AssignExpression: @CounterPlayer = DATEADD(DAY, 1, @CounterPlayer)
I need to step through days, not through files. What am I doing wrong here? I changed "DAY" to "Day," but that didn't fix it.
Thanks,
EricDOH! It just needed properly placed quotes. Here's the answer:
AssignExpression: @CounterPlayer = DATEADD("DAY", 1, @CounterPlayer) -
Looping through nested datasets
My apologies in advance if this has been asked before, but the search function on these forums doesn't appear to be working at the moment...
Using: Spry 1.6.1
Dreamweaver CS5
IE 7 and 8, Firefox 4, and Chrome 10
The question:
I have a parent xml dataset, with two nested datasets, like this:
var dsCourse = new Spry.Data.XMLDataSet("menu2.xml", "menu");
var dsTopic = new Spry.Data.NestedXMLDataSet(dsCourse, "topic");
var dsLessons = new Spry.Data.NestedXMLDataSet(dsTopic, "lesson");
The data displays properly in the html, using regions, etc. However, when I try looping through them using javascript:
topics = dsTopic.getData();
for (var t = 0; t < topics.length; t++) { //loop through the topics dataset
dsTopic.setCurrentRowNumber(t);
var top = dsTopic.getCurrentRow();
alert('current topic row name: ' + top["@name"]); //for debug purposes, display the topic name
var rows = dsLessons.getData();
for (var i = 0; i < rows.length; i++) { //loop through the lessons dataset
dsLessons.setCurrentRowNumber(i);
alert("lesson name is: " + rows[i]['name']);//display the lesson name
It will perform both loops properly, displaying the correct information for each dataset in Firefox 4, but in IE 7 and 8, and in Chrome it will list each of the Topics correctly, but only displays the first set of lessons.
The xml looks like:
<topic name="Claims" default="true" complete="false">
<lesson>
<name>Getting Started</name>
<score>0</score>
</lesson>
<lesson>
<name>Adding a Claim</name>
<score>0</score>
</lesson>
<lesson>
<name>Adding a Claimant</name>
<score>0</score>
</lesson>
<topic name="Bills" default="false" complete="false">
<lesson>
<name>Bill Components</name>
<score>0</score>
</lesson>
etc.
For what it's worth, all of the topics and lessons display properly in the html using spry regions, etc. It only appears to have an issue in javascript. And then only in IE. Is there, perhaps, a better way to do this that I'm not aware of?
Thanks in advance!
JonathanThis might help http://labs.adobe.com/technologies/spry/samples/data_region/NestedXMLDataSample.html
Gramps -
Loop through checkbox in Oracle APEX 4.2 (using JQuery Mobile)
Hello!
I want question text and a report containing the possible answers is shown on a page. An answer can be selected by clicking on the checkbox. After hitting the submit button, the selected checkboxes containing the Answer Text, an answer_id and the current session_id are to be inserted into a table within the database.
Within Oracle APEX 4.2, I am using a classic report to achieve this. Thich is actually a bad solution, because the checkboxes within the report are shown as simple HTML checkboxes, instead of neat JQueryMobile checkboxes). Anyway, this is my current solution:
Is use this code for creating the classic report:
SELECT APEX_ITEM.CHECKBOX(1,answer_id), answer_id, answer_text
FROM ANSWERS
WHERE question_ID = :P10_Question_ID;
The insert of the data is done via the on submit process "On Submit - After Computations and Validations"
This is the code for the on submit process:
DECLARE var_session_id NUMBER := :P0_SESSION_ID;
BEGIN
FOR i in 1..APEX_APPLICATION.G_F01.COUNT LOOP
INSERT INTO STUDENT_ANSWERS (answer_id, answer_text, session_id)
SELECT a.answer_id, a.answer_text, var_session_id
FROM ANSWERS a WHERE a.answer_id = APEX_APPLICATION.G_F01(i)
END LOOP;
COMMIT;
END;
But this solution does not work. Instead, nothing is inserted into the database.
I don't know why the process is not inserting into the database, maybe there is something wrong with this line here WHERE a.answer_id = APEX_APPLICATION.G_F01(i) ?
I even tried a simple update process for testing purposes, but this doesnt work either:
BEGIN
FOR i in 1..APEX_APPLICATION.G_F01.COUNT LOOP
UPDATE STUDENT_ANSWERS SET text = APEX_APPLICATION.G_F03(APEX_APPLICATION.G_F01(i))
WHERE am_id = APEX_APPLICATION.G_F02(APEX_APPLICATION.G_F01(i));
END LOOP;
COMMIT;
END;
Can anybody tell me how to loop through a checkbox within ORACLE APEX 4.2 and how to insert the values ANSWER_ID, ANSWER_TEXT and SESSION_ID into the table STUDENT_ANSWERS after hitting the submit button? If you would know how to do it without using a report but a simple checkbox, this would be even more helpful for me!I would start by putting this after submit, to check the contents of the array.
apex_debug.message('count:'||apex_application.g_f01.COUNT);
FOR i IN 1..apex_application.g_f01.COUNT LOOP
apex_debug.message('i:'||i||':'||apex_application.g_f01(i));
END LOOP;
Then compare the contents with your answers table. -
Loop through all fields in a (2 page) form?
Is it possible to do it in one go?
suppose you have fields in 2 pages.. (2 subforms)
would you have to write a script that would check for all fields in page 1
and another to check for all fields in subform 2?
or can you just loop through the parent of the 2 subforms?.. (the aim would be to check that all required fields have been filled in or are not equal to their default value)
thank you in advanceYou can certainly write a script that'll find all fields on all pages and perform some action on them.
I've included a sample form which contains two pages with fields on them. At the top of the first page, there's a "Find Fields" button which, when pressed, populates the list box next to it with the names of each field found across all pages. Clicking on an item in the list box will then set focus to that field.
The script uses a recursive function called GetFieldNames in a Script Object called "Utils". In the function, lines 21 - 25 are as follows:
else if (oNode.className == "field")
// oNode is a field
sFieldNames += (sFieldNames.length > 0 ? "\n" : "") + oNode.name;
If you wanted to verify that all mandatory fields were filled, you could change them to this:
else if (oNode.className == "field")
// oNode is a field
if (oNode.mandatory == "error" && (oNode.rawValue == null || oNode.rawValue.length == 0))
sFieldNames += (sFieldNames.length > 0 ? "\n" : "") + oNode.name;
That would find only fields that are required and haven't been filled accross all pages.
Stefan
Adobe Systems -
Insert Loop through a Report or Insert using a Column Link
Hello!
I think I have an easy one.
I have created a site that tracks "issues" with the curriculum of a university's courses. If a curriculum developer sees something that must be updated, they use this site to log the "issue" so we have a running list of how the curriculum has changed for the particular course or courses. Some "issues" span multiple courses, so a table was created to allow the issue to be associated with as many courses as necessary.
The "Courses" table holds a list of all courses at the university
The "Issue_Courses" table combines the primary key for the "issue" and the "course" and creates the association between issues and courses.
The page users use to create the associations has a report called "add_courses" which is searchable and filterable so the user can narrow down the list of courses they want to view (the list is well into the thousands), and this report contains a column with check boxes. This page also contains a hidden field containing the primary key for the issue, "p13_Issue_ID"
I would like to create an insert statement that grabs the primary key for the issue from "p13_issue_ID" and loops through the report, inserting a new record for each checked box in the report. Any assistance would be great! Admittedly, my sql is pretty week.
Another option that I think would work, if possible, would be to have a "column link" that simply runs the insert process by grabbing the issue primary key from "p13_issue_ID" and the course id from the report. Then, the user could simply click on an "Add" link or something similar on the report, which would run the insert statement, and basically create that association. Is this possible?
Thanks in advance!
Edited by: 846852 on Mar 23, 2011 3:12 PM
Edited by: 846852 on Mar 23, 2011 3:14 PMStart with adding a checkbox column to the report in page (13 ??)
select apex_item.checkbox(1,course_id) CHECK
,course_name
FROM courses
I assumed that course_id is the PK of the courses table , if not change the column names appropriately
In report attributes of the "CHECK" column, change the column type to "*Standard Report Column*" (important).
Now you should see a report with courses lists and checkboxes to choose them, You can also do the same with an interactive report(if you want to use it features to filter down records)
Inorder to process the records create a PLSQL process that loops over the selected records(courses) and creates the relation in the Issue courses table using the hidden item and checked course primary key(course_id above)
DECLARE
ln_course_id NUMBER;
BEGIN
FOR 1 IN 1..APEX_APPLICATION.G_f01.COUNT
LOOP
ln_course_id := APEX_APPLICATION.G_f01(i);
--Insert new relation using Issue Id and course ID
INSERT INTO ISSUE_COURSES(course_id,issue_id) VALUES( ln_course_id,:P13_ISSUE_ID);
END LOOP;
END;If you have a submit/save button , make the process conditional for that button. -
How do I Loop through a recordset using PHP
I have a recordset containing a MySql table with 5 columns, each one containing an email address of an official in a club.
Each row represents a different club, and each column a different type of official.
The first column represents chairmen, the next treasurers etc...
The recordset is called $mailset.
I need to loop through each row of $mailset and extract the email addresses of each column and concatenate them into a string seperated by semi colons ; so it ends up like this:
[email protected];[email protected];[email protected]; and so on.
This is how the recordset is set up:
mysql_select_db($database_dummyread, $dummyread);
$query_mailset = "SELECT club_chair_email, club_treas_email, club_sec_email, club_delegate_email, club_deputy_email FROM clubs";
$mailset = mysql_query($query_mailset, $dummyread) or die(mysql_error());
$row_mailset = mysql_fetch_assoc($mailset);
$totalRows_mailset = mysql_num_rows($mailset);
?>
I tried using a loop to step through the recordset, but it always shows the first record, so its not moving the pointer through the file.
The pseudo code aught to be something like this:
Initialise variables and move to the first record
If there are records to process
Read a record
Process all columns
Move on to the next record
else
if there are no records
print an error message
else
Print the results.
Can anyone give me a hint as to how to move from row to row in a recordeset under the control of a loop.
I am using PHP and MySql. (as far as I know, it is the original - not PDO or MySqli)Each call to mysql_fetch_assoc($mailset) retrieves the value at the current location and increments the pointer in the recordset array. So use either a do or while loop and call mysql_fetch_assoc($mailset) from within the loop.
From the docs:
Returns an associative array that corresponds to the fetched row and moves the internal data pointer ahead. mysql_fetch_assoc() is equivalent to calling mysql_fetch_array() with MYSQL_ASSOC for the optional second parameter. It only returns an associative array. -
Loop through Array structure - using xpath
Hello,
My BPEL process logic is as follows:
a. Extract data into variable - receiveMessageInputVariable
The variable 'receiveMessageInputVariable' in turn has data in array structure. (set of items)
b. Transform the data to target structure
c. Call target partner link to store extracted data into varaible 'ServiceInputVariable'
The variable 'ServiceInputVariable' structure is similar to 'receiveMessageInputVariable'
In the BPEL process 'at process' level - I have catch-all exception handler - which must send the list of 'items' which failed during a BPEL instance.
i. If my email body has the following code as below:
<%bpws:getVariableData('receiveMessageInputVariable','XXINV_ITEM_PAY_ROW_TYPE','/ns4:XXINV_ITEM_PAY_ROW_TYPE/ITEMLINE/ITEMLINE_ITEM/ITEM_NUMBER')%>
It successfully fetches only the first item_number record of the array structure. But does not fetch the other records in the array.
ii. Similarly, I wish to print all the items (as received) to be available in the email body in the following pattern:
<%"Record One-"%>
<%bpws:getVariableData('receiveMessageInputVariable','XXINV_ITEM_PAY_ROW_TYPE','/ns4:XXINV_ITEM_PAY_ROW_TYPE/ITEMLINE/ITEMLINE_ITEM[1]/ITEM_NUMBER')%>
<%"<br/>"%>
<%"Record Two-"%>
<%bpws:getVariableData('receiveMessageInputVariable','XXINV_ITEM_PAY_ROW_TYPE','/ns4:XXINV_ITEM_PAY_ROW_TYPE/ITEMLINE/ITEMLINE_ITEM[2]/ITEM_NUMBER')%>
<%"Record Nth-"%>
<%bpws:getVariableData('receiveMessageInputVariable','XXINV_ITEM_PAY_ROW_TYPE','/ns4:XXINV_ITEM_PAY_ROW_TYPE/ITEMLINE/ITEMLINE_ITEM[N]/ITEM_NUMBER')%>
Please suggest a suitable syntax in my email body - which can loop through all itemline_item array and print all the item_numbers.
(pseudo code below)
for i in 1 .. ora:countNodes(bpws:getVariableData('receiveMessageInputVariable','XXINV_ITEM_PAY_ROW_TYPE','/ns4:XXINV_ITEM_PAY_ROW_TYPE/ITEMLINE/ITEMLINE_ITEM/ITEM_NUMBER'))
loop
<%"Item Number-"%><%bpws:getVariableData('i')%>
<%bpws:getVariableData('receiveMessageInputVariable','XXINV_ITEM_PAY_ROW_TYPE','/ns4:XXINV_ITEM_PAY_ROW_TYPE/ITEMLINE/ITEMLINE_ITEM/ITEM_NUMBER')%>
end loop;
Thanks,
SanthoshHi Santhosh
Try with the following approach. It may work for you
1. Create one XSD, for the HTML content
<xsd:element name="HTML">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="C1" type="xsd:string" nxsd:style="terminated" nxsd:terminatedBy="${eol}">
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
2. Create one XSL, may be you have to do this manually, as JDev will not support HTML transformations. This XSL will map your input XML to an HTML format.
3. Create one variable in BPEL of type in the above XSD
4. Use assign activity to assign the XSL transformation to the variable defined in Step#3
<from expression="ora:processXSLT('HTMLTransformation.xsl',bpws:getVariableData('Variable_Input',INPUT_TYPE'))"/>
<to variable="invokeWriteHTMLService_Input" part="HTML" query="/ns6:HTML/ns6:C1"/>
5. Copy the variable to the email body variable
<copy>
<from expression="bpws:getVariableData('invokeWriteHTMLService_Input','HTML','/ns6:HTML/ns6:C1')"/>
<to variable="varNotificationReq" part="EmailPayload"
query="/EmailPayload/ns8:Content/ns8:ContentBody"/>
</copy>
Basically, the above approach converts your input to a string value whose content is a complete HTML, and you will use only one value to assign to the email body.
Note: Please change the Variable names/XPATH Expressions/XSL file name/element names etc according to your BPEL
Hope this helps you
Regards
Ayon -
Loop through user text fields on a page
I am new to APEX and I have searched for an answer to this problem, but was not able to find one.
I have a page which has about 40 text boxes for user input. I would like to find a way to loop through all of the text boxes on the page when the user submits the form. I want to check the contents of each text box and filter out any characters that are not alpha or numeric. I would like to do this in one process. Is this possible? If so, how would I access the text boxes and remove the unwanted input? Could you please show me an example?
Thanks for any guidance on this.Hi,
I did not test this, but could something like after submit process work
DECLARE
l_temp VARCHAR2(32000);
BEGIN
FOR C IN
(SELECT item_name
FROM apex_application_page_items
WHERE display_as = 'Text Field'
AND application_id = :APP_ID
AND page_id = :APP_PAGE_ID
LOOP
-- Do stuff e.g. remove character Ö
l_temp := REPLACE(v(c.item_name),'Ö');
APEX_UTIL.SET_SESSION_STATE (
p_name => c.item_name,
p_value => l_temp
END LOOP;
END;Br,Jari
Edited by: jarola on Mar 4, 2010 5:26 PM -
Loop through elements within nested:iterate tag using javascript
Hello,
I would like to loop through the adjustedLineItems list and set the checkbox values to true on click of a select all button.
I am getting the error document.all['adjustedLineItems.selected'] is null or not an object
however it works if I manually substitute values for i within the function
document.all['adjustedLineItems[0].selected'].checked=true;
document.all['adjustedLineItems[1].selected'].checked=true;
document.all['adjustedLineItems[2].selected'].checked=true;
Could someone please help me do this via a for loop?
Thanks
<nested:iterate name="invoiceForm" property="adjustedLineItems" id="adjli" type="com.bt.lex.common.lineItem.beans.LineItemDetailBean" indexId="idxadjli">
<tr>
<td class="dataLeft"><nested:checkbox property="selected"/></td>
<td class="dataLeft"><nested:write property="liNumber"/></td>
</tr>
</nested:iterate>
<script type="text/javascript">
function onclick_all(ctl) {
var checkFlag = "false";
var count = document.all.numOfAdjustedLIs.value;
var i = 0;
//alert(count);
if(ctl.checked)
if(checkFlag=="false")
for (i = 0; i <count; i++)
document.all['adjustedLineItems[i].selected'].checked=true;
checkFlag = "true";
</script>Its got nothing to do with nested iterate tags :). However,
document.all['adjustedLineItems.selected'].checked=true;
The variable 'i' is not getting evaluated as is evident from the error message - document.all['adjustedLineItems.selected'].
The appearance of 'i' in the error message tells it all, right ? :)
So
document.all['adjustedLineItems[' + i + '].selected'].checked=true;should do the trick.
ram. -
SSIS - Loop through files from a file path based on the value in the variable
Experts,
I have a requirement where I'll be loading multiple files in to a SQL server table and archive the files when loaded. However, the challenge is , the file path should be dynamic based on the value of a variable (say, @ProductName).
For example: If I am running the package for variable @ProductName="Product", the file path would be "\\....\Src\Product", in that case the ForEachLoop will loop through all the files in that folder, load them to the table and Archive
the files to the "\\....\Src\Product\Archive" folder.
Similarly, if the @ProductName="Product_NCP", the foreachloop container should loop through files in the "\\....\Src\Product_NCP" folder, load them to the table and archive them to the ""\\....\Src\Product_NCP\Archive"
folder.
Any suggestions? I should be able to run the package manually just by passing the "@Product" value, create Archive folder if it doesn't exist, load the data and archive the files.Yes
1. Have a variable inside SSIS to get folder path. Set path based on your rule using an expression
like
(@[User::ProductName] == "Product" ? "\\....\Src\Product" : (@[User::ProductName] == "Product_NCP" ? \\....\Src\Product_NCP:..))
similary archive
(@[User::ProductName] == "Product" ? "\\....\Src\Product\Archive" : (@[User::ProductName] == "Product_NCP" ? "\\....\Src\Product_NCP\Archive" :..))
Please Mark This As Answer if it solved your issue
Please Vote This As Helpful if it helps to solve your issue
Visakh
My Wiki User Page
My MSDN Page
My Personal Blog
My Facebook Page -
Add a for each script to loop through HTTPService?
I'm using Flash Builder 4 with the Flex 4.1 SDK. I want to add a "for each" script to loop through my HTTPService XML file so only each nepName displays only once in my dropdown list. In my XML file I have multiple records associated with nepName. I would like ALL the records associated with each nepName to populate in my datagrid when it is selected from the dropdown. Currently in my dropdown there is a nepName entry for each XML tag. I hope I was able to explain that well enough. I'll try to put my code below so you can see everything I'm working with.
MXML:
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:esri="http://www.esri.com/2008/ags"
xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600"
creationComplete="nepInfo.send()">
<s:layout>
<s:VerticalLayout horizontalAlign="center" paddingTop="25"/>
</s:layout>
<fx:Declarations>
<s:HTTPService id="nepInfo" url="http://www.epa.gov/owow/estuaries/nep_info.xml"/>
<!--s:RadioButtonGroup id="optiongroup"/-->
</fx:Declarations>
<s:Panel title="NEP Project Information">
<s:layout>
<s:VerticalLayout/>
</s:layout>
<s:HGroup verticalAlign="middle">
<mx:Form x="188" y="34" width="338">
<mx:FormItem label="Search for NEP Information:">
<s:DropDownList enabled="true" id="dropDownList" prompt="Select NEP" dataProvider="{nepInfo.lastResult.records.record}" labelField="nepName">
</s:DropDownList>
</mx:FormItem>
</mx:Form>
</s:HGroup>
<mx:DataGrid id="resultsGrid"
dataProvider="{dropDownList.selectedItem}"
visible="{dropDownList.selectedItem != null}" x="20" y="62" width="1166" height="620">
<mx:columns>
<mx:DataGridColumn dataField="projectName" headerText="Project Name" wordWrap="true"/>
<mx:DataGridColumn dataField="projectDescription" headerText="Project Description" wordWrap="true"/>
<mx:DataGridColumn dataField="acres" headerText="Acres" wordWrap="true"/>
<mx:DataGridColumn dataField="habitatDescription" headerText="Habitat Description" wordWrap="true"/>
<mx:DataGridColumn dataField="neportCategory" headerText="Habitat Category" wordWrap="true"/>
<mx:DataGridColumn dataField="restorationType" headerText="Restoration Type" wordWrap="true"/>
<mx:DataGridColumn dataField="leadPartner" headerText="Lead Partner" wordWrap="true"/>
</mx:columns>
</mx:DataGrid>
</s:Panel>
</s:Application>
XML: http://www.epa.gov/owow/estuaries/nep_info.xml
Thank you in advance for your help!
-Alison($file, pwd);Assuming "pwd" is meant as the current directory, here a small example :
TEST@db102 SQL> create or replace procedure test_proc (p1 varchar2, p2 varchar2)
2 is
3 begin
4 dbms_output.put_line (p1||' '||p2);
5 end;
TEST@db102 SQL> /
Procedure created.
TEST@db102 SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
$ ls -l /tmp/test/*.sql
-rw-r--r-- 1 ora102 dba 69 Apr 18 23:23 /tmp/test/file1.sql
-rw-r--r-- 1 ora102 dba 112 Apr 18 23:23 /tmp/test/file2.sql
-rw-r--r-- 1 ora102 dba 120 Apr 18 23:23 /tmp/test/file3.sql
$ cat test_proc.sh
DIR=/tmp/test
cd $DIR
ls *.sql | while read file
do
echo "Processing file $file"
sqlplus -s test/test << EOF
set feed off
set pages 0
set serveroutput on
exec test_proc('$file', '`pwd`');
exit
EOF
done
$ ./test_proc.sh
Processing file file1.sql
file1.sql /tmp/test
Processing file file2.sql
file2.sql /tmp/test
Processing file file3.sql
file3.sql /tmp/test
$ -
How Do I get SSIS To Stop Looping Through Excel Rows After Last Populated Record?
I have a package that loops through many excel files. Each Excel File has about 5000 rows. My problem is that after the 5000th row SSIS keeps looping through all the rows after the last row. There are nothing in these rows. This is a complete bottleneck
of my package because it takes forever when doing this. How do I stop this?
ThanksAnother way is to specify the range in select statement which can be done in two ways
http://getsetsql.blogspot.in/2012/01/using-ssis-load-data-to-excel-sheet-at.html
http://sqlserversolutions.blogspot.in/2009/02/selecting-excel-range-in-ssis.html
Please Mark This As Answer if it solved your issue
Please Vote This As Helpful if it helps to solve your issue
Visakh
My Wiki User Page
My MSDN Page
My Personal Blog
My Facebook Page -
TOP of PAGE using ABAP oo with single CUSTOM CONTROL
Can anybody please tell me how to handle TOP_OF_PAGE using ABAP OBJECTS with a SINGLE CUSTOM CONTROL and not with SPLIT CONTAINER(i.e. using single CL_GUI_CUSTOM_CONTAINER and single grid CL_GUI_ALV_GRID ). Is it possible if so Please help me out?
Hi Ravi,
Here is my code. i didn't handle the top_of_page event yet but created a method to handle.
REPORT ZSATEESH_ALV_CONTAINER MESSAGE-ID ZZ
LINE-SIZE 150 NO STANDARD PAGE HEADING.
PROGRAM id : ZSATEESH_ALV_CONTAINER *
Title : Sales document report *
Author : Sateesh *
Date : *
CR# : *
Dev Initiative :
Description :ALV GRID/LIST Report which displays the sales
document header data using ABAP Objects.
Modification Log
Corr. no date programmer description
TYPES Declaration
*--Type for the Header Sales data
TYPES: BEGIN OF TY_VBAK ,
INDICAT LIKE ICON-ID, " Icon
VBELN LIKE VBAK-VBELN, " Sales Document
AUDAT LIKE VBAK-AUDAT, " Document date
VBTYP LIKE VBAK-VBTYP, " SD document category
AUART LIKE VBAK-AUART, " Sales Document Type
AUGRU LIKE VBAK-AUGRU, " Order reason
NETWR LIKE VBAK-NETWR, " Net Value
WAERK LIKE VBAK-WAERK, " SD document currency
END OF TY_VBAK.
DATA Declaration
*--Tableto hold the header sales data
DATA: TB_VBAK TYPE STANDARD TABLE OF TY_VBAK.
*--Table to hold the Icons
DATA: BEGIN OF TB_ICON OCCURS 0,
ID TYPE ICON-ID, " Icon
NAME TYPE ICON-NAME, " Name of an Icon
END OF TB_ICON.
*--Declaration of ALV Grid Tables
DATA: TB_FDCAT TYPE LVC_T_FCAT, " Fieldcatalog
TB_SORT TYPE LVC_T_SORT. " Sorting
DATA: OK_CODE LIKE SY-UCOMM. " sy-ucomm
*--Reference variables for container and grid control.
DATA: CUSTOM_CONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER,
" Container reference
OBJ_ALV_GRID TYPE REF TO CL_GUI_ALV_GRID.
" Alv Grid reference
S T R U C T U R E S
DATA: X_FDCAT TYPE LVC_S_FCAT, " Fieldcatalog
X_LAYOUT TYPE LVC_S_LAYO, " layout
X_SORT TYPE LVC_S_SORT, " Sorting
X_VBAK TYPE TY_VBAK, " sales header stucture
X_ICON LIKE TB_ICON. " icons structure
C O N S T A N T S
*--Declaration of Constants
CONSTANTS :
C_GREEN(40) TYPE C VALUE 'ICON_GREEN_LIGHT',
C_RED(40) TYPE C VALUE 'ICON_RED_LIGHT',
C_YELLOW(40) TYPE C VALUE 'ICON_YELLOW_LIGHT',
C_X TYPE C VALUE 'X'. " Flag
SELECTION SCREEN
*--Block 1.
SELECTION-SCREEN : BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
PARAMETER: P_AUDAT LIKE VBAK-AUDAT
DEFAULT '20050101'(003). " doc date.
SELECTION-SCREEN: END OF BLOCK B1.
*--bLOCK 2.
SELECTION-SCREEN : BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-002.
PARAMETER :P_ALVDIS AS CHECKBOX. " For List/Grid
SELECTION-SCREEN : END OF BLOCK B2.
Class LC_VBAK definition
CLASS LC_VBAK DEFINITION.
PUBLIC SECTION.
METHODS: VBAK_POPULATE, " sales header population
ICON_POPULATE, " Icons population
FINAL_POPULATE, " Final ALV population
DISPLAY, " Displaying ALV
TOP_OF_PAGE FOR EVENT TOP_OF_PAGE OF CL_GUI_ALV_GRID
IMPORTING E_DYNDOC_ID.
ENDCLASS. "LC_VBAK DEFINITION
Class LC_VBAK IMPLEMENTATION
CLASS LC_VBAK IMPLEMENTATION.
METHOD VBAK_POPULATE.
*-- selecting from VBAK
SELECT VBELN
AUDAT
VBTYP
AUART
AUGRU
NETWR
WAERK
INTO CORRESPONDING FIELDS OF TABLE TB_VBAK
FROM VBAK
WHERE AUDAT > P_AUDAT AND
NETWR > 0.
IF SY-SUBRC <> 0.
SORT TB_VBAK BY AUART VBTYP WAERK .
ENDIF.
ENDMETHOD . "VBAK_POPULATE
METHOD ICON_POPULATE.
*--selecting from ICON table
SELECT ID
NAME
INTO TABLE TB_ICON
FROM ICON.
IF SY-SUBRC = 0.
SORT TB_ICON BY NAME .
ENDIF.
ENDMETHOD . "ICON_POPULATE
METHOD FINAL_POPULATE.
*--looping through VBAK table into the work area
LOOP AT TB_VBAK INTO X_VBAK .
IF X_VBAK-NETWR <= 10.
*--Reading the ICON table into work area comparing field NAME
READ TABLE TB_ICON INTO X_ICON WITH KEY NAME = C_GREEN
BINARY SEARCH.
IF SY-SUBRC = 0.
X_VBAK-INDICAT = X_ICON-ID.
*--modifying the TB_VBAK table
MODIFY TB_VBAK FROM X_VBAK.
ENDIF.
ELSEIF X_VBAK-NETWR > 10 AND X_VBAK-NETWR < 100.
*--Reading the ICON table into work area comparing field NAME
READ TABLE TB_ICON INTO X_ICON WITH KEY NAME = C_YELLOW
BINARY SEARCH.
IF SY-SUBRC = 0.
X_VBAK-INDICAT = X_ICON-ID.
*--modifying the TB_VBAK table
MODIFY TB_VBAK FROM X_VBAK.
ENDIF.
ELSEIF X_VBAK-NETWR >= 100.
*--Reading the ICON table into work area comparing field NAME
READ TABLE TB_ICON INTO X_ICON WITH KEY NAME = C_RED
BINARY SEARCH.
IF SY-SUBRC = 0.
X_VBAK-INDICAT = X_ICON-ID.
*--modifying the TB_VBAK table
MODIFY TB_VBAK FROM X_VBAK.
ENDIF.
ENDIF.
ENDLOOP.
ENDMETHOD. "FINAL_POPULATE
METHOD top_of_page *
METHOD TOP_OF_PAGE.
PERFORM EVENT_TOP_OF_PAGE USING E_DYNDOC_ID.
ENDMETHOD. "top_of_page
METHOD DISPLAY.
*--Building fieldcatalog table
PERFORM FIELDCATLOG.
*--FOr making the Layout settings
PERFORM LAYOUT.
*--For sorting the fields
PERFORM SORTING.
*--perform for displaying the ALV
PERFORM ALV_GRID_DISPLAY.
ENDMETHOD. "DISPLAY
ENDCLASS. "LC_VBAK IMPLEMENTATION
*& Form FIELDCATLOG
Building the FIELDCATALOG
FORM FIELDCATLOG .
CLEAR: X_FDCAT,TB_FDCAT[].
X_FDCAT-ROW_POS = 1.
X_FDCAT-COL_POS = 1.
X_FDCAT-FIELDNAME = 'INDICAT'(004) .
X_FDCAT-TABNAME = 'TB_VBAK'(005).
X_FDCAT-SCRTEXT_L = 'STATUS_INDICATOR'(006).
APPEND X_FDCAT TO TB_FDCAT.
X_FDCAT-ROW_POS = 1.
X_FDCAT-COL_POS = 2.
X_FDCAT-FIELDNAME = 'VBELN'(007) .
X_FDCAT-TABNAME = 'TB_VBAK'(005).
X_FDCAT-SCRTEXT_L = 'SALES DOC'(008).
APPEND X_FDCAT TO TB_FDCAT.
X_FDCAT-ROW_POS = 1.
X_FDCAT-COL_POS = 3.
X_FDCAT-FIELDNAME = 'AUDAT'(009) .
X_FDCAT-TABNAME = 'TB_VBAK'.
X_FDCAT-SCRTEXT_L = 'DOC DATE'(010).
APPEND X_FDCAT TO TB_FDCAT.
X_FDCAT-ROW_POS = 1.
X_FDCAT-COL_POS = 4.
X_FDCAT-FIELDNAME = 'VBTYP'(011) .
X_FDCAT-TABNAME = 'TB_VBAK'.
X_FDCAT-SCRTEXT_L = 'SALES CATEGORY'(012).
APPEND X_FDCAT TO TB_FDCAT.
X_FDCAT-ROW_POS = 1.
X_FDCAT-COL_POS = 5.
X_FDCAT-FIELDNAME = 'AUART'(013) .
X_FDCAT-TABNAME = 'TB_VBAK'.
X_FDCAT-SCRTEXT_L = 'DOC TYPE'(014).
APPEND X_FDCAT TO TB_FDCAT.
X_FDCAT-ROW_POS = 1.
X_FDCAT-COL_POS = 6.
X_FDCAT-FIELDNAME = 'AUGRU'(015) .
X_FDCAT-TABNAME = 'TB_VBAK'.
X_FDCAT-SCRTEXT_L = 'REASON'(016).
APPEND X_FDCAT TO TB_FDCAT.
X_FDCAT-ROW_POS = 1.
X_FDCAT-COL_POS = 7.
X_FDCAT-FIELDNAME = 'NETWR'(017) .
X_FDCAT-TABNAME = 'TB_VBAK'.
X_FDCAT-SCRTEXT_L = 'NET VALUE'(018).
X_FDCAT-DO_SUM = C_X.
APPEND X_FDCAT TO TB_FDCAT.
X_FDCAT-ROW_POS = 1.
X_FDCAT-COL_POS = 8.
X_FDCAT-FIELDNAME = 'WAERK'(019) .
X_FDCAT-TABNAME = 'TB_VBAK'.
X_FDCAT-SCRTEXT_L = 'UNIT'(020).
APPEND X_FDCAT TO TB_FDCAT.
ENDFORM. " FIELDCATLOG
*& Module STATUS_0007 OUTPUT
module for setting the pf status
MODULE STATUS_0007 OUTPUT.
SET PF-STATUS 'ZSTATUS'.
SET TITLEBAR 'xxx'.
ENDMODULE. " STATUS_0007 OUTPUT
*& Module USER_COMMAND_0007 INPUT
module for handling the user commands
MODULE USER_COMMAND_0007 INPUT.
OK_CODE = SY-UCOMM.
CASE OK_CODE.
WHEN 'BACK'.
LEAVE TO SCREEN 0.
WHEN 'CANCEL'.
LEAVE TO SCREEN 0.
WHEN 'EXIT'.
LEAVE TO SCREEN 0.
ENDCASE.
ENDMODULE. " USER_COMMAND_0007 INPUT
*& Form LAYOUT
ALV Layout settings
FORM LAYOUT .
CLEAR X_LAYOUT.
*-- making Layout settings
X_LAYOUT-GRID_TITLE = 'Sales Header Document'(021).
X_LAYOUT-ZEBRA = C_X.
IF P_ALVDIS = C_X.
X_LAYOUT-NO_HGRIDLN = C_X.
X_LAYOUT-NO_VGRIDLN = C_X.
ENDIF.
ENDFORM. " LAYOUT
*& Form SORTING
sub routine for sorting criteria
FORM SORTING .
CLEAR X_SORT.
X_SORT-SPOS = '1'(022).
X_SORT-FIELDNAME = 'AUART'.
X_SORT-UP = C_X.
APPEND X_SORT TO TB_SORT.
CLEAR X_SORT.
X_SORT-SPOS = '2'(023).
X_SORT-FIELDNAME = 'VBTYP'.
X_SORT-UP = C_X.
APPEND X_SORT TO TB_SORT.
CLEAR X_SORT.
X_SORT-SPOS = '3'(024).
X_SORT-FIELDNAME = 'WAERK'.
X_SORT-UP = C_X.
X_SORT-SUBTOT = C_X.
APPEND X_SORT TO TB_SORT.
ENDFORM. " SORTING
*& Form CREATE_CONTAINER_OBJECT
subroutine to create object of container
FORM CREATE_CONTAINER_OBJECT .
CREATE OBJECT CUSTOM_CONTAINER
EXPORTING
CONTAINER_NAME = 'CUST_CONTROL'(025)
EXCEPTIONS
CNTL_ERROR = 1
CNTL_SYSTEM_ERROR = 2
CREATE_ERROR = 3
LIFETIME_ERROR = 4
LIFETIME_DYNPRO_DYNPRO_LINK = 5
OTHERS = 6
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " CREATE_CONTAINER_OBJECT
*& Form CREATE_ALV_GRID_OBJECT
subroutine to create object of ALV GRID
FORM CREATE_ALV_GRID_OBJECT .
CREATE OBJECT OBJ_ALV_GRID
EXPORTING
I_PARENT = CUSTOM_CONTAINER
EXCEPTIONS
ERROR_CNTL_CREATE = 1
ERROR_CNTL_INIT = 2
ERROR_CNTL_LINK = 3
ERROR_DP_CREATE = 4
OTHERS = 5
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " CREATE_ALV_GRID_OBJECT
*& Form ALV_GRID_DISPLAY
subroutine to call method for displaying the ALV GRID
FORM ALV_GRID_DISPLAY .
CALL METHOD OBJ_ALV_GRID->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
IS_LAYOUT = X_LAYOUT
CHANGING
IT_OUTTAB = TB_VBAK
IT_FIELDCATALOG = TB_FDCAT
IT_SORT = TB_SORT
EXCEPTIONS
INVALID_PARAMETER_COMBINATION = 1
PROGRAM_ERROR = 2
TOO_MANY_LINES = 3
OTHERS = 4.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL SCREEN 0007.
ENDFORM. " ALV_GRID_DISPLAY
START OF SELECTION
START-OF-SELECTION.
*--Creating a reference variable for the class LC_VBAK
DATA : OBJ1 TYPE REF TO LC_VBAK.
*--Creating a container object
PERFORM CREATE_CONTAINER_OBJECT.
*--Creating a ALV GRID control object
PERFORM CREATE_ALV_GRID_OBJECT.
*--Creating a object of class LC_VBAK
CREATE OBJECT OBJ1.
*--calling vbak population method
CALL METHOD OBJ1->VBAK_POPULATE.
*--calling icon population method
CALL METHOD OBJ1->ICON_POPULATE.
*--calling fianl table population method
CALL METHOD OBJ1->FINAL_POPULATE.
*--calling final method for display
CALL METHOD OBJ1->DISPLAY.
*& Form EVENT_TOP_OF_PAGE
text
-->P_E_DYNDOC_ID text
FORM EVENT_TOP_OF_PAGE USING P_E_DYNDOC_ID TYPE REF TO
CL_DD_DOCUMENT.
ENDFORM. " EVENT_TOP_OF_PAGE
Maybe you are looking for
-
Open order quantity in ME5A report
Dear All, How to get the open ordered quantity in the transaction ME5A. Regards, Venkat.
-
Problem using Instant Client 10g with PHP4.3.10-16 on Debian Sarge
Hello, My current email is [email protected] I am trying to use PHP on Debian box using Oracle 10gR2 on a RH 4 server. Everything works fine individually, but I cannot get PHP4 to use InstantClient to connect to the Oracle Server. This is
-
I can't find if there is a similar to Stock Card report in SBO that details daily inventory transactions per item. Please someone help me. Thanks in advance.
-
Error Deploying Custom Profile WS
I get the following error whenn deploying my custom PWS. I can see the Submission page. I encounter the error after clicking submit. I am using EDK 5.1 on Tomcat 4.1.30 and Portal 5.0.4. I have copied the class files in the EDK classes directory. Sou
-
Receive this message when opening a website
Must click okay to this message when I open a website: "This web page is being redirected to a new location. Would you like to resend the form data you have typed to the new location?" I have searched the forums and customer help without any directio