How to increment a number between two unique number fields for columns?

Heya

I got this table structure

name | ID

one | 1
b | 2
d | 3

the number column cannot contain duplicate values, so when I want to insert a field 'c' with the id of "3" via a form

I use this method:

-------------------


< cfif IsDefined "(FORM. MM_InsertRecord") AND the FORM. MM_InsertRecord EQ 'form1' >

< cfquery datasource = 'my_db' >

UPDATE CATEGORIES
SET category_order_mnu = category_order_mnu + 1
WHERE category_order_mnu > #FORM.category_order_mnu #;

INSERT INTO CATEGORIES (category_name, category_order_mnu)
VALUES)
< cfif IsDefined ("FORM.category_name") AND #FORM.category_name # NEQ "" > "".
"#FORM.category_name #".
< cfelse >
NULL VALUE
< / cfif >
,
< cfif IsDefined ("FORM.category_order_mnu") AND #FORM.category_order_mnu # NEQ "" > "".
#FORM.category_order_mnu #+1
< cfelse >
NULL VALUE
< / cfif >
)
< / cfquery >
< / cfif >

------------


The problem is that I get this error message:
Quote:

"" Characters found after end of SQL Plus? »

The error occurred in C:\CFusionMX7\wwwroot\aiav1\aiacp\categories\addcategory.cfm: line 40

38: < cfelse >
39: NULL
40: < / cfif >
41 :)
42: < / cfquery >

CATEGORIES of UPDATE SQL SET category_order_mnu is category_order_mnu + 1 WHERE category_order_mnu > 3;. INSERT INTO CATEGORIES (category_name, category_parent_id, category_visible, category_tooltip, category_order_mnu) VALUES ('Programme', 0, NULL, 3 + 1)
DATASOURCE my_db
VENDORERRORCODE 3092

Tags: ColdFusion

Similar Questions

  • How to remove a path between two anchor points

    Hello

    everything is in the title,

    could you tell me please how to remove a path between two anchor points without using the tool Eraser path?

    When I select these two folders and press to remove all disappeared.

    PS: I want to keep the anchor after the removal

    Thank you

    with the Selection tool direct (white pointer), click the path segment (no points) or select slide above without going on something else and tap on delete.

  • How to create a table with two unique columns

    How to create a table with two unique columns. I use the following syntax below and I get the error message such unique or primary key already exists.

    create the table COPQ_WORKCELL_GOAL
    (
    Type_id varchar2 (4) NOT NULL UNIQUE,
    Tyle_Location varchar2 (30) NOT NULL UNIQUE,
    Type_Description varchar2 (20).
    KEY elementary SCHOOL (Type_id)
    );

    Use 1 or the other column type_id;

    create table COPQ_WORKCELL_GOAL
    (
      Type_id varchar2(4),
      Tyle_Location varchar2(30) NOT NULL UNIQUE,
      Type_Description varchar2(20),
      PRIMARY KEY (Type_id)
    );
    
    Table created
    drop table COPQ_WORKCELL_GOAL;
    
    Table dropped
    create table COPQ_WORKCELL_GOAL
    (
      Type_id varchar2(4) primary key,
      Tyle_Location varchar2(30) NOT NULL UNIQUE,
      Type_Description varchar2(20)
    );
    
    Table created
    
  • How to calculate the sum of two digital form fields based on the selection of the checkbox.

    I have a form in Acrobat Pro who needs a custom calculation. How to calculate the sum of two digital form fields based on a selection of the checkbox. I have three number fields. Field-A and B are simple one or two digits. Field-C is the sum, or the total field. I want to field-C have a control box which, when turned on and off, just gives a. gives the sum of A + B

    _ Field - 2

    _ Field - A 4

    [check] _ _ field - 6 C

    [disabled] _ _ field - 2 C

    Thank you

    The custom field C calculation script could be:

    (function () {
    
        // Get the values of the text fields, as numbers
        var v1 = +getField("A").value;
        var v2 = +getField("B").value;
    
        // Set this field's value based on the state of the check box named "CB"
        if (getField("CB").value !== "Off") {
            event.value = v1 + v2;
        } else {
            event.value = v1;
        }
    
    })();
    

    Replace 'A', 'B', and 'CB' with the real names of the fields.

  • How to give a delay between two Boolean?

    Hi all

    I want to insert a dalay in time between two Boolean values. My requirement is I want the second boolean to be switched on after delay 2 sec of variable Boolean 1 is turned on.

    How to do?

    Thank you

    Yes, I don't want to do antthing...

    Meanwhile, I also had the same idea...

    Thanks for the reply

  • How to share internet connection between two computers (win7 & win XP)?

    "I plan to get cable internet connection ADSL broadband." And again, I want to share internet from one computer to another. »

    • But I have a question in mind which is lower.

    Before going to answer my Question Please read two notes point-

    Note:

    A. very important don't ask me what I have installed and what equipment I have in my PC? just give me a simple, easy answer. guess I'm no networking and I have two PCs. You teach me from scratch.

    B. do not use the more technical term. I hate it when someone using the most incredible technical term (its towers the response in the largest number of questions lol). just give me a simple answer.

    If you are eligible to condition or except my EULA :) go further and read my questions give me an answer simple and straight.

    Now please read the question below.

    Issues related to the:

    Q1. Which computer should I connect main internet connection (computer on which will better host win7 or Win XP)?

    Q2. What equipment I mean as a router, hub, NIC etc.? Please specify if these materials will be required for two PCs or for one.

    Q3. What type of Internet connection sharing will be better to be wired or wireless (cost, speed and security wise)?

    Q4. I need two IP address both part of connection to the internet between two PCs?

    Thanks in advance.

    Hi Zeff,

    You can make Windows 7 the main computer for internet connection and then host the Windows XP computer.

    For more information, see the article:

    Start here to set up a home network in Windows 7

    Networking of computers running different versions of Windows

    With respect to the equipment as a router, hub, NIC depend on the connection (wired or wireless) you want to use. You can also check with the ISP (Internet Service Provider) for more information.

    For more information, see the articles:

    What do I need to connect to the Internet?

    Setting up a network home

    Wired and wireless connections have great benefits, but they have also some disadvantages.

    Wired connection:

    > Faster and more robust than wireless connections but not so flexible when positioning of computers and devices because you must be connected to your Super Hub with an Ethernet cable.

    > Safer than wireless connections, but not so convenient for users of laptops and other mobile devices.

    WiFi connection:

    > Wireless! If you can connect when you want. However performance may be affected by walls, electric interference etc.

    > Ideal for users of laptops and other mobile devices, you can connect devices more but slower than wired connections

    > Very safe when used with higher level (WPA) encryption. You can connect your smart phone to your network wirelessly for faster browsing.

    However, unauthorized users could try to use your connection (which explains why security is so important).

    There are two types of IP addresses. external and internal. Both computers have the same external IP address but separate internal IP addresses. Each device in your network will have its own (internal) IP address. The external IP address, who sees the Internet is actually assigned to your router.

    Hope the helps of information. Let us know if you need help with Windows related issues. We will be happy to help you.

  • How to center the object between two guides (or a guide to the edge of the artboard)

    Simple question: How can I Center an object between two guides or between a fence and the edge of the artboard?

    Chris,

    You can (guides are your friends):

    (1) create a rectangle between two Guides or between the fence and the edge of the artboard by ClickDragging with the Rectangle (desired penalty) tool on a (location) on the other Smart Guides say path/path or page/path when you're there;

    (2) select the two rectangle of 1) and the object, and then click the rectangle, and then use the options in the align palette.

    Who should move your object in the Center in the direction you choose.

  • How to return all dates between two dates?

    Hi all

    I need get all dates between two dates, Oracle SQL and PL/SQL.

    for example
    01/10/2011 - date 1
    10/11/2011 - date 2
    
    # Return Values
    01/10/2011
    10/02/2011
    03/10/2011
    .
    .
    .
    09/11/2011
    10/11/2011
    How can I get these values? Any help will be useful.

    Thank you

    Maybe

    select :start_date + level - 1 the_date
      from dual
    connect by level <= :end_date - :start_date + 1
    

    Concerning

    Etbin

  • How to create a relationship between two blocks

    Oracle forms 6i
    Hai All

    I've created a form that I have four button ADD, QUERY, SAVE, EXIT.

    I have two block named head and members.

    Four Chief areas namely block unitid, deptcode, codeno name.

    When I pressed the query button, and the cursor goes to the Chief name field when I enter the name of the leader and click

    Enter I give the codeno, the deptcode and the unitid of the leader_name.

    so now, I created another block in a tabular structure to bring members in the same deptcode that belongs to Leader_name.

    So pls tell me the steps how to create the relationship between these two blocks.


    When I enter the leader_name and gives enter need to bring the codeno, the deptcode, the unitid and

    I also need to give the members of this deptcode...


    Thanks in advance

    Srikkanth.M

    To write, only State a selection:

     :blk2.item = :blk1.item
    

    François

  • How to tell the difference between two dates

    Hello:

    I have a question on how to get the difference in quantities for two dates in the replies and dashboard.

    This is the scenario. I have two guests date and three columns. The first column must be the sum of the amounts for the first quick date. The second column should be the sum of the amounts for the second fast date. And the third column is the difference between the first two columns.

    Basically, I'm trying to do something similar to a function of sum of two lines but trying to get the difference between the two rows. Any help to solve this problem would be appreciated.

    Use the COLUMN FILTERS level...

    the first column with the first variable of date quick presentation of the filter

    Similarly, the second column in the second variable of quick overview of date filter

    Kind regards
    Rambeau

  • How to start-up / Direction between two locations / POI

    Hi I have 2 sites.

    How to get directions / direction between only 2 places?

    (Like getting directions on a map of BlackBerry)

    I'm already trying to use

    RouteMapInvoker

    and set the market (my place now) and put an end to places.

    But only show POI my position now

    Thank you

    Before I was am hardcode the location of departure.

    After not set the starting location, management is working now.

    Thank you

  • How do the time difference between two dates?

    Hi all

    I use this query to get the time difference between two dates.

    Select to_timestamp ('2012-10-03 12:00 ',' YYYY-MM-DD hh)-to_timestamp ('2012-10-03 11:00 ',' YYYY-MM-DD hh) as double diff;

    but do not get the correct result.

    Thank you

    Left KEY... Left Padding of tanks.

  • How to get the date between two dates, except Saturday and Sunday

    Dear all,
    select to_date('25-04-2012', 'DD-MM-YYYY') + rownum -1 dt 
        from dual 
        connect by level <= to_date('05-05-2012', 'DD-MM-YYYY') - to_date('25-04-2012', 'DD-MM-YYYY') + 1;
    The query above returns the following output
    DT
    DT
    04/25/2012
    04/26/2012
    04/27/2012
    04/28/2012
    04/29/2012
    04/30/2012
    05/01/2012
    05/02/2012
    05/03/2012
    05/04/2012
    05/05/2012
    Here, I need to exclude Dates that lights up "Saturday" and "Sunday" and also the joint birthday party
    Here it is May 1, 2012 "and I need the output as follows,
    04/25/2012
    04/26/2012
    04/27/2012
    04/30/2012
    05/02/2012
    05/03/2012
    05/04/2012
    I need the current request to calculate between two dates.
    Can anyone suggest me?

    Thank you
    Regsrds,
    gurujothi
    select dt
    from(
        select to_date('25-04-2012', 'DD-MM-YYYY') + rownum -1 dt
            from dual
            connect by level <= to_date('05-05-2012', 'DD-MM-YYYY') - to_date('25-04-2012', 'DD-MM-YYYY') + 1
            )
    where to_char(dt,'fmday') not in ('sunday','saturday')  
    

    To exclude, common holiday, you must have a host table. Then use an OUTER JOIN NOT IN or NOT EXISTS

  • How to find the difference between two dates in the presentation layer

    Hi gurus,

    Hello to everyone. Today, I came with the new requirement.


    I need to know the difference between a date and the current date in the formula column application presentation layer.by.



    Thank you and best regards,
    Prates

    Hi Navin,

    TIMESTAMPDIFF function first determines the timestamp component that corresponds to the specified interval setting. For example, SQL_TSI_DAY corresponds to the day component and SQL_TSI_MONTH corresponds to the component "month".

    If you want to display the difference between two dates in days using SQL_TSI_DAY, unlike butterflies SQL_TSI_MONTH and so on...

    hope you understand...

    Award points and to close the debate, if your question is answered.

    See you soon,.
    Aravind

  • Form must pass back between two users several times for signature

    I have a project agreement form that has specific steps that must be signed by both parties in order. User for example, a section of 1 Complete signs and forwards it to B user for confirmation, then he needs to deliver to the user so they can sign once completed section 2 and B user for confirmation, and so on for many individual sessions in the same document.

    I don't know if there is a way I create this kind of back and comes from the string between two users with conditions on a signature field, or how it could be achieved.

    It's awesome... basically what I thought I couldn't do, and EchoSign initially said was not possible.

    He said later that it is possible and their explanation is essentially yours, but they suggested also adding multiple roles to a single user (the user would get 3, role5, role1, etc.) in the same kind of sequence.

Maybe you are looking for

  • Apple ID security

    I forgot my answers to my security questions and my email of relief was closed because it has been hacked, how do I change my security in?

  • Portege R500 and Novatel Modem 3G on Windows 7

    Hello someone have a solution for getting the Modem 3 G build-in novatel works on Windows 7 in a Portege R500? I tried to install the driver for Vista 32 bit on my W7-Ultimate32bit. I have tried this driver: http://de.computers.Toshiba-Europe.com/inn

  • HP G60 - 443CL: installed Vista Business

    I used to have Windows 7 and I installed windows vista x 64 business on my laptop HP G60 - 443 CL, but the wireless network adapter does not settle. I have warring signs on other devices. Also, the network controller is not installed and when I try t

  • help thanks again

    I back up my computer on three tails when I first buy it. can I use then format my labtop. Thank you for the answers

  • Shut Down programs on their own - Windows 7

    Recently, we bought 2 new Dell computers with Windows 7.  Unexpected, all programs on both computers will stop at different times.  I checked both for malware and viruses and they are clean.  Does anyone have any suggestions?