Get next id

Hi there,
When inserting a new record I want to assign the next
property_id from the property.property_id table. The query:
<cfquery name="GetNewID"
datasource="#application.DSN_Name#">
SELECT top 1 property_id
FROM property
ORDER BY property_id desc
</cfquery>
When I test it works swell.
However the error appears on the following line of code:
<cflocation
url="add_property_confirm.cfm?property_id=#GetNewID.property_id#">
The error states that property_id is not defined in GetNewID.
The property_id table is set for auto number and ident and
using SQL 2000.
I have no clue where to start to troubleshoot this - as an
interesting quirk this code was working for years, the client
pulled the site down, then we reinstated it - nothing changed in
the database or the code....a mystery to me.
Thanks in advance,
Kathy

Try changing this
<cfquery name="GetNewID"
datasource="#application.DSN_Name#">
SELECT top 1 property_id
FROM property
ORDER BY property_id desc
</cfquery>
to this
<cfquery name="GetNewID"
datasource="#application.DSN_Name#">
SELECT max(property_id) property_id
FROM property
</cfquery>
Also, for this code
<cflocation
url="add_property_confirm.cfm?property_id=#GetNewID.property_id#">
make sure there is no whitespace.

Similar Messages

  • Error in Get Next Non-Text Sibling for XML without CR at end of tag

    Hallo all,
    I'm having a strange error parsing XML files with labview. I have an XML file in one single line, without CR at end of each tag. A normal browser or XML parsing tool is capable to read it, but not with Labview.
    The error I have is with "Get Next Non-Text Sibling.vi", which internally fails to read Type property (Error -2630, Property Node (arg 1) in NI_XML.lvlib:Get Next Non-Text Sibling.vi->XML Get Siblings Childs Nodes.vi->Encode data to label (Path).vi).
    Labview XML parser works if I add a CR at each tag/node.
    I'm quite sure this is a labview bug. A workaround I have found is to open the file, then save the file with Save File (Pretty Print) method and reopen it again, but it is time-consuming and I would like to avoid it.
    Regards,
    Daniele
    Solved!
    Go to Solution.
    Attachments:
    xmlwithnoCR.xml.txt ‏1 KB

    Which node do you pass to XML Get Siblings Child Nodes.vi ? That is also important.
    I can imagine the following scenario causing your problem: Your input node has a child node C,, but this child node has no siblings. Get Next Non-Text Sibling.vi will fail in this case. If you put a <CR> at the right position in your XML you create a text node with content <CR>. If this text node is a sibling of child C then Get Next Non-Text Sibling.vi still won't return anything but no error should occur. IMHO this is expected behavior. You can however implement your own version of Get Next Non-Text Sibling.vi. Use the Next Sibling property and check if it returns a valid refnum.

  • Wondering what Hard Drive I should get next.

    Which 80GB Hard Drive do you think I should get next,
    Maxtor, Western Digital, IBM?
    I can afford any one.

    Quote
    Originally posted by Bergmania
    Quote
    Shaved 10 secs off boot time alone.
    I don't expect that to happen on my system.. as it boots on 26 sec anyways.. after some bootvis tweaking..
    Depends on what drive(s) a JB replaces.  In my case, it replaced IBM 75/60GXP models.  Boot time with them was ~40 seconds because of RAID-1 plus a ton of HP camera/scanner and other garb in the tray.  10 secs is quite a chunk off of that.

  • How to Create process of Type : Get Next or Previous Primary Key Value

    Hi,
    Can anybody give the steps how to create the page process for type Get Next or Previous Primary Key Value in oracle Express database
    Ramesh j c.

    Hi Justin,
    In oracle 10g XE , we have sample application v2.0
    1. Do you have any Document to create step by step the sample application v2.0 and Is it possible to create all the pages of this sample application v2.0 b by wizard. To recreate or create the demo app, start from the home area,
    next go to application builder,
    then click the create button,
    next choose "demonstration application"
    and then you can choose "Run | Edit | Re-install" the "Sample Application" along with a few other apps.
    2. When we install this sample application v2.0 , which is the sql script is executed or how it is installed. If you want the sample application you can export it after you create it if you want the SQL associated with it.
    3. Whenever the sample application v2.0 is installed, how the encrypted pass word is created for the user demo and admin. This is setup with the application install. I don't believe it is encrypted either. If your wanting SSL there are some threads on here that talk about encrypting content.
    Justin thanks for to create process Get Next or Previous Primary Key Value

  • Get next BusinessPartners Code/Key

    Hi together,
    I am looking for a way to get the next CardCode of a BusinessPartner to add a new one by DIApi.
    I tried it by using some Code like this, but it does not work fine:
    Dim oSeriesService As SAPbobsCOM.BusinessPartnersService = cmpService.GetBusinessService(SAPbobsCOM.ServiceTypes.BusinessPartnersService)
    Dim oSeriesCollection As SAPbobsCOM.BusinessPartners = oSeriesService.GetDataInterface(SAPbobsCOM.BusinessPartnersServiceDataInterfaces.bpsdiBPCodes)
    The Bold Text is not very fine, because there is no method like 'GetNextCardCode', otherwise its not tested, so i dont think this would work.
    Is there a way like the SeriesService... eg. there are no problems to get the next DocNum of an invoice
    Thank you!
    Sebastian

    I don't know if B1 has anything to generate a "next" cardcode value but I doubt it since the field is alphanumeric,
    but I've written something to do this for myself.
    On the before event when the user clicks on the add mode on the BP form, and if they leave the cardcode blank,
    I use a sql statement to determine the next number to assign.  We always prefix our customer numbers with a "C"
    and our Suppliers with a "V" so I look for the highest cardcode (max) out there where the first character is a c/v and
    the rest of the card code is completely numeric (like 'C1001', but not 'Customer 1' since it contains alpha values). 
    I just add one to the 1001 part and return 'C1002'.  If by chance two users end up assigning the same number,
    I let B1 catch the duplicate.
    Maybe this code will work for you:
    Public Enum BP_Type
            Customer = 0
            Vendor = 1
        End Enum
                    'in add mode, if user leaves cardcode empty, then assign it the next highest number from table
                    If pVal.FormMode = SAPbouiCOM.BoFormMode.fm_ADD_MODE Then
                        If Not IsNothing(cmbx) AndAlso Not IsNothing(cmbx.Selected) Then
                            Dim type As BP_Type
                            Dim prefix As String
                            If cmbx.Selected.Value = "S" Then
                                type = BP_Type.Vendor
                                prefix = "V"
                            Else
                                type = BP_Type.Customer
                                prefix = "C"
                            End If
                            If CardCode.Value = Nothing Then
                                Try
                                    CardCode.Value = GetNextCardCode(type, prefix)
                                Catch ex As Exception
                                    B1App.MessageBox("Could not generate next Card Code. " & vbCrLf & ex.ToString)
                        Bubble = false
                                End Try
                            End If
                        End If
                    End If
       Public Shared Function GetNextCardCode(Optional ByVal zCardType As BP_Type = BP_Type.Customer, Optional ByVal zCardCodePrefix As String = "C") As String
            Dim brwsr As Recordset
            Dim sql As String
            Dim cardtype As String
            'sql statement is looking for next number based on C or V in first character of existing cardcodes, via passed in
            'prefix field.
            Select Case zCardType
                Case BP_Type.Customer
                    cardtype = "C"
                Case BP_Type.Vendor
                    cardtype = "S"
            End Select
            'Get next highest customer number from table where customer number
            'starts with a C and the remainder of the value is numeric; then add one to the max value
            brwsr = oCompany.GetBusinessObject(BoObjectTypes.BoRecordset)
            sql = "select  COALESCE(cast(max(str(substring(cardcode,2,len(cardcode)-1))) as numeric) +1,1) " & _
            " as newcode from ocrd  where cardtype = '" & cardtype & "' and left(cardcode,1) = '" & zCardCodePrefix & "' AND isnumeric(substring(cardcode,2,len(cardcode)-1)) = '1'"
            brwsr.DoQuery(sql)
            Return zCardCodePrefix & brwsr.Fields.Item("newcode").Value
        End Function
    HTH

  • Journal Entrie - Failed to get next member of range member UJJ_JRNID

    Hi experts,
    I am using the BPC NW 7.5 SP04 version and have created a journal template. When I try to save the journal entry, I get the following error "new journal ID: Failed to get next member of range member (UJJ_JRNID - ). "
    I have this error only in production environment. I save and post journal entry in develop environment without error.
    Best regards,
    Marilia Costa

    Hi Friend,
    Application parameters yes marked as YES, and I have change the number range as following
    No.__ from number ____to number___current number
    1____0000000001_____9999999999__1
    But still i am getting error as" UJJ_JRNID - 000002"
    My subobject no. is 000002
    Please Advice
    Thanks in advance
    Aryan

  • How will i get next call if there is no scheduling period

    How will i get next call if there is no scheduling period? My requirement is to get next call generated whether there is no scheduling period.
    Also is it possible to get next call once the previous one is technically closed even though there is NO scheduling period and completion requirement checkbox unchecked ?

    Hi Priyanka,
    For your conditions
    1. No Scheduling period
    2, No Completion Requirement
    After initial scheduling (IP10), depending on the cycle period (1 Mon, 1Yr etc).,
    Whenever you run IP30, one call will be generated, if the plan date falls in the past. If the Plan date falls in the future a Scheduled hold  line item will be seen in IP30, further no impact of IP30  will be seen, until this Hold item is called.
    Jogeswara Rao K

  • How to get next record using next  button

    my database is very large and i awnt to display results 1 page at a time by keeping next button.so when i click next i should get next record.
    help me out

    Re-direct this post under relevant Developer Tools Forums.
    http://forums.oracle.com/forums/category.jspa?categoryID=19
    Regards,
    Sabdar Syed.

  • How to get next day date (i.e., tommarow's date) from java

    Hi all,
    One small help plz..........
    Which is the method to get next day date(for eg: 2mmarow)....
    How can I get tommarow's date from Date class or some others in Java..
    Iam able to get today date.....but my requirement is I should get next day date....Plz help me....
    Plz help me.....
    Any help will be appreciated...
    Thanks a lot.....~!~!

    Here's a working example:
    import java.util.Calendar;
    import java.text.SimpleDateFormat;
    public class Tomorrow {
        public static void main(String[] args) {
            Calendar c = Calendar.getInstance(); // current date
            c.add(Calendar.DAY_OF_MONTH, 1); // add one day
            SimpleDateFormat sdf = new SimpleDateFormat("dd"); // use the pattern: day_of_month
            String str = sdf.format(c.getTime()); // fromat the date to string
            System.out.println(str); // print it at the console
    }You should read the [url http://java.sun.com/j2se/1.5.0/docs/api/java/util/Calendar.html]Calendar and [url http://java.sun.com/j2se/1.5.0/docs/api/java/text/SimpleDateFormat.html]SimpleDateFormat class javadoc.

  • How to get next batch of mails from GMail?

    Hello,
    I can not get next batch of mail from Gmail. I thought how this is question for gmail but they have respond me this:
    "Thanks for your interest in Gmail and in Google. Because we're testing Gmail, there is some information we're unable to share."
    Does anyone can tell me how to do this?
    Thanks in advance!
    Best Regards,
    Nikola Putnik

    You cannot

  • How to get next and previous page  in a Train Flow .

    Hi,
    For creating record I am using multi-step flow (train).
    I have three page and I want to navigate the page via multi-step flow (train).
    I followed the steps given in the Toolbox Tutorial of create purchase order and
    Locator Element: Page/Record Navigation in developer's guide.
    page1=/uttara/oracle/apps/uttaraimc/createcitizen/webui/PropertyCreatePG
    page2=/uttara/oracle/apps/uttaraimc/createcitizen/webui/HouseDetailsCreatePG"
    page3=/uttara/oracle/apps/uttaraimc/createcitizen/webui/EducationCreatePG"
    The page1 is navigated via 'Create' button in CitizenSearchPG
    Now on this Page1, when I clicks on the 'Next' button (to navigate to the next page in the same multi-step flow) I am getting following exception and its not navigating to page2.
    Error: Cannot Display Page
    You cannot complete this task because one of the following events caused a loss of page data:
    * You accessed this page using the browser's navigation buttons (the browser Back button, for example).
    * Your login session has expired.
    * A system failure has occurred.
    To proceed, please select the Home link at the top of the application page to return to the main menu. Then, access this page again using the application's navigation controls (menu, links, and so on) instead of using the browser's navigation controls like Back and Forward.
    Here is the code for CreateFooterCO,
    public void processRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processRequest(pageContext, webBean);
    OANavigationBarBean navBean =
    (OANavigationBarBean)webBean.findChildRecursive("NavBar");
    if (navBean == null)
    MessageToken[] tokens = { new MessageToken("OBJECT_NAME", "NavBar") };
    throw new OAException("AK", "FWK_TBX_OBJECT_NOT_FOUND", tokens);
    // Determine which page we're on so we can set the selected value. Each
    // time we navigate to and within the flow, the URL includes a parameter
    // telling us what page we're on.
    int step = Integer.parseInt(pageContext.getParameter("ccStep"));
    navBean.setValue(step);
    // Figure out whether the "Submit" button should be rendered or not;
    // this should appear only on the final page (Step 3).
    OASubmitButtonBean submitButton =
    (OASubmitButtonBean)webBean.findIndexedChildRecursive("Submit");
    if (submitButton == null)
    MessageToken[] tokens = { new MessageToken("OBJECT_NAME", "Submit") };
    throw new OAException("AK", "FWK_TBX_OBJECT_NOT_FOUND", tokens);
    if (step != 3)
    submitButton.setRendered(false);
    public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processFormRequest(pageContext, webBean);
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    int currentStep = Integer.parseInt(pageContext.getParameter("ccStep"));
    // This button should only be displayed on the final page...
    if (pageContext.getParameter("Submit") != null)
    // Simply telling the transaction to commit will cause all the Entity Object validation
         // to fire.
    // Note that you must commit before asking WF for the next page, because
    // asking for the next page at this point will transition the WF to a
    // completed state, which means you won't be able to navigate back
    // if there are errors during the commit processing.
    am.invokeMethod("apply");
    TransactionUnitHelper.endTransactionUnit(pageContext, "citizenCreateTxn");
    // Don't forget to call this even on the last page so the activity associated with
    // this page completes and the Workflow transitions appropriately.
    String nextPage = OANavigation.getNextPage(pageContext);
    // For the final page, Workflow should be returning null -- and the user
    // can select the "Submit" button only on the last page. Something's
    // wrong.
    if (nextPage != null)
    throw new OAException("AK", "FWK_TBX_T_WF_UNEXPECTED_TRANS");
    else // we've just completed the flow
    // Assuming the "commit" succeeds, we'll display a Confirmation dialog that takes
         // the user back to the main "Purchase Orders".
    /* String poNumber = (String)pageContext.getTransactionValue("PO_NUMBER");
    MessageToken[] tokens = { new MessageToken("PO_NUMBER", poNumber),
    new MessageToken("PO_APPROVER", pageContext.getUserName()) };
    OAException confirmMessage = new OAException("AK", "FWK_TBX_T_PO_CREATE_CONFIRM", tokens);
    OADialogPage dialogPage = new OADialogPage(OAException.CONFIRMATION,
    confirmMessage,
    null,
    pageContext.getApplicationJSP() + "?OAFunc=FWK_TOOLBOX_PO_SUMMARY_CR&retainAM=Y",
    null);
    pageContext.redirectToDialogPage(dialogPage);
    else if ("goto".equals(pageContext.getParameter(EVENT_PARAM)) &&
    "NavBar".equals(pageContext.getParameter(SOURCE_PARAM)))
    // Note that the OANavigationBean publishes a "goto" event paremeter when
    // either the Back or Next button is pressed. You need to determine which way to
    // go based on the related "value" parameter.
    // Also note the check of "source" above to ensure we're dealing with the
    // page-level navigation here and not table-level navigation which is
    // implemented with the same Bean configured differently.
    int target = Integer.parseInt(pageContext.getParameter("value"));
    String workflowResult;
    if (target < currentStep)
    workflowResult = "PREVIOUS";
    else
    workflowResult = "NEXT";
    String nextPage = OANavigation.getNextPage(pageContext, workflowResult);
    if (nextPage != null)
    HashMap params = new HashMap(1);
    params.put("ccStep", IntegerUtils.getInteger(target));
    pageContext.setForwardURL(pageContext.getApplicationJSP() + "?" + nextPage, // target page
    null,
    KEEP_MENU_CONTEXT,
    "", // No need to specify since we're keeping menu context
    params, // Page parameters
    true, // Be sure to retain the AM!
    ADD_BREAD_CRUMB_NO, // Do not display breadcrumbs
    OAException.ERROR); // Do not forward w/ errors
    else
    throw new OAException("AK", "FWK_TBX_T_WF_NO_NEXT_PAGE");
    else if (pageContext.getParameter("Cancel") != null)
    am.invokeMethod("rollbackCitizenInfo");
    // Remove the "in transaction" indicator
    TransactionUnitHelper.endTransactionUnit(pageContext, "citizenCreateTxn");
    pageContext.forwardImmediately("OA.jsp?page=/uttara/oracle/apps/uttaraimc/createcitizen/webui/CreateCitizenSearchPG",
    null,
    OAWebBeanConstants.KEEP_MENU_CONTEXT,
    null,
    null,
    true, // retain AM
    OAWebBeanConstants.ADD_BREAD_CRUMB_NO);
    How to resolve this issue?
    please suggest.
    Thanks & Regards,
    Sagarika

    Sagarika,
    Please go thru the dev guide which explains the train flow in the multistep update exercise. Compare the steps with ur implementation.
    - Senthil

  • How to get next ID in a table ?

    Hi,
    suppose a table has first column as ID that stores unique ID in this format : P000001,P000002,P000003... and so on.
    How can i get the next value through query ?After getting that ID insert query will be applied .

    hi,
    You can use Oracle Sequence feature.
    e.g.
    CREATE SEQUENCE emp_sequence
    INCREMENT BY 1 -- number added every time
    START WITH 1 -- number starting
    NOMAXVALUE -- no max value
    NOCYCLE -- adding continuously, no loop
    CACHE 10;
    After that, you can use "emp_sequence.CURRVAL" to get the current value and "emp_sequence.NEXTVAL" to get the next value.
    e.g.
    INSERT INTO Mytable VALUES (empseq.nextval, 'LEWIS', 'CLERK', 7902, SYSDATE, 1200, NULL, 20);
    The first field of Mytable is the Sequence type. When inserting, you can use nextval.
    Also you can use "SELECT empseq.currval FROM DUAL;" to get the current value.

  • Get Next or Previous Primary Key Value

    I have a dynamic report with a select statement retreiving certain number of records, depending on the user choice. Once the user decides to change a record, he clicks on it and gets forwarded to the form page. On the form page I have two buttons - previous and next record. However, the order of previous and next doesn't consider the result of my report but the whole content of the source table (view). This means, if I click on the button next, it will not pick the next record from my report but the next record in the table, which the user is not interested in. My question is, how do I get it working based on my report query?
    Denes

    I have to preface this with the fact that I have not tested this. Sorry, short on time today.
    Scenario:
    - Report is on page 1
    - Item on page 1 called :P1_DEPTNO is a select list allowing the user to narrow the results.
    - Form is on page 2 with the following items:
    -- P2_EMPNO
    -- P2_ENAME
    -- P2_PREV_EMPNO (hidden)
    -- P2_NEXT_EMPNO (hidden)
    Report on page 1:
    select ename,empno
      from emp
    where deptno = :P1_DEPTNO
    order by ename asc nulls lastSince you HAVE to pre-determine the order, you cannot use column heading sorting.
    Poplate the P2_EMPNO item with a link from this page. Have a process that fires onload like the followin:for c1 in (select ename, prev_empno, next_empno
                 from (
                   -- Inner select to return all rows from page 1. We need this for lead and lag to work their magic.
                   select ename,empno,
                          lag(empno) over (order by ename asc nulls last) prev_empno,
                          lead(empno) over (order by ename asc nulls last) next_empno
                     from emp
                    where deptno = :P1_DEPTNO
                   order by ename asc nulls last
               -- Notice this predicate is not applied until the outter select statement. If we applied this to the inner
    -- statement, it would only return 1 row and lead and lag would return null.
               where empno = :P2_EMPNO)
    loop
        :P2_PREV_EMPNO := c1.prev_empno;
        :P2_NEXT_EMPNO := c1.next_empno;
        :P2_ENAME      := c1.ename;
    end loop;Now all you have to do is add a computation that fires on submit to set the value of :P2_EMPNO to either :P2_PREV_EMPNO or :P2_NEXT_EMPNO depending on which button was pressed. This is not the complete solution, but should get you over the part that you were specifically asking about.
    Let me know how it turns out,
    Tyler

  • Getting next calendar event on home screen

    I have just bought an iPhone 5, never had one before. On my old htc and before that, on my Nokia n95, I could get the next calendar event on my home screen - how do I do this on my iPhone?

    Well how bizaare !
    I went into Settings - Personal - Home Screen - Home Screen Theme and switched to "Basic", then to "Contacts" .... and the Home Screen emails appeared again.
    I then went back to the Home Screen sub  menu, and a 4th entry had appeared : E-mail Notification ! Before there were only 3 (Shortcuts, Home Screen and Home Screen Theme).
    I've now gone back to my original Home Screen Theme  (Shortcuts Bar).
    What a strange (and at times frustrating) phone.

  • Getting next XML Element in a document

    Hello,
    I have an xml JDom Document and I need to get, given the name of an element, the next element in the document.
    For example, with this document:
    <ROOT>
        <APPLE></APPLE>
        <GRAPE></GRAPE>
        <PEAR></PEAR>
        <ORANGE></ORANGE>
        <GRAPE></GRAPE>
        <MELON></MELON>
    </ROOT>I get a string like "ORANGE" and I need o get the next element in the document (GRAPE).
    And if I get "GRAPE", I have to get "PEAR" and "MELON".
    Is there anyway to get the following element without checking all the document elements?
    Thank you

    Is there anyway to get the following element without
    checking all the document elements?Obviously not. But why is "not checking all the document elements" a requirement?

  • Cannot get next captivate to open when published as a zip

    I am currently using Cap 4, but have the trial of Cap 5 as well.
    I have a 7 mod course and need to be able to open the next Captivate module from the the last slide of the current module.
    I have inserted a button with a path to the next movie, it works in both versions 4 and 5 when I publish in a folder, but when I publish as a zip file I get an error stating it cannot find the path.
    I have moved the swf and html into the zip with the current movie, but it still errors out.
    Can we "chain" the modules this way when publishing as a zip?  I do need it to be a zip file for loading into LMS.
    I'd appreciate any info that can help me out.

    How are you asking the next project to open?  Are you using a URL or the Project File Name?  How are you publishing the files?
    I've used this technique before with success (although never loaded it into an LMS).  I used the Start/End under Preferences and linked to the Project name.  All of the .exe files were in the same zip folder.
    I'm not sure if the .exe works with an LMS, though.

Maybe you are looking for

  • How do I create a service mark in Dreamweaver?

    I need to create a service mark in Dreamweaver. I checked the knowledgebase and character maps; I could only find copyright, TM, and registered trademark. If there isn't a keyboard shortcut, how do you create superscript in Dreamweaver? I tried the <

  • Migrate business rules (disaster recovery)

    I need a plan to be able to recover all my business rules/macros/sequences/projects/security in case of a disaster. Can some one suggest the best way to do this? I'll appreciate if some one can provide a step by step solution that can be automated. t

  • Voice command for Contacts doesn't work after a re...

    Voice command for Contacts doesn't work after a reboot or a contacts restore. Steps to reproduce: 1. Backup contacts. Open Files > Backup & Restore > Select Contact for Backup Contents and select Back up now. 2. Edit/save a contact, press and hold th

  • Time of event showing up instead of title

    When looking at the month view of ical... the time of the event is displayed instead of the event title. (it used to be the other way around before I got a new hardrive) Is there any way to switch it back??? Help please!

  • ITunes wont sync devices,says I need newer version of Apple Mobile Device Support what does that mean?

    I have the newest version of iTunes and when I sync it with my iPhone 4s with iOS7 or my 4th generation iPod touch is comes up with a pop up that says I need to uninstall the Apple Mobile Device Support and iTunes and get newer versions of both. Howe