Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2003
    Location
    Brussel
    Posts
    52

    Unanswered: Insert [found the answer!!!]

    I'm working on a project with ColdFusion, an Oracle db and some PL/SQL triggers. In one of my cfm pages I made it possible to order the data in a table on their subject and date. The problem is that an order by subjects put everything in the order shown in the example

    -This is a test
    -What are you doing
    -all things have been said

    You see? First the data with the capital letters and than the subjects with a small letter ... but a must stand before the T!!! So I want the data you insert in the database to be placed in a specified form. First letter capital, rest of the text lowercase letters. But I want to give the possibility to the users to insert the data in any possible way. If they insert 'HALLO' that must be changed into 'Hallo'.

    So I tried to put in my insert command some functions (substr, upper and lower), but it just doesn't work ... possibly a wrong nesting. Who can help me???

    INSERT INTO message VALUES (
    sysdate,
    upper(substr('#Form.txtsubject#', 1,1)) lower(substr('#Form.txtsubject#', 2, length(Form.txtsubject)))
    );
    Last edited by Lazy; 10-16-03 at 05:30.

  2. #2
    Join Date
    Sep 2003
    Location
    Brussel
    Posts
    52

    Insert [I found the answer]

    I found the answer ... haleluja for the pipe line

    insert into message values(
    sysdate,
    upper(substr('#message#',1,1)) || lower(substr('#message#',2,length('#message#'))));

  3. #3
    Join Date
    Oct 2003
    Posts
    22

    Re: Insert [found the answer!!!]

    There is a single row function ' INITCAP '

    This changes the first alphabet of the word into caps.

    Use this format

    INITCAP(table_column) = INITCAP(user_input); for comparision.

    insert into table_name(table_column)
    values(NITCAP(user_input));
    for inserting the value.


    HOMEinatlANTIS -> Homeinatlantis

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •