How to manually insert an extra row of data in to a record set

hi there, i have a standard query which gets me some rows of
data
is there a way to manually add in an extra row of data (an
position that as row number 1 in the recordset)?
i've tried to find something on this in google / live docs -
but alas to no avail
if anyone could give me a pointer in the right direction
(just a tag would be a help) i'd be very grateful indeed.
thanks very much

thank you very much for your replies, this "union query"
sounds like the way forward for me - thank you very much i shall go
and investiage this now.
the reason i was a bit slow in replying was that in interim i
had coded around my problem
<cfif recordset.currentrow eq 1>
#output the extra row i wanted to add here#
</cfif>
which, whilst being a bit crude did do the job - however i
will check out this union query and if that does what it sounds
like it will - i'll document my final solution here in case this
helps anyone else
thanks again for your help guys

Similar Messages

  • How could I insert the deleted row into another table within a trigger?

    Hi,
    How could I insert the deleted row into another table within a trigger? The destination table has the same columns as the source table. Since the statements are in the trigger, it is not allowed to query the source table named 'test'. Thanks! The trigger is as follows, uncompleted:
    CREATE TRIGGER delete_trigger
    AFTER DELETE
    ON test
    FOR EACH ROW
    BEGIN
    -- How could I insert the deleted row into another table
    END delete_trigger;
    Message was edited by:
    user569548

    Hi,
    I'm not sure what's wrong there.
    I read the oracle docs about ANALYZE and ALL_TAB_COLUMNS, and did the following:
    ANALYZE TABLE my_tab VALIDATE STRUCTURE; //went ok.
    SELECT column_name
    FROM all_tab_columns
    WHERE table_name = 'my_tab'; //but no rows selected?
    This topic might not be what this thread should be about. Here I posted a new thread:
    How to get colum names of the newly created table?
    Thanks.
    Message was edited by:
    user569548

  • How to loop through a single row of data?

    What I'm trying to do is use a cursor to loop through a clob. When I create my cursor I get the an error telling me that the table does not exist. Which implies that I have an implicit cursor. Is there a way to get around this?

    > How to loop through a single row of data?
    By not looping as there is only a single row?
    > What I'm trying to do is use a cursor to loop through a clob
    Processing (looping through) a CLOB has nothing to do with a cursor.
    > When I create my cursor I get the an error telling me that the table does
    not exist. Which implies that I have an implicit cursor.
    Incorrect. It simply means that
    a) you do not have permissions to access that table from within the current context
    b) it does not exist (e.g. you have misspelled the object name, you have not qualified it properly within the current scope, etc)

  • Extra row in data grid

    after I load a object into data grid created from a web
    service it will always seem to create a new blank row. When I get a
    error after clicking on it, it always says "-1" for the rows count.
    when I shrink the size of the datagrid it elminates some of the
    extra row, but still there is a bit of it showing. how do I resize
    the datagrid so it doesn't spit out a extra row, or a part of one.
    http://www.ctrlzsc.com/other/pic.png
    this is a pic showing the extra row, just look where my badly drawn
    arrow is pointing to.

    hi, xyco45
    you can set the dataGrid's height and the rowHeight. In my
    experience, for example, first, you set the headerHeight="25" and
    rowHeight="22", the height will be setted
    (headerHeight+rowHeight*(rowNumbers)+1) or
    (headerHeight+rowHeight*(rowNumbers)+2), I thought this question
    will be solved.

  • How to determine the number of rows of data in a datatable?

    I have a datatable that I fill from an SQL query.  I do not know exactly how many rows of data it will return (due to my selection criteria) but will be somewhere between 100 and 300 rows.  I send this data into a report but need to determine the length of the report (panel height data member) programatically based on how much data the query has returned.  So, I need a way to count how many rows are filled in the data table.
    I tried doing a nested "if" statement checking the value of each cell but when I tested the expression at 59 "if" statements (will need 300+) I got a parser error in lookout when I tried to accept the connection.  I also tried a type of loop by assigning cursor.2 either to its own value (circular) or to its own value plus one depending on the value of the cell at cursor.2.  It was close but overshot by one row or more (much more sometimes).
    Any clever ideas?  Perhaps I have just been looking at this problem too long.  Thanks, in advance, for your help.

    Since the datatable gets the data from the SQL query, you can also use the SQL statement to count the number of rows in the query result.  
    For example, in datatable you do "select localtime, trace1 from intdata where xxx". You can get the count by "select count(trace1) from intdata where xxx". Use the same condition in order to get the same number of rows.
    Maybe another SQLExec object is needed to do the count.
    Whenever the datatable executes the SQL, the SQLExec executes and return the count.
    Ryan Shi
    National Instruments

  • How to process double click on rows of data displayed on html page?

    I need to display rows of data so that user could double click on a particular row to get more details.
    What I could think of doing is to embed an applet with a JTable that could easily process double click event. But the issues I have are:-
    1. I am not able to pass the data (the jsp got from processing some javabeans) to be displayed on the applet's table. It seems the applet needs to get loaded on the user's browser first and then the applet could ask the server (servlet / jsp) to send the data.
    Is there any way to provide data to applet other than html's parameter/value pairs?
    2. As per design, this applet should be used only to display the content. Double click on a row would only open a browser window to display the entire details of the data; there should not be any interaction with the server.
    Is there a better, more elegant way of doing this?
    Thanks.

    I posted a thread on Applet servlet communication here:
    http://forum.java.sun.com/thread.jsp?forum=33&thread=205887
    It uses the ObjectOutput/InputStream so you can send serializable objects rather than just text.
    Cheers,
    Anthony

  • How to get Inserted and Deleted Rows in ALV

    I have looked at the BC_EDIT* examples but I still can't figure out how to determine which rows were Inserted and Deleted from the ALV list.  Can someone please provide me the code to do this?
    Thanks.
    Sandy

    Hi sandy,
    i dont think you will have issue in inserting a row in ALV because whenever the user done some actions say for eg clicking the pushbutton at the toolbar you could insert the a new row into the ALV.for creating pushbutton you need to use the events TOOLBAR,USER_COMMAND.
    deleting a row may also follow the above procedure.
    Have a look at the demo program
    BCALV_GRID_05
    Cheers,
    Abdul Hakim

  • Question about how not to insert the same row twice

    hello everyone
    i have two tables
    table employee_list
    employee_id
    employee_name
    employee_num
    employee_date
    and table employee_form
    employee_id
    employee_name
    employee_num
    employee_date
    table employee_form should contain the exact data like employee_list .
    if there are missing data i'm inserting it to table employee_form_miss(missing).
    now i have a probelm cause the compair between the two table,take place
    more then just one time.now if there are still missing data i don't want that to table employee_form_miss will insert the same data that already exist in this table.
    i've been thinking about constraints table employee_form_miss(employee_id
    employee_name
    employee_num
    employee_date).
    but i think it will be a wird way to handle this because i will do an insert
    and then what rollback? or delete?
    please help me how to manage this
    thanks in advance.

    hello everyone
    i have two tables
    table employee_list
    employee_id
    employee_name
    employee_num
    employee_date
    and table employee_form
    employee_id
    employee_name
    employee_num
    employee_date
    i'm using an embedded sql in cobol program
    DECLARE AA CURSOR FOR
    select a.employee_name ,a.employee_num,a.employee_date
    from employee_list a
    WHERE a.employee_date = :employee-date
    and NOT EXISTS
    (select null from employee_form
    WHERE employee_name =a.employee_name and
    employee_num = a.employee_num and
    employee_date = a.employee_date )
    i'm doing open and fetch to the cursor.
    and loop over the sqlerrd(3) result in order to insert them to the employee_form_miss table
    insert into employee_form_miss (employee_name,employee_num,employee_date)
    values (:employee-name,:employee-num,:employee-date)
    the employee_id in table employee_form_miss there is a trigger which
    Increment the sequence by 1 for each row that we insert.
    so my question was that if i'm doing a constraint, so still i have to do
    an insert and then if there is a constraint to do rollback or delete
    from duplicate row. is there a better way to manage this ?
    thank you

  • How to stop insert of new row in tabular form if it's also being deleted

    Suppose you have a tabular form, and one of the fields is a not-null column. A user checks a button to "add additional row", which adds a new row to the form, defaulting that not-null column to null. Assume it's a name or something, so there is no reasonable non-null default value that can be entered here to keep it from being null.
    Now suppose the user makes a series of changes on the page, but then decides they don't want that row they just added, so they mark it for deletion, then click on "Delete Checked Rows". The not-null column was left blank.
    The page is constructed in such a way that the ApplyMRD process runs first, then the ApplyMRU process. (I do this so that the user doesn't lose all their updates if they want to delete a row. I've had a few people complain when they tried to combine both operations, and unexpectedly lost their updates when they hit delete instead of submit.)
    What happens? The page errors out because the ApplyMRU process is trying to insert a row with a null value in a not-null column. The ApplyMRD process ran fine, but because the row marked for deletion didn't exist in the database to begin with, it effectively did nothing. But ApplyMRU still tries to add the row, even though it was marked for deletion.
    Is there any way to prevent this scenario from happening, without requiring the user to Cancel instead of deleting the blank row, which would cause all other changes on the page to be lost? I'd also like to avoid losing the ApplyMRU process when the user clicks "Delete", since it's more effective to combine operations and this will address the UI complaints I'd received otherwise.
    (This is on ApEx 4.0, if it matters.)
    Thanks,
    Keith

    Thinking about this some more, doing the delete and update together may not be an easy thing to accomplish after all.
    Consider the above scenario, but the user puts a dummy value like "ignore-me" into the not-null text field, so the error doesn't come up with ApplyMRU is fired. But if ApplyMRD runs before ApplyMRU, it still doesn't do anything because there is no row in the database with the value "ignore-me". Then ApplyMRU runs and it adds that row, even though it was marked for deletion.
    So you probably need to always run ApplyMRU before ApplyMRD. But then you wind up inserting a row before you delete it, and that may have unintended side effects, if the user really never wanted to add it in the first place.
    Right now, the only workaround I can think of is to:
    1) put ApplyMRU before ApplyMRD
    2) add a pre-commit validation that checks to see if a row is blank AND checked, and if so, put a dummy value into the not-null field
    3) let that row get added and then deleted, and make sure there are no side effects from this (for example, there is an audit table that tracks updates to the base table -- I can add a trigger that does nothing if presented with this dummy value)
    Hopefully, though, there is an easier and more "built-in" way to achieve what I'm aiming for.

  • How to make tooltip highlight extra row data on a table

    I have a table in a declarative component.
    It only has 4 columns but there is a lot of extra data I would like to display when the user hovers over a row. You can see in the 'shortDesc' property I've added this but it doesn't work. Any help would be greatly appreciated.
    <af:table value="#{attrs.idmkr_table_model.collectionModel}"
    var="row"
    rows="#{attrs.idmkr_table_model.rangeSize}"
    emptyText="#{attrs.idmkr_table_model.viewable ? 'No data to display.' : 'Access Denied.'}"
    fetchSize="#{attrs.idmkr_table_model.rangeSize}"
    rowBandingInterval="0"
    filterModel="#{attrs.idmkr_query_model.queryDescriptor}"
    queryListener="#{attrs.idmkr_query_model.processQuery}"
    filterVisible="false" varStatus="vs"
    binding="#{attrs.idmkr_table_binding.myTable}"
    id="addr_addressees" rowSelection="multiple"
    columnStretching="last"
    width="100%"
    shortDesc="#{row['Address1']}, #{row['Address2']}, #{row['City']}, #{row['State']}, #{row['Postalcode2']}, #{row['Email']}, #{row['Phone']}, #{row['Fax']}"
    styleClass="AFStretchWidth">
    <af:column headerText="Name" sortable="true" sortProperty="Lastname" filterable="true">
    <af:outputText value="#{row['Lastname']}"/>
    </af:column>
    <af:column headerText="Type" sortable="true" sortProperty="Type" filterable="true">
    <af:outputText value="#{row['Type']}"/>
    </af:column>
    <af:column headerText="Role" sortable="true" sortProperty="Role" filterable="true">
    <af:outputText value="#{row['Role']}"/>
    </af:column>
    <af:column headerText="Distribution" sortable="true" sortProperty="Preferreddist" filterable="true">
    <af:outputText value="#{row['Preferreddist']}"/>
    </af:column>
    </af:table>

    Hey Frank, thank you very much, but that leads to a problem. Our team had Duncan Mills come to our location who said not to use javascript. Doesn't clientlistener call a javascript method? If there is a way to implement this without javascript I would prefer to do that. If javascript is our only option then I will do that.
    Thx.

  • How to manually insert a jumper multisim

    hi i want to transfer my circuit to ultiboard but i need a jumper how do i add it on multisim my version does not support automatic insertion.

    Hi,
    You can place jumper wires in Ultiboard 12.0 by going to Place>Jumper. 
    Refer to the following discussion, it explains an alternative if your version of Ultiboard doesn't have the "Place>Jumper" option. http://forums.ni.com/t5/Circuit-Design-Suite-Multisim/Automatic-jumper-insertion/td-p/520570

  • How to manually insert artist photos in the artist column?

    I wanted to know specifically how to customize artist photos in the artist section of the iPod / iPhone, etc. As you can see, it shows a corresponding album to that artist, but I wanted to put a photo of the artist there like they have in the iTunes Radio. Mainly cause it would look nice, and I have several artist that doesn't have photos anyway. There was a thread that someone put custom photos on their column using iFunbox. I have it, but don't know how the person did it.
    Any help?

    I'm installing that currently.
    This was the step by step tutorial that I got. Could you simplify / have any knowledge of it?
    1. Need ifunbox or other soft to download/upload to phone
    2. Download /private/var/mobile/Media/iTunes_Control/iTunes/MediaLibrary.sqlitedb
    3. Prepare images and put them to /private/var/mobile/Media/iTunes_Control/iTunes/Artwork/Original/00 folder
         (use your own naming, for example "deeppurple.jpg")
    4. Use Sqlite3 db editor edit 2 tables
    4.1 artwork
         add line for each artist with parameters id,4,name jpg,4. Where jpg name like u decide in 3
         For example deeppurple,4,00/deeppurple.jpg,4
    4.2 album_artist
         find line with artist name in album_artist column
         change value in album_artist_token to id value, for example deeppurple
    5. put edited MediaLibrary.sqlitedb back
    6. delete MediaLibrary.db-shm and MediaLibrary.db-wal files
    7. restart Music.app and enjoy.
    ps if u can change image - PLS find and delete files from /private/var/mobile/Media/iTunes_Control/iTunes/Artwork/Caches folder
    Cache create automatically

  • Procedure to insert a new row with data, but no PK

    Ok,
    I have an assignment to insert a row into an existing table and to insert values (via a procedure) into certain fields. However, none of the fields that are to be INSERTED upon are the PK field.
    I wrote the following for a start, and I get an error since I have NULL in the PK field. The PK is named PRODUCTID. I am only to insert p_name, p_description, p_imgname, p_cost, and p_status. I am in school now, and am a beginner at PL/SQL, and any help would be appreciated.
    How can I do this without assigning a value to the PK field?
    For reference: there are 10 rows in the table, and the one I'm inserting is row 11.
    CREATE OR REPLACE PROCEDURE prod_add_sp
       (p_name IN bb_product.productname%type,
        p_description IN bb_product.description%type,
        p_imgname IN bb_product.productimage%type,
        p_cost IN bb_product.price%type,
        p_status IN bb_product.active%type)
       IS
      BEGIN
        INSERT INTO bb_product (idproduct, productname, description, productimage, price, active)
         VALUES (lv_prodid_num, p_name, p_description, p_imgname, p_cost, p_status);
    END;
    /

    > Ok, since the table had 10 rows (PK was numbers 1-10, I added number 11 in the PK field for the
    corresponding row.
    Any other way to do this?
    You want to use a number generator to give you a unique number to use as PRODUCT_ID. Such a generator is known as a sequence in Oracle. Like your products table, it needs to be created up front.
    E.g.
    create sequence product_id_sequence start with 1 increment by 1 nocycle nomaxvalue;
    Note that several "copies" of this sequence can be active at the same time to serve a number of concurrent requests. In other words, instead of everyone to queue to get a number from the sequence generator, it creates for example 10 queues and is able to service 10 requests at the same time. This is great for scalability and not creating a bottleneck. At the same time, the numbers handed out are unique but not in a gap free ascending sequence either. Which is fine. Relational design says that we need a UNIQUE number for a surrogate key. Not a gap free ascending number range.
    Okay, in your INSERT statement you need to add the PK column and add the next sequence value into it, e.g.
    INSERT INTO products ( product_id, .... ) VALUES( product_id_sequence.nextval, ... );
    Refer to the documentation URLs posted above on sequences for more details.

  • How to auto insert computed value when new data is created??

    I'm new to APEX and was trying to solve this:
    To make it simple: I have a table, square_table, with two fields: input_number and square_value.
    All I want to do is when a user enters an input_number from 'the form and report template', the squared value is automatically computed and saved along with the new number to the square_table.
    Would someone post a solution (as details as possible, pls :)? I have watched numerous tutorials and no luck.
    Many Thanks,

    Poor design. You should not do this, even for strictly educational purposes. Stick to 3NF as much as possible, and only denormalize if a)you REALLY REALLY REALLY need to do it, AND b)your denormalized design survives peer review, AND c)you document VERY WELL the rationale behind such a design. Please read this - look for "Calculated Values".
    Anyway. You could do this at least two ways:
    1) Create a Page Process in your APEX application. Not a good idea, as other sources of INSERTs (sqplus, client/server apps) will not do the calculation unless coded to do so, and doing so would create multiple points of maintenance and documentation and testing, no to mention the added complexity of dealing with several potential development environments; or
    2) Create a good old plain trigger.
    If this was not a flawed design, I'd go for (2). It is basic SQL homework, well documented and simple to implement.
    Regards,
    Georger
    user11288935 wrote:
    I'm new to APEX and was trying to solve this:
    To make it simple: I have a table, square_table, with two fields: input_number and square_value.
    All I want to do is when a user enters an input_number from 'the form and report template', the squared value is automatically computed and saved along with the new number to the square_table.
    Would someone post a solution (as details as possible, pls :)? I have watched numerous tutorials and no luck.
    Many Thanks,

  • Inserting a new row in a child table referencing an already existing parent

    I have two tables PARENT & CHILD (one to many), both of which are populated at different times.
    In our toplink mappings, parent contains a collection of child Domain Objects, & and child Domain object contains a one - one to parent.
    How can I insert a new row in a child table with reference to an already existing row in parent?
    When I fetch the parent Domain object and try to set it in the child Domain Object and use the unitOfWork.registerObject() it goes into a circular loop of selecting from 2 other tables.
    Please suggest.

    Odd, have you disabled caching and indirection? (NoIdentityMap, dontUseIndirection, or alwaysRefresh/disableCacheHits). If so, then this could be the issue.
    Otherwise please include the sample code you use to perform this, and verify that you do not have any unusual code in your set/get methods or in descriptor events. Also turn TopLink logging on and include a sample. Also ensure that you do not modify your objects until after registering them in the unit of work, and only modify the unit of work clones.

Maybe you are looking for

  • Split payment document  by cleared document

    Split payment document  by cleared document hello, do you know if it s possible the following requirement: when posting a manual payment (F-53) my client would like to have bank line item splited by cleared document (invoice). Usually, you can clear

  • Power mac G4 - Startup hangs at gray screen

    Hello all, I have a Power mac G4 - mirrored drive door model.  512mb of RAM; 833mghz - about 50+ gigabytes of storage remaining. I recently starting using this mac again, here is what happened: Power mac G4 was running 10.2.1 - had never been updated

  • Information in Histogram in Adobe Camera RAW

    Since I capture my images in RAW, when I open them in Adobe Camera RAW (via Elements 11), what information is displayed in the image and the histogram I see? Is it showing me the jpeg created in the camera?  If so, the jpeg settings in my camera are

  • How to populate one dropdown on select of other dropdown in a table

    Hi My requirement is that I want to populate one dropdown on selection of some value in other drop down.The two dropdown are present in two columns of a Table. Can any body help for the same. Regards Nitin

  • Itunes in iphone skips to the end of tracks

    It doesnt happen all the time, but sometimes when i select a track or podcast, it will just skip to the end of the song, then play the next thing. This seems to happen most when i search for songs in the iphone search page and also happens a lot with