Mixing next n records with cfswitch order by problem

Hello;
I'm trying to make 2 types of page navigation work together. both work fine independently, but when I put my next n record code together with my change order by code, when you hit the next button, it goes back to the set default for the order by. I know I need to change some code logic in my scripts that run the next n records, but I'm not sure what I need to change in it to make it all work together properly. I am attaching the code, in it's rawest form, but all code is here for both features.
<cfparam name="sort" default="1">
<cfquery name="getMerch" datasource="#APPLICATION.dataSource#">
SELECT merchID, MerchName, MerchDescription, MerchPrice, MYFile, CategoryID
FROM Merchandise
WHERE CategoryID = 2
ORDER BY
<cfswitch expression="#sort#">
<cfcase value="1">MerchName</cfcase>
<cfcase value="2">MerchPrice</cfcase>
</cfswitch>
</cfquery>
<cfset rowsPerPage = 3>
<cfparam name="URL.startRow" default="1" type="numeric">
<cfset totalRows = getMerch.recordCount>
<cfset endRow = min(URL.startRow + rowsPerPage - 1, totalRows)>
<cfset startRowNext = endRow + 1>
<cfset startRowBack = URL.startRow - rowsPerPage>
<cfoutput>
<!--- changes the order by --->
<cfif sort is 1>
<a href="#CGI.script_name#?sort=#IIF(sort is 1, '2', '1')#" class="pre2Nav">Order By Price</a>
<cfelse>
<a href="#CGI.script_name#?sort=#IIF(sort is 2, '1', '2')#" class="pre2Nav">Order By Product</a>
</cfif>
<!--- my next n buttons --->
<cfif startRowBack GT 0>
<a href="#CGI.script_name#?startRow=#startRowBack#" class="pre2Nav">< Back</a>
</cfif>
<cfif startRowNext lte totalRows>
<a href="#CGI.script_name#?startRow=#startRowNext#" class="pre2Nav">More ></a>
</cfif>
</cfoutput>
<cfloop query="getMerch" startRow="#URL.startRow#" endRow="#endRow#">
<cfoutput>
All my output goes here
</cfoutput></cfloop>
Can anyone help me get this to work together? is it possible? and more importantly, how hard is it going to be to do this?
Thank you.

if I use this:
<cfdump var = "#isDefined('sort')#">
I get YES as the output, even when I hit the next button and change the category.
If I use this:
<cfdump var = "isDefined('sort')>
all I get is this:
isDefined('sort')

Similar Messages

  • Live video mixing, editing, and recording with multiple feeds in

    I'm REALLY new to this - does premiere (or any other Adobe product) enable you to record live video and mix it onscreen from more than 3 live video sources - LIVE (at the time of the event)?

    .also as much as i hate sony they make something called
    the "anycast"

  • Going to next ppt slide with full screen dashboard problem

    Hi,
    we're using Dashboards 6.0.7.0 and Powerpoint 2010. I want to use interactive dashboards in my presentations, e.g. with a slider or mouse-over. I have embedded the dashboards into my ppt, that is I used the export to ppt functionality and copied the whole slides into my presentation. The problem is, that I want the dashboard to cover the whole presentation slide. As soon as I use the dashboards functionality, like hovering over mouse-over sensitive fields, I can no longer go on to the next presentation slide, as Powerpoint will no longer react to my presenter or go to the next slide on clicking with the mouse. I always have to stop presentation mode (ESC) and jump manually to the next slide to continue with my normal presentation.
    Do you have the same problems? How do you go to the next slide when using full-screen dashboards in your ppt-presentations?
    I'm very much looking forward to your ideas!
    Thanks, Philipp

    did you try to click outside the canvas ?

  • Linking document info record and purchase order

    Hi all,
    I hope that someone can help me because I'm having a problem with creating links between document info records and purchase orders.
    By default in SAP I can create links between document info record and purchase order ITEMS! When I create that link, I can see it in document info record under Object links tab, but when I double click on the number of purchase order nothing happens (I expected that this purchase order will open).
    Why is that so?
    Why can't I access purchase order from document info record even though the link exists?
    The other question is about creating object links to purchase orders, not purchase order items! Is it possible to link document info record with purchase order?
    I would appreciate quick answer because we're in the middle of a project and we're stuck with that problem.
    Thanks!

    Hi Karlo,
             As you mentioned, object links could be linked to Purchase order items. In customisation you maintain these entries under the node SPRO > Cross Application Components> Document Management--> Control Data --> Define Document Types --> Define Object Links.
    There are many links in the standard system (possible entries).
    The system automatically determines the screen number (dialog box) where the key data for the object is maintained for document maintenance.
    You can check the screens when the screen entry is missing or contains errors by doing the following:
    Start the Object Navigator and display the objects for the development class  CV.
    Expand the function group 130. The structure nodescreens lista all screens that can be used for object links.
    You can make an object link to SAP objects that are not shown in the possible entries list. To do this, proceed as follows:
    In the standard system, there are already two special screens for the module pools SAPLCV130 and SAPLCV140 for the linked SAP object.
    You must create two new screens with the same number for the module pools SAPLCV130 and SAPLCV140 .
    The processing logic must follow that of screen 1204 in program SAPLVC130.
    Create function module OBJECT_CHECK_XXXX (XXXX = object name)
    If the object can be classified, this function module already exists .
    Otherwise copy the function module for linking equipment DOCUMENT_CHECK_EQUI and change it as required for the new object.
    Hope the above instruction helps in solving your problem,
    Sojan
    Note : Award points if you find the information useful

  • How to select Most recent record with rest of record in ascending order...?

    Dear Expert,
    I have one table called Tab1 & have a lot columns. For this schenario, i mentioned few of the columns.
    The columns are
    product_type varchar2(100),
    curr_date date (storing with time stamp),
    other1_cloumn varchar2(10),
    other2_cloumn varchar2(10)
    Now I want to display all the records in ascending order except most recent record for every product_type || Union all || Most recent records in ascending order in single query.
    For example...
    product_type curr_date date other1_cloumn other2_cloumn
    1, "10-May-2005 10:10:10", 10, 10
    1, "10-May-2005 10:10:11", 10, 10
    1, "10-May-2005 10:10:12", 10, 10
    1, "10-May-2005 10:10:09", 10, 10
    2, "10-May-2005 10:10:10", 10, 10
    2, "10-May-2005 10:10:11", 10, 10
    2, "10-May-2005 10:10:12", 10, 10
    2, "10-May-2005 10:10:09", 10, 10
    3, "10-May-2005 10:10:10", 10, 10
    3, "10-May-2005 10:10:11", 10, 10
    3, "10-May-2005 10:10:12", 10, 10
    3, "10-May-2005 10:10:09", 10, 10
    Now I want to display (OUTPUT) like...
    1, "10-May-2005 10:10:10", 10, 10
    1, "10-May-2005 10:10:11", 10, 10
    1, "10-May-2005 10:10:09", 10, 10
    2, "10-May-2005 10:10:10", 10, 10
    2, "10-May-2005 10:10:11", 10, 10
    2, "10-May-2005 10:10:09", 10, 10
    3, "10-May-2005 10:10:10", 10, 10
    3, "10-May-2005 10:10:11", 10, 10
    3, "10-May-2005 10:10:09", 10, 10
    1, "10-May-2005 10:10:12", 10, 10
    2, "10-May-2005 10:10:12", 10, 10
    3, "10-May-2005 10:10:12", 10, 10
    Plz, provide a solution....

    I want to display like...
    select * from tab1 where (product_type,curr_date) in
    (select product_type,max(curr_date) from tab1 group by product_type)
    order by product_type
    Union All
    (select * from tab1 where (product_type,curr_date) NOT IN
    (select product_type,max(curr_date) from tab1 group by product_type)
    order by product_type)
    But, In the above case, The ORDER BY Clause will not work...How to get this one...?
    I mean.. I want to display all the records in ascending order except Most recent record base on Product type and next I want to display Most recent record in ascending order. I want to display both cases in a single query...?

  • Add each column record with next column record

    Dear all,
    I have created a crosstab with the column "Order Numbers". Each Order number is calculated per day.
    I would like to know how can I create a formula so that each record in the column field is calculated by adding the next column field.
    For example
    Order numbers
    1
    2
    3
    4
    5
    Formula should display the records like this
    Order Numbers
    1
    3 (12)+
    6 (123)
    10 (1234)+
    15 (12345)
    So in other words each record in each field of the column is adding the next field.
    Something like ColumnRecord= Column Record+Next column Record.
    How can we achieve this?
    Many thanks
    Regards
    Jehanzeb

    Hellooo,
    I have sorted it.
    here is what I did
    Firstly I selected the Column field (percentage field).
    Clicked format -
    > then Suppress and clicked on x+2
    added the following formula
    whileprintingrecords;
    numbervar x := x + currentfieldvalue;
    false
    Then I clicked on Display String x+2 and entered this.
    whileprintingrecords;
    numbervar x;
    totext(x,2)+"%"
    Then I clicked on border->background> and added this formula
    whileprintingrecords;
    numbervar x := 0;
    defaultattribute
    all set and it is working perfectly.
    I hope this helps someone who is seeking this type of formula
    Regards
    Jehanzeb

  • I upgraded to yosemite and iOS 8 in order to record with quicktime. But when I select Record a new movies I immediately get an Operation Could not be completed error.

    I upgraded to yosemite and iOS 8 in order to record with quicktime. But when I select Record a new movies I immediately get an Operation Could not be completed error. When I choose record audio or screenshots, I get a little further, but as soon as I select my ipad as the source I get the same error message.

    You don't need to be a developer for this to work. I get the same error. Just one more thing on the list that make me upset more and more with Apple. Things just don't work out of the box like they used to.
    This new feature was to be included with iOS 8 and Yosemite.

  • Recording with Garageband for IOS

    I wanted to share a recording or two using the ipad so that people could see that garageband for IOS doesn't suck.  I didn't spend too much time throwing them together, but at the same time they're not too horrible either. They give a pretty decent idea of what a 1st gen ipad with a 5 dollar app is capable of in regards to guitar and shred-type guitar stuff. I'm kind of sick of reading and listening to scathing reviews on how the ipad and Garageband in particular is for non-musicians and noobs who want to sound like they're making music... (ooo that could describe me... yikes!) If I could have had an ipad-like device when I was just getting started, I think that I would be a much better player today. I am totally blown away at the expectations people have of a 5 dollar program, when they haven't spent the time trying to see what it does do well. Anyways, here's hoping that this post helps people out that are trying to find out what the capabilities of an ipad with GB are, especially if they are a guitarist. At the end of the day, it is still the person using the device that either makes it sound horrible, mediocre or amazing...
    So anyways, I decided to make a quick track where I didn't spend too much time on the music, and I used only what was in GB in regards to my tones and stuff; That means all stock amp and pedal combinations. I also wanted a track that focused on guitar parts, and making the best of what the app has to offer. I'm sure with some tweaking and mucking around there could be some much cooler tones generated, but hey... it is what it is. Also, I used a Godin LGXT direct into the ipad with an Apogee Jam. Very inexpensive. Bass and drums were recorded with the Line6 Mobile25. The tablet's screen works too, but I find that the keyboard is a lot more accurate, especially for drums. Obviously, you could go into the drum and guitar parts and edit and tweak the parts further, creating drum parts that feel and sound a bit more lifelike, but I didn't do that here; this one was about direct recorded electric guitar...
    https://soundcloud.com/jayesskerr/ipadgination
    Arguably, you could also record your stuff via microphones also. In this case I used a Roland VS880 as a mixer (It was handy), with 4 CAD microphones connected to it to capture my drum kit. (I'm not much of a drummer, but you get the idea...) I then just lined out of the VS880 into the apogee Jam into the ipad. BANG! This app could work very easily for drummers also... or people who must have their tone and not a digital preset...
    https://soundcloud.com/jayesskerr/just-drums
    I own a couple of good mac boxes loaded with killer software, and I also have some decent interfaces. They are pretty superior in regards to the amount of options that they present, without a doubt. And then when you include all of the 3rd party plugins and loops and stuff that you can get... well, it's very, very nice. The ipad intrigued me because it's self contained, and is extremely portable. It has limitations which force one to be kind of clever in order to work around them. Also, the recording process with an ipad is very, very quick. Setup time is minimal.  So anyways, with just Garageband, and an Apogee Jam (I have the irig connector also, but in my opinion the Jam is so much superior...). The only other thing I'd reccomend is the Line6 Mobilekeys25 which I used here; MUCH easier to enter notes in on bass and drums. Here's some points to sum up my opinions on my experience with the device;
    No it's not better than Logic or Cubase or prottols or something with an interface. It's only a 5 dollar app on a 600 dollar tablet (In my case an outdated 1st generation ipad).
    There's only 8 tracks, but you can bounce and merge.
    The amount of sections is limited, but you can work around that too...
    It's extremely portable. Way less gear to haul and set up, but feel free to use your own stuff with it also...
    GB on a tablet is very, very easy to learn. Super intuitive and quick to use.
    The amount of sections is limited, but again you could always just make another song project and then stitch it together later...
    The amp and pedal emulations aren't as good as Guitar Rig, a line6 Pod Pro hd, or a FAS Axe-FXII. But they aren't horrible, they are certainly pretty good for the price of 5 bucks...
    If you're broke/poor and want to get into recording and sharing your music, this is the ideal way to go about it. Your recording device (The ipad) also makes documents, does email, takes and edits pictures, takes and edits video... The only thing standing in the way of you sounding great is you...
    The 'merge track' option is a powerful tool, especially on your midi tracks.
    No pitch correction. Waaaaaahhh boo hoo! You're gonna have to learn how to sing. Plus, it's only 5 bucks!
    Don't want to use the internal drum sounds? Or want to use your amp's miced sound? Get a small mixer, and connect your mic to that. Then connect the mic to the Apogee Jam (There are other products out there that work better and in stereo, but this would do in a pinch) and you should be good to go.
    I recommend using a small keyboard like the Line6 Mobile Keys 25 to enter your midi/virtual instruments stuff in. For me, using just the pad means more track editing after I enter it...
    The last point is this; there's other software besides just GB. Cubasis anyone?
    Anyways, thanks for checking this out, I hope that it helps, and if anyone else has any opposing viewpoints or points to add, please do.
    http://www.guitarius.net
    http://www.youtube.com/user/Scottulus

    Yes, I do it all the time. The best I have found is the Apogee iMiC. Here is a link.  http://www.apogeedigital.com/products/mic.php

  • One-to-many selfjoin removing records with the same ranking or with a substitute

    Sorry for my bad choice of discussion title, feel free to suggest me a more pertinent one
    I've rewritten post for clarity and following the FAQ.
    DB Version
    I'm using Oracle Enterprise 10g 10.2.0.1.0 64bit
    Tables involved
    CREATE TABLE wrhwr (
    wr_id INTEGER PRIMARY KEY,
    eq_id VARCHAR2(50) NULL,
    date_completed DATE NULL,
    status VARCHAR2(20) NOT NULL,
    pmp_id VARCHAR2(20) NOT NULL,
    description VARCHAR2(20) NULL);
    Sample data
    INSERT into wrhwr  VALUES (1,'MI-EXT-0001',date'2013-07-16','Com','VER-EXC','Revisione')
    INSERT into wrhwr VALUES  (2,'MI-EXT-0001',date'2013-07-01','Com','VER-EXC','Verifica')
    INSERT into wrhwr  VALUES (3,'MI-EXT-0001',date'2013-06-15','Com','VER-EXC','Revisione')
    INSERT into wrhwr  VALUES (4,'MI-EXT-0001',date'2013-06-25','Com','VER-EXC','Verifica')
    INSERT into wrhwr  VALUES (5,'MI-EXT-0001',date'2013-04-14','Com','VER-EXC','Revisione')
    INSERT into wrhwr  VALUES (6,'MI-EXT-0001',date'2013-04-30','Com','VER-EXC','Verifica')
    INSERT into wrhwr  VALUES (7,'MI-EXT-0001',date'2013-03-14','Com','VER-EXC','Collaudo')
    Query used
    SELECT *
      FROM (SELECT eq_id,
                   date_completed,
                   RANK ()
                   OVER (PARTITION BY eq_id
                         ORDER BY date_completed DESC NULLS LAST)
                      rn
              FROM wrhwr
             WHERE     status != 'S'
                   AND pmp_id LIKE 'VER-EX%'
                   AND description LIKE '%Verifica%') table1,
           (SELECT eq_id,
                   date_completed,      
                   RANK ()
                   OVER (PARTITION BY eq_id
                         ORDER BY date_completed DESC NULLS LAST)
                      rn
              FROM wrhwr
             WHERE     status != 'S'
                   AND pmp_id LIKE 'VER-EX%'
                   AND description LIKE '%Revisione%') table2,
           (SELECT eq_id,
                   date_completed,           
                   RANK ()
                   OVER (PARTITION BY eq_id
                         ORDER BY date_completed DESC NULLS LAST)
                      rn
              FROM wrhwr
             WHERE     status != 'S'
                   AND pmp_id LIKE 'VER-EX%'
                   AND description LIKE '%Collaudo%') table3
    WHERE     table1.eq_id = table3.eq_id
           AND table2.eq_id = table3.eq_id
           AND table1.eq_id = table2.eq_id
    Purpose of the above query is to selfjoin wrhwr table 3 times in order to have for every row:
    eq_id;
    completition date of a work request of type Verifica for this eq_id (table1 alias);
    completition date of a wr of type Revisione (table2 alias) for this eq_id;
    completition date of a wr of type Collaudo (table3 alias) for this eq_id;
    A distinct eq_id:
    can have many work requests (wrhwr records) with different completition dates or without completition date (date_completed column NULL);
    in a date range can have all the types of wrhwr ('Verifica', 'Revisione', 'Collaudo') or some of them (ex. Verifica, Revisione but not Collaudo, Collaudo but not Verifica and Revisione, etc.);
    substrings in description shouldn't repeat;
    (eq_id,date_completed) aren't unique but (eq_id,date_completed,description,pmp_id) should be unique;
    Expected output
    Using sample data above I expect this output:
    eq_id,table1.date_completed,table2.date_completed,table3.date_completed
    MI-EXT-001,2013-07-01,2013-07-16,2013-03-14 <--- for this eq_id table3 doesn't have 3 rows but only 1. I want to repeat the most ranked value of table3 for every result row
    MI-EXT-001,2013-07-01,2013-06-15,2013-03-14 <-- I don't wanna this row because table1 and table2 have both 3 rows so the match must be in rank terms (1st,1st) (2nd,2nd) (3rd,3rd)
    MI-EXT-001,2013-06-25,2013-06-15,2013-03-14 <-- 2nd rank of table1 joins 2nd rank of table2
    MI-EXT-001,2013-04-30,2013-04-14,2013-03-14 <-- 1st rank table1, 1st rank table2, 1st rank table3
    In vector style syntax, expected tuple output must be:
    ix = i-th ranking of tableX
    (i1, i2, i3) IF EXISTS an i-th ranking row in every table
    ELSE
    (i1, b, b)
    where b is the first available lower ranking of table2 OR NULL if there isn't any row  of lower ranking.
    Any clues?
    With the query I'm unable to remove "spurius" rows.
    I'm thinking at a solution based on analytic functions like LAG() and LEAD(), using ROLLUP() or CUBE(), using nested query but I would find a solution elegant, easy, fast and easy to maintain.
    Thanks

    FrankKulash ha scritto:
    About duplicate dates: I was most interested in what you wanted when 2 (or more) rows with the same eq_id and row type (e.g. 'Collaudo') had exactly the same completed_date.
    In the new results, did you get the columns mixed up?  It looks like the row with eq_id='MI-EXT-0002' has 'Collaudo' in the desciption, but the date appears in the verifica column of the output, not the collaudo  column.
    Why don't you want 'MI-EXT-0001' in the results?  Is it realted to the non-unique date?
    For all optimization questions, see the forum FAQ:https://forums.oracle.com/message/9362003
    If you can explain what you need to do in the view (and post some sample data and output as examples) then someone might help you find a better way to do it.
    It looks like there's a lot of repetition in the code.  Whatever you're trying to do, I suspect there's a simpler, more efficient way to do it.
    About Duplicate dates: query must show ONLY one date_completed and ignore duplicated. Those records are "bad data". You can't have 2 collaudos with the same date completed.
    Collaudo stands for equipment check. A craftperson does an equipment check once a day and, with a mobile app, update the work request related to equipment and procedure of preventive maintenance, so is impossibile that complete more than one check (Collaudo) in a day, by design.
    In the new results, it's my fault: during digitation I've swapped columns
    With "I don't want 'MI-EXT-0001'" I mean: "I don't want to show AGAIN MI-EXT-0001. In the previous post was correct the output including MI-EXT-0001.
    Regarding optimisation...
    repetition of
    LAST_VALUE ( 
                            MIN (CASE WHEN r_type = THEN column_name END) IGNORE NULLS) 
                         OVER (PARTITION BY eq_id ORDER BY r_num)  AS alias_column_name
    is because I don't know another feasible way to have all columns needed of table wrhwr in main query, maintaining the correct order. So i get them in got_r_type and propagate them in all the subquery.
    In main query I join eq table (which contains all the information about a specific equipment) with "correct" dates and columns of wrhwr table.
    I filter eq table for the specific equipment standard (eq_std column).
    efm_eq_tablet table and where clause
    AND e.eq_id = e2.eq_id 
              AND e2.is_active = 'S'; 
    means: show only rows in eq table that have an equal row in efm_eq_tablet table AND are active (represented by 'S' value in is_active column).
    About the tables v2, r2 and c2
              (SELECT doc_data, doc_data_rinnovo, eq_id 
                 FROM efm_doc_rep edr 
                WHERE edr.csi_id = '1011503' AND edr.doc_validita_temp = 'LIM') v2, 
              (SELECT doc_data, doc_data_rinnovo, eq_id 
                 FROM efm_doc_rep edr 
                WHERE     eq_id = edr.eq_id 
                      AND edr.csi_id = '1011504' 
                      AND edr.doc_validita_temp = 'LIM') r2, 
              (SELECT doc_data, doc_data_rinnovo, eq_id 
                 FROM efm_doc_rep edr 
                WHERE     edr.csi_id IN ('1011505', '1011507') 
                      AND edr.doc_validita_temp = 'LIM' 
                      AND adempimento_ok = 'SI') c2, 
    Those tables contains "alternate" dates of completition to be used when there isn't any wrhwr row for an eq_id OR when all date_completed are NULL.
    NVL() and NVL2() functions are used in main query in order to impletement this.
    The CASE/WHEN blocks inside main query implements the behavior of selecting the correct date based of the above conditions.

  • SUN TEAM: Bugs in update and delete a record with long query

    Creator Team,
    In my opinio there is a bug issue with update and delete a record with a complex sql query. I�m using oracleXE and ojdbc14.ar with tomcat
    In just two page I�m receving the following msg (I have 12 pages doing the same thing with less complex queries)
    * Number of conflicts while synchronizing: 1 SyncResolver.DELETE_ROW_CONFLICT row 2 won't delete as values in database have changed: 2006-11-29
    * Cannot commit changes: Number of conflicts while synchronizing: 1 SyncResolver.UPDATE_ROW_CONFLICT row 0 values changed in database
    when i tried to delete or commit the updated changes in the register...
    The interesting is that this code function with jdbc of jsc...
    My query is bellow:
    SELECT ALL PATRIMONIO.TB_BEM.INCODIGOBEM,
    PATRIMONIO.TB_BEM.VATOMBAMENTO,
    PATRIMONIO.TB_BEM.VAMATERIAL,
    PATRIMONIO.TB_BEM.INCODIGOSETOR,
    PATRIMONIO.TB_SETOR.VANOME AS NOMESETOR,
    PATRIMONIO.TB_BEM.INCODIGOFORNECEDOR,
    PATRIMONIO.TB_FORNECEDOR.VANOME AS NOMEFORNECEDOR,
    PATRIMONIO.TB_BEM.DACHEGADA ,
    PATRIMONIO.TB_BEM.DASAIDAPREVISTA,
    PATRIMONIO.TB_BEM.DASAIDAEFETIVA,
    PATRIMONIO.TB_BEM.VAMARCA,
    PATRIMONIO.TB_BEM.VAMODELO,
    PATRIMONIO.TB_BEM.VADESBAIXABEM,
    PATRIMONIO.TB_BEM.INCODIGOTIPOAQUISICAO,
    PATRIMONIO.TB_TIPOAQUISICAO.VANOME AS NOMETIPOAQUISICAO
    FROM PATRIMONIO.TB_BEM , PATRIMONIO.TB_TIPOAQUISICAO, PATRIMONIO.TB_SETOR, PATRIMONIO.TB_FORNECEDOR
    WHERE PATRIMONIO.TB_BEM.INCODIGOTIPOAQUISICAO = PATRIMONIO.TB_TIPOAQUISICAO.INCODIGOTIPOAQUISICAO
    AND PATRIMONIO.TB_BEM.INCODIGOSETOR = PATRIMONIO.TB_SETOR.INCODIGOSETOR
    AND PATRIMONIO.TB_BEM.INCODIGOFORNECEDOR = PATRIMONIO.TB_FORNECEDOR.INCODIGOFORNECEDOR
    AND PATRIMONIO.TB_BEM.INCODIGOBEM LIKE ?
    AND PATRIMONIO.TB_BEM.VATOMBAMENTO LIKE ?
    AND PATRIMONIO.TB_BEM.VAMATERIAL LIKE ?
    AND PATRIMONIO.TB_SETOR.VANOME LIKE ?
    AND PATRIMONIO.TB_FORNECEDOR.VANOME LIKE ?
    ORDER BY PATRIMONIO.TB_BEM.VATOMBAMENTO ASC
    Why this problem is happing? Did you had some solution for that? Is the problem because the query is too long?!
    please help me!
    Gustavo Callou

    Hello people,
    I�m doing this to try to solution that bug:
    This code is working fine... but I do not understand why I�m receiving the nullpointer exception!??!!?
    // create a new rowset
    CachedRowSetXImpl pkRowSet = new CachedRowSetXImpl();
    try {
    RowKey rk = tableRowGroup1.getRowKey();
    if (rk != null) {
    // set the rowset to use the Patrimonio database
    pkRowSet.setDataSourceName("java:comp/env/jdbc/Patrimonio");
    String query = "DELETE FROM TB_BEM WHERE INCODIGOBEM = "+tb_bemDataProvider.getValue("INCODIGOBEM", rk).toString();
    pkRowSet.setCommand(query);
    pkRowSet.setTableName("TB_BEM");
    // execute the rowset -- which will contain a single row and single column
    pkRowSet.execute();
    pkRowSet.next();
    info("Apagado");
    } catch (Exception ex) {
    log("ErrorDescription", ex);
    error(getApplicationBean1().trateException(ex.getMessage()));
    } finally {
    pkRowSet.close();
    Please someone help me!!!
    Gustavo Callou

  • Populate Parent/Child records with "Family" value

    Hi,
    I typically do the task I'm asking assistance with in Excel and it works great... the only problem is that it's VERY slow and takes a lot of work when over 1 million rows as you must split it up and yeah just painful! But what I'm trying to accomplish is
    pretty straight forward for Excel, however escapes me in T-SQL! I have an ordered number that is sorted asc. I have a flag that indicates a record is the "Parent". I want to update the family value for the "Parent" and all sequential records
    until the next "Parent" records is reached. So here is an example in Excel.
    Using the following formula in cell C2 and pasting all the way to the last record, I can easily(for smaller sets anyway) create my desired results.
    =IF(B2="Y",A2,C1)
    Number Flag Family
    1 Y 1
    2 1
    3 1
    4 1
    5 1
    6 1
    7 1
    8 1
    9 Y 9
    10 9
    11 Y 11
    12 11
    13 11
    14 Y 14
    15 14
    16 14
    17 14
    18 14
    19 14

    I have an article on this exact topic
    Fixing
    Missing Data Based on Prior Row Information
    It shows the concept of using OUTER APPLY to achieve desired functionality.
    For every expert, there is an equal and opposite expert. - Becker's Law
    My blog
    My TechNet articles
    I wish I knew how to apply this OUTER APPLY solution to an update statement so I could use. Would this be more efficient and faster than the solution provided by RyanAB? I have millions of records and NOT enough time... the fastest solution is definitely desired!!!
    I ended up using this as a solution as it was the fastest. I first did:
    SELECT a.Number, M.Number 'Family' into FamilyTable FROM Table a
    OUTER APPLY (
    SELECT TOP (1) *
    FROM Table b
    WHERE a.Number >= b.Number and b.[Flag] = 'Y'
    ORDER BY b.[Number] DESC) M
    ORDER BY 1, 2
    Then updated the original like so:
    update a set a.Family = b.Family
    FROM Table a inner join FamilyTable b
    on a.Number = b.Number
    Thanks to all!!!

  • Recording with SB Audigy LS

    I have an Audigy LS that works fine as far as playing audio or streaming audio over the Internet, but I can get Audacity to record either steaming audio or line-in audio.  If I set audacity to OSS: /dev/dsp, the mixer tool bar doesn't even show up.  If I set audacity to one of the ALSA settings, the mixer tool bar does show up, but it doesn't record.  Audacity will also change the playback speed on any files I am already streaming.
      I don't know if this has anything to do with the problems, but I read somewhere that this soundcard does not have hardware mixing.  I also have to set IEC958 to mute in order to play audio files. 
      I would be willing to replace this card with either the M-Audio Revolution 5.1. or 7.1 if it would solve these problems.  M-Audio has been recommend in this forum, but no one seemed to address the recording issue.  I would be interested in any comments concerning the above problems or any experience recording with the Revolution sound cards.  I would also be interested in any differences between the two cards other than 5 channels vs. 7 channels. 
      Thanks
      Larry

    B15HOP wrote:
    I have a similar problem too. The problem is to do with the mic not turning on. If you press tab in alsamixer, it shows what the sound card will record and what volume settings for each input line. Yet for me, even with 100% volume on mic, i can not record because mic won't "turn on"
    http://bbs.archlinux.org/viewtopic.php?id=44837
    It's a real annoyance as this sound card worked worked really well in skype... not anymore.
    I admit that I am not an audio guru which is partially due to the fact that things always worked.  The joke is that I have an old SB Live (BUDGET) on my old computer which can record streaming audio and Line-in audio.  This machine is also running Arch so its not the OS. 
    One of the best suggestions I've seen on this forum is to pick up an old SB on Ebay.  It totally boggles my mind that such a mundane task should be such a problem.  I may swap cards which is NOT the solution I wanted since I also use window on the old machine to run Replay Radio. 
    Good Luck

  • How to generate row_number for more than the no of records in the order by column?

    Hi All,
    I have a query which contains Order quantity, order date and Row_number as Id. The below code produces 15 records as well as row_number for those 15 records. But I need row number for the next 12 months too. That means I need 12 more records with row_number
    and Order month and order quantity empty.
    use [AdventureWorksDW2012]
    go
    SELECT
      SUM([OrderQuantity]) As OrderQuantity
     ,CONVERT(DATE,[OrderDate]) As OrderDate
     ,LEFT(d.[EnglishMonthName],3) + '-' + CONVERT(CHAR(4),YEAR([OrderDate])) As OrderMonth
     ,ROW_NUMBER() OVER(ORDER BY([OrderDate])) As Id
    FROM [dbo].[FactResellerSales] f
    JOIN [dbo].[DimProduct]   p ON f.ProductKey = p.ProductKey
    JOIN [dbo].[DimDate]   d ON f.OrderDateKey = d.DateKey
    WHERE OrderDate >= '2006-04-01' AND EnglishProductName = 'Road-650 Red, 60'
    GROUP BY p.[ProductKey], [OrderDate],[EnglishMonthName]
    How can I achieve it?
    Regards,
    Julie

    I got a solution for this.
    use [AdventureWorksDW2012]
    go
    declare @min int, @max int
    IF OBJECT_ID('Tempdb..#tmp') IS NOT NULL
     drop table #tmp
    create table #tmp
       Id int
      ,OrderQuantity int
      ,OrderDate date
      ,OrderMonth varchar(78)
    insert into #tmp
     Id
    ,OrderQuantity
    ,OrderDate
    ,OrderMonth
    SELECT
      ROW_NUMBER() over(order by(orderdate)) As id
     ,SUM([OrderQuantity]) As OrderQuantity
     ,CONVERT(DATE,[OrderDate]) As OrderDate
     ,LEFT(d.[EnglishMonthName],3) + '-' + CONVERT(CHAR(4),YEAR([OrderDate])) As OrderMonth
    FROM [dbo].[FactResellerSales] f
    JOIN [dbo].[DimProduct]   p ON f.ProductKey = p.ProductKey
    JOIN [dbo].[DimDate]   d ON f.OrderDateKey = d.DateKey
    WHERE OrderDate >= '2006-04-01' AND EnglishProductName = 'Road-650 Red, 60'
    GROUP BY p.[ProductKey], [OrderDate],[EnglishMonthName]
    --select * from #tmp
    select @min=count(*)+1, @max=count(*)+12 from #tmp
    --select @min, @max
    IF OBJECT_ID('Tempdb..#tmp_table') IS NOT NULL
     drop table #tmp_table
    Create table #tmp_table
       Id int
      ,OrderQuantity int
      ,OrderDate date
    insert into #tmp_table
     select Id, OrderQuantity, OrderDate from #tmp
    --select * from #tmp_table
    declare @test varchar(1000)
    set @test='insert #tmp_table(id) select TOP '+ convert(varchar,@total)+' ROW_NUMBER() over(order by(select 1)) from sys.columns'
    exec(@test)
    while(@max >= @min)
    begin
     insert #tmp_table(id,OrderDate)
     select  @min,DATEADD(mm,1,max(orderdate))
     from #tmp_table
     set @min=@min+1
    end
    select * from #tmp_table
    Regards,
    Julie

  • Scheduling Agreement with Delivery Orders

    Hi,
    When i create (LZM)scheduling agreement(Qty 10) with Delivery orders, when i create deklivery schedule
    ie
    Date                Qty
    25.10.2008      1
    26.10.2008      1
    27.10.2008      1
    in MD04 for that particular material i can see only requirement for cumulative Qty i.e. 3, &  PP guy is not able to create planned order for those dates unless i create delivery Order(TAM) for the same
    whats the solution for this?
    Regards,
    Amol.

    Hi Suresh
    The *** issued qty gets updated when the PGI for the delivery happens. There is a field called *** received by customer and it gets updated when customer sends the *** back in the 830 or 862 as the case may be.
    The difference between the *** issued and the *** recieved is always shown in transit.
    If you do not want the schedule line to be opened up, then in *** recd change it to the *** issued or ideal option is populate the last delivery PGI'd on the delivery number field next to *** recd field. Hope this helps and let me know if you need any more informataion
    Regards

  • How to fetch n records at a time from a FM and then fetch next n records

    I have a report program which is calling a function module . This function module returns all the records from a table. As the table has millions of records, it cant be returned at a time. How can we return N records from a function module and then return Next n records .The Function module and the report program are in different system .
    Thanks in Advance.

    Use open cursor and fetch cursor.
    Check the program as in SAP Help.
    DATA: BEGIN OF count_line,
            carrid TYPE spfli-carrid,
            count  TYPE i,
          END OF count_line,
          spfli_tab TYPE TABLE OF spfli.
    DATA: dbcur1 TYPE cursor,
          dbcur2 TYPE cursor.
    OPEN CURSOR dbcur1 FOR
      SELECT carrid count(*) AS count
             FROM spfli
             GROUP BY carrid
             ORDER BY carrid.
    OPEN CURSOR dbcur2 FOR
      SELECT *
             FROM spfli
             ORDER BY carrid.
    DO.
      FETCH NEXT CURSOR dbcur1 INTO count_line.
      IF sy-subrc <> 0.
        EXIT.
      ENDIF.
      FETCH NEXT CURSOR dbcur2
        INTO TABLE spfli_tab PACKAGE SIZE count_line-count.
    ENDDO.
    CLOSE CURSOR: dbcur1,
                  dbcur2.
    Regards
    Kannaiah

Maybe you are looking for

  • LaserJet Pro 200 color MFP M276nw scan to computer file

    when we attempt to scan  we have three options on the printer 1. Scan to usb drive 2. Scan to Network folder 3. Scan to e-mail the only way we can scan is to choose #1. If we want to  attach a scan to an e mail or place it in a file the only way that

  • How to use FND_PROFILE.VALUE('XZY_ROLE')  in VO as parameter.

    Hi, I have created a profile and setting that profile at responsibility level. Based on the value returns from fnd_profile.value('CUSTOM_PROFILE'), I would like filter my search results on queryPG. I have developed the queryPG with some search fields

  • How to create dup d'base on same host??

    Hi, I want to create dup d'base on the same host with diff directory structure with rman.I have few question to ask. I am using oracle 9.0.1 on win 2000 server and I am using stand alone server so what step I should take to avoid future mishapes? ple

  • Document properties and metadata

    This question was posted in response to the following article: http://help.adobe.com/en_US/acrobat/pro/using/WS58a04a822e3e50102bd615109794195ff-7c67.w.h tml

  • X12 00502-204 validate instance failure when EDI file is in readable format in Visual Studio

    Hi, I have a n X12 00502- 940 edifile, when all data are on the same line, Visual studio validates ST*204*7629~B2**XXXX**159771**PP~.......N4G*L*43920*900**E*864~SE*33*7629~ when I try to make the file in a readable format, each segment on line by hi