Change field name in sql statement

How can one change a field name in a specified table using an sql statement?
Thanks.
Dan.

You will have to
ALTER TABLE youredb.youretable ADD newcolname datatype(length);
then copy the data from the old to the new collumn name.
Then:
ALTER TABLE youredb.youretable DROP oldcolname;
Hope this helps, i dont think there is any way to rename a field in 1 operation.

Similar Messages

  • In sets (t-code GS01-04): How to change Field name

    HI,
    I have created sets for rule in validation by t-code GS01. Where I have given Tbale name BSEG and Field name KOSTL(Cost Center No). Now, I want to change field name SAKNR (GL NO) instead of cost center. When I am trying to change field name t-code GS02, there is field name is in display mode and no way to change it.
    As I have lot of entries in each set, so that creation of new sets is very hard job again. Further when I trying to create new sets by reference it didnt change the table name and field name.
    Please provide me a solution.
    Khalid

    Hi,
    Hope it is not possible, logically total field is changing and the dependent entrie will not stay as it is. I don't think this is possible.
    Eventhough the values are same but the fields are different.
    VVR

  • Why can't I change the names of my states in my symbol?

    For some reason, Fireworks won't let me change the names of my states in my symbol.
    I double click on the state name in the states panel, and nothing happens.
    It works fine for normal "non-symbol" pages.
    Can you normally change the names of states in symbols?
    Any ideas why I am having difficulty doing so?

    Thank you SO much! Funny thing, I didn't even notice the tiny folder icon at the top of the info window until I saw it in the screen shot at the beginning of that article. 
    See, I have begun changing the icons of the folders of digital scrapbooking alphabets I have (screenshot below). Now it will be so much easier to scroll through my hundreds of alphas and choose one, because I can SEE them without going in and out of each folder.
    A million thank yous!!!!! 

  • Adding a field to an sql statement in Oracle Reports error ORA-00933

    We have been requested to add a field that already exists in the table referred to by the sql statement in Oracle Reports Builder. The report was set up by a consultant about 3 yrs ago and we don't really have much skill in this area. What is happening when I try to modify the SQL statement, either adding a field or deleting a field to the SELECT statement, causes an error message preventing the statement from being saved. The only way out of the error message is to click Cancel. The error message is
    ORA-00933:SQL command not properly ended
    ORDER BY Program ==> NAME
    Even adding or deleting a space anywhere in the SQL statement causes the error (not adding any new fields). A coworker found that if we comment out the ORDER BY, the statement will accept the new field in the SELECT section, however then we lose the order by functionality. I would like to add one additional field before the FROM. Not sure if any additional data are needed. Thank you.
    SELECT p.person_uid PIDM_KEY, p.id_number ID,
                   p.full_name_lfmi name,            
                    p.BIRTH_DATE, p.GENDER Sex,
                    Decode(a.residency,'D',p.Primary_ethnicity,'F')  Ethn,
                    a.academic_period TERM,        
                    CASE WHEN :p_group_by = 'PROGRAM' THEN a.program
                                 ELSE ' '
                    END AS Program,
                    a.COLLEGE, a.degree, a.major, ' ' rule,
                    a.STUDENT_POPULATION,a.STUDENT_LEVEL,    a.application_status Status,  a.application_status_date app_sts_dte,
                    ad.decision_date1 Last_Dec_Date,
                    ad.decision1||' '||ad.decision2||' '|| ad.decision3||' '|| ad.decision4||' '|| ad.decision5 Decisions,
                    /*  Deposit Date uses the last term entered in :p_term parameter string */
                    (SELECT MAX(deposit_effective_date) FROM usf_as_deposit WHERE account_uid = a.person_uid &term_clause group by account_uid)   AS "DEPOSIT DATE",     
                    ph.phone as PHONE,
                    CASE WHEN PS.FIRST_CONTACT IN ('NET','PAP','COM','COP') THEN PS.First_Contact
                     ELSE CASE WHEN ps.latest_contact IN ('NET','PAP','COM','COP') THEN PS.Latest_Contact
                                ELSE '  '
                                END
                    END AS FIRST_CONTACT,
                    DECODE(:p_address,'Y',REPLACE(adr.street1||' '||adr.street2||' '||adr.street3||' '||adr.city||','||adr.state||' '||adr.nation||' '||adr.zip,'  ',' '),' ') as  address, adr.nation, adr.state,
                    goremal_email_address email, a.residency, a.application_date, p.primary_ethnicity, c.cohort
    FROM MST_ADMISSIONS_APPLICATION A,
               MST_PERSON p,mst_pre_student PS,  Admissions_Cohort c, usf_v_phone_pr_ma ph,
               MST_admissions_decision_slot AD, usf_v_email, usf_v_address_dr_lr_ma_pr adr
    WHERE a.PERSON_UID = p.person_uid
            AND a.curriculum_priority  = 1
            AND a.person_uid = ps.person_uid
           AND a.person_uid = ad.person_Uid(+)
           AND a.person_uid = goremal_pidm(+)
           AND a.person_uid = adr.pidm(+)
           AND a.person_uid = ph.pidm(+)
           AND ph.rnum(+) = 1
           AND a.person_uid = c.person_uid(+)
           AND a.academic_period = c.academic_period(+)
      &Where_Clause
           /*    TAKE OUT FOLLOWING LINE AFTER DATA IS CLEANED UP  */
            AND NOT(p.id_number = '00000000'   OR SUBSTR(p.id_number,1,1) = 'B'  OR UPPER(p.full_name_lfmi)  LIKE '%TESTING%')
           AND  a.application_status_date >= NVL(:p_as_of_date,sysdate-8000)
           AND a.academic_period = ad.academic_period(+)
            AND a.application_number = ad.application_number(+)
            AND a.degree <> 'ND'    /*   AND a.college <> 'LW'                         --  Does not need non-degree and law students    */
           &Cohort_Clause 
    ORDER BY Program  &ORDER_CLAUSE

    Hi Denis,
    I tried your suggestion. The good thing is that adding the comma allowed me to be able to add a.campus to the select statement, unfortunately, another error message happened.
    ORA-00936: missing expression SELECT p . person_uid PIDM_KEY ,
    p . id_number , p . full_name_lfmi name , p . BIRTH_DATE , p . GENDER Sex ,
    Decode ( a . residency , 'D' , p . Primary_Ethnicity , 'F' ) Ethn , a . academic_period TERM ,
    CASE WHEN : P_group_by = 'PROGRAM THEN a I started over and tried only putting in the comma and get the same message even though I didn't add campus. After that, removed the comma which led to the ORA-00933 error message. So once again, I had to close the file without saving, in order for the report to run at all.

  • Is there a way to change field names globally in Form Wizard?

    Form Wizard often selects nearby text to create a name for a text box. Is there a way I can globally change the field name for a series of text boxes? For instance, I have a field name that Form Wizard created that says "Policy NumberPolicy that requires a specific" and I want it to be simply "Policy Number."
    If there is no way to fix it globally, is there a way to prevent it happening in the first place?
    Also, is there a way to automatically convert a text box to a check box?
    Thanks

    Unfortunately, the answer to all of your questions is no.  The closest you can come is to use a script to create a new field with a new name that has most of the same properties as the old field, and then delete the old field, but you'd have to find some way of deciding which fields shold be changed. You do not have any control over the form wizard apart from changing the PDF so it has a different design/layout. Converting a text field to a check box wold have to use the approach metioned earlier, but you'd have the same problem of determining which ones to change.

  • Cant change field names

    I am working in the hierarchy and re-naming fields names for reference when pointing to them in scripts. Everything has been working fine for days now. Now for some reason I cannot re-name an object. I am allowed to highlight the object, delete the existing text, and re-type the new name for the field. But for some reason when I click on something else the object goes back to its original name. I have also tried right clicking and change the name there as well as in the binding tab. But still no luck.
    Weirdly, I can change the names of other objects in the hierarchy, just not any of the ones I need to. Any idea's?

    I have never heard of this before ...can you send the form to [email protected] and I will have a look. Please indicate which field is causing you the grief.
    Paul

  • Pulling a value from a field for a SQL statement

    How do i pull the value from a Formatted Text Field into a sql query? Im trying to create an interface to allow a user to put the first name in a field then poll the database for anyone of that name. I do not know of how to get the value that is put in the field by the user.

    Roy, can you give more details about what version of JDeveloper you are using?

  • How to change field size using SQL against an oracle Database

    I am an admitted novice user, looking to become more proficient.
    I have a field in a table that I need to expand the field size. The table is called Inquiries. The data type is text. The current Field Size is 10. I want to increase it, to either the max, or somethign long enough to fit TECHNOLOGY LEADERSHIP PROGRAM.
    What is the SQL command to change the field size, and what is the max for a Text Field Size

    And/Or, an even better question might be,
    Do I need to use SQL*PLUS to do this, or are there better tools. I.e, I like how in Access, you can open up a database in Design view and just change the amount for the field size. Is there a similar "easy" method to do something like that with an Oracle database.
    My current version of the server/database is:
    Connected to:
    Oracle9i Enterprise Edition Release 9.2.0.6.0 - Production
    With the Partitioning option
    JServer Release 9.2.0.6.0 - Production
    I was thinking I had to do SQL commands to perform the action, but there may be another way that I am not thinking about with all of the tools at my disposal. When I installed Oracle on my desktop, I installed most of the management tools and networking services, if that helps

  • How to set Query SQL Statement parameter dynamically in Sender JDBCAdpter

    Hi All,
    I have one scenario in which we are using JDBC Sender Adapter.
    Now in this case,we need to set Query SQL Statement with a SELECT statement based on some fields.
    This SQL statement is not constant, it would need to be changed.
    Means sometimes receiver will want to execute SQL statement with these fields and sometimes they will want to execute it with different fields.
    We can create separate channels for each SQL statement but again that is not an optimum solution.
    So ,I am looking out for a way to set these parameters dynamically or set SQL statement at Runtime.
    Can you all please help me to get this?

    Shweta ,
    <i>Sometimes receiver will want to execute SQL statement dynamically</i>....
    How you will get the query dynamically? Ok Let me assume, consider they are sending the query through file, then its definitely possible. But u need BPM and also not sender JDBC receiver adapter instead, receiver JDBC adapter.
    SQL Query File ->BPM>Synchronous send [Fetch data from DB]--->Response -
    >...............
    Do u think the above design will suit's ur case!!!!
    Best regards,
    raj.

  • Hash in database field name

    I have a field name that has a hash (#) symbol in the name. I
    have no control over the naming structure of this particular
    database. I need to output this field. How the heck do I do this? I
    know how if the output has a # in it, but what about the actual
    field name?
    Thanks,

    Your best bet is to alias the field name in SQL before you
    start dealing with your recordset in CF. You should be able to
    escape the hash using ## instead of #.
    If for some reason you can't alias the field name in your SQL
    statement, you can output query data in the following format:
    QueryName["FieldName"][RowNumber]
    I bet you can do something like this:
    qMyQuery["Hash##Field"][1]

  • Change in Name Format

    Hi Experts,
    We have a requirement. It is change in Name Format.
    The name format for the employees who belongs to other country personnel areas to be changed to show the Form of Address, First Name & Last Name in Infotype 0002- Personal Data.
    I have made changes in the IMG and try to see the reflection in PA30, but of no use.
    Could you anyone help me in this with your valuable suggestions.
    Regards,
    Sekhar.
    Edited by: SekharRHR on Jun 7, 2011 3:32 PM

    It can be done through CMOD... by changing field name..
    Please follow the following instructions.
    Enter infotype 0002 and go Last name and press F1.
    Select the Technical information and copy the "Data Element" for that particular field.
    Enter T-code cmod
    Now select from above menu GO TO then Text Enhancements then Key words then Change.
    Now Enter the Data Element and change the last name into first name..
    Repeat the same behavoiur for other field.
    Regards,
    Uzair

  • Database Control - Dynamically setting the @jc.sql statement 'attribute' ?

    Hi,
    I have a JCX file that extends a database control. I wan't to be able to set the
    @jc.sql statement 'attribute' value dynamically. There does not seem to be a setProperty()
    api in the
    DatabaseControl (interface) like there is in some other types of control (e.g.,
    FileControl).
    The code extract below sets the value statically, however I wan't to be able to
    set this for the method dynamically (say at runtime) and not necessary at design
    time...
    I would really appreciate, if someone knows any way that this is possible ...
    Thanks very much,
    Vishwa
    CODE EXTRACT >>>>>>..public interface PointBaseCustomersControl extends DatabaseControl, com.bea.control.ControlExtension
    // Sample database function. Uncomment to use
    // static public class Customer
    // public int id;
    // public String name;
    // * @jc:sql statement="SELECT ID, NAME FROM CUSTOMERS WHERE ID = {id}"
    // Customer findCustomer(int id);
    // Add "throws SQLException" to request that SQLExeptions be thrown on errors.
    static final long serialVersionUID = 1L;
    * @jc:sql statement="SELECT * FROM CUSTOMER"
    PointBaseCustomersDocument getCustomers();

    Hello again,
    I need some help. I recreated the SQL Inserts with VS 2005
    and am not doing something right. I got this from MSDN on how to
    insert records using the SQLdataSource Control. Here's what I got,
    but I get an exception error Message: ORA-01036: illegal variable
    name/number. I know this is an Adobe forum, but this is a basic
    ASP.NET question. I'm queying WMI to retrieve computer information
    that I send to the TextBoxes. Any help would be appreciated.
    protected void bnSubmit_click(object sender, EventArgs e)
    SqlDataSource1.Insert();
    <asp:SqlDataSource ID="SqlDataSource1" runat="server"
    ConnectionString="<%$ ConnectionStrings:CAT %>"
    ProviderName="<%$ ConnectionStrings:CAT.ProviderName
    %>" SelectCommand='SELECT * FROM "HARDWARE"'
    InsertCommand="INSERT INTO HARDWARE(SERVICE_TAG, MANUFACTURER,
    MODEL, OS, SERVICE_PACK, PROC, RAM, HDD, LAN, LAN_MAC, WIFI,
    WIFI_MAC, HDD_SIZE) VALUES
    (@SERVICE_TAG,@MANUFACTURER,@MODEL,@OS,@SERVICE_PACK,@PROC,@RAM,@HDD,@LAN,@LAN_MAC,@WIFI, @WIFI_MAC,@HDD_SIZE)">
    <insertparameters>
    <asp:formparameter name="SERVICE_TAG" formfield="txtSt"
    Type="String" />
    <asp:formparameter name="MANUFACTURER" formfield="txtMf"
    Type="String" />
    <asp:formparameter name="MODEL" formfield="txtMd"
    Type="String" />
    <asp:formparameter name="OS" formfield="txtOs"
    Type="String"/>
    <asp:formparameter name="SERVICE_PACK" formfield="txtSp"
    Type="String" />
    <asp:formparameter name="PROC" formfield="txtProc"
    Type="String"/>
    <asp:formparameter name="RAM" formfield="txtMem"
    Type="String"/>
    <asp:formparameter name="HDD" formfield="txtHdd"
    Type="String"/>
    <asp:formparameter name="LAN" formfield="txtLan"
    Type="String"/>
    <asp:formparameter name="LAN_MAC" formfield="txtLmac"
    Type="String"/>
    <asp:formparameter name="WIFI" formfield="txtWlan"
    Type="String"/>
    <asp:formparameter name="WIFI_MAC" formfield="txtLmac"
    Type="String"/>
    <asp:formparameter name="HDD_SIZE" formfield="txtHds"
    Type="String"/>
    </insertparameters>
    </asp:SqlDataSource>

  • Trying to reference field name of my record Type in my procedure!

    Hello,
    I am stuck. I am trying to reference field names in my record type declared in my Package declaration.
    Here is an example. Don't be scared, it's a very simple package. I just need some directions what to use to accomplish this.
    --look into this part of the package body
    FOR cur_rate IN c_rate
    LOOP
    rate_data(1).field_name := cur_rate.rate_pct;
    --field name = AK_PCT, AL_PCT and so on ...
    END LOOP;
    END rate_tab_qry;
    CREATE OR REPLACE PACKAGE rate_pkg IS
    TYPE rate_rec IS RECORD (
    id cycle_rates.id%TYPE
    ,cycle cycle_rates.cycle%TYPE
    ,scac cycle_rates.scac%TYPE
    ,gbloc cycle_rates.gbloc%TYPE
    ,code cycle_rates.code%TYPE
    ,AK_PCT cycle_rates.rate_pct%TYPE
    ,AL_PCT cycle_rates.rate_pct%TYPE
    ,AR_PCT cycle_rates.rate_pct%TYPE
    ,so on...
    TYPE cycle_rate_tab IS TABLE OF rate_rec INDEX BY BINARY_INTEGER;
    PROCEDURE rate_tab_qry(rate_data IN OUT cycle_rate_tab,
    p_id cycle_rates.id%TYPE,
    p_cycle cycle_rates.cycle%TYPE,
    p_scac cycle_rates.scac%TYPE,
    p_gbloc cycle_rates.gbloc%TYPE,
    p_code cycle_rates.code%TYPE);
    END;
    CREATE OR REPLACE PACKAGE BODY rate_pkg IS
    PROCEDURE rate_tab_qry(rate_data IN OUT cycle_rate_tab,
    p_id cycle_rates.id%TYPE,
    p_cycle cycle_rates.cycle%TYPE,
    p_scac cycle_rates.scac%TYPE,
    p_gbloc cycle_rates.gbloc%TYPE,
    p_code cycle_rates.code%TYPE)
    IS
    CURSOR c_rate IS
    SELECT state, rate_pct
    FROM cycle_rates
    WHERE cycle = p_cycle
    AND scac = p_scac
    AND gbloc = p_gbloc
    AND code = p_code;
    BEGIN
    rate_data(1).id := p_id;
    rate_data(1).cycle := p_cycle;
    rate_data(1).scac := p_scac;
    rate_data(1).gbloc := p_gbloc;
    rate_data(1).code := p_code;
    FOR cur_rate IN c_rate
    LOOP
    rate_data(1).field_name := cur_rate.rate_pct;
    --field name = AK_PCT, AL_PCT and so on ...
    END LOOP;
    END rate_tab_qry;
    I need to know, how to reference my field name for each state in my procedure that are in my record type. The problem is it won't allow me to use something like this.
    select state || '_PCT
    from cycle_rates;
    which would eventually show me each state concatenated with '_PCT, e.g. AK_PCT and that's my field names.
    For example,
    FOR cur_rate IN c_rate
    LOOP
    rate_data(1).field_name := cur_rate.rate_pct;
    --field_name = AK_PCT, AL_PCT and so on...
    END LOOP;
    I would appreciate it if somene can direct me. Thanks.
    Message was edited by:
    [email protected]

    This is a sample output from my cusror. Just to make it easier for you guys to see it.
    ST RATE_PCT
    AK 0
    AL 2
    AR 2
    AZ 2
    CA 2
    CO 2
    CT 2
    DC 2
    DE 2
    FL 2
    Hope it helps.

  • About hints in sql statements

    hi,
    can you plz provide any best sides for sql hints?

    Suri wrote:
    You can learn basics from below site.
    http://www.dbasupport.com/oracle/ora9i/index_hints.shtml
    What an awful article...
    >
    Using Index Hints in SQL statements - Cause we know more about our application than Oracle does
    Hints are used to give specific information that we know about our data and application, to Oracle. This further improves the performance of our system. There can be instances where the default optimizer may not be efficient for a certain SQL statements. We can specify HINTS with the SQL statements, to improve the efficiency of those SQL statements.
    <cut>
    By using Hints, you can improve certain SQL statements that might otherwise be inefficient.
    >
    That is just so wrong and completely misses the point.
    If a query is inefficient, then it can be down to poor database design, lack of statistics, lack of correct indexes (sometimes too many indexes), or poorly written SQL statements. Hacking an SQL statement with Hints to try and make it work better because you believe you "know more about our application than Oracle does", shows a complete lack of understanding of the internals of Oracle. Oracle doesn't need to know about the application, but it certainly does need to know about how the data is stored and related on the underlying tables and in the tablespaces and datafiles etc. and it's sure as hell got a better idea about that than any programmer, especially as it can change and adapt in the future as the data changes, which a programmers SQL statements (with fixed hints) won't.
    That article is a good example of the wrong attitude towards using hints. Thanks for posting that to demonstrate it.

  • Strage Performance Problems with SQL Statements....

    Hi,
    I have realized a strange performance collapse while changing simple things in SQL Statements...
    I have build a simple Statement:
    SELECT
    a.AAA,
    a.BBB,
    a.CCC,
    b.AAA
    from
    TABLE_A a,
    TABLE_B b,
    TABLE_C c
    where
    a.XXX=b.XXX
    and c.XXX = a.XXX
    and c.yyy = 'SOMETHING'
    Its very fast, even with complex XSL Transformations...
    After Putting a GROUP BY or DISTINCT into the statement (to surpress Dataset "Clones") it tooks around 100 times more Time then before....
    I have tested the statement in a SQLPlus, it was as fast as before, but in the XMLPublisher it tooks much longer.....
    Have you realizesd this Problem before?
    Greetings...

    PROBLEM SOLVED !
    It has to be 8.1.6 across the whole environment.
    null

Maybe you are looking for

  • Figuring out how to access a device using Windows.Devices.HumanInterfaceDevice?

    Before I start, I would like to share this link I used to access windows RT libraries from Desktop applications (only the ones stated in MSDN documentation that are accessible from desktop applications): http://blogs.msdn.com/b/cdndevs/archive/2013/1

  • ESB/File Adapter - XML files containing multiple messages

    Hi, In all the examples on file adapters I read, if files contain multiple messages, it always concerns non-XML files, such as CSV files. In our case, we have an XML file containing multiple messages, which we want to process separately (not in a bat

  • Complexities of Migrating Oracle 10g from Solaris to HP-UX Itanium

    Can anyone share their experiences with regards to migrating Oracle 10g from Solaris on a Sun platform to HP-UX 11i v3 (Itanium) on HP Integrity servers. We are trying to consider all the risks associated with such a move. How much time delay did you

  • Sync HP IPAQ (Mobile Pocket PC - H5550) and Minidisc Walkman to iMac

    Having just moved from PC to MAC, I have a few questions.... I used to sync my IPAQ with PS using Active Sync. iSync doesn't appear to handle the IPAQ - is there a simple/free plug in needed? If full sync is not possible then I would like to at least

  • IS-Reail: BAPI_MATERIAL_MAINTAINDATA_RT

    Hello, I am trying ot create a new article (material) by using BAPI_MATERIAL_MAINTAINDATA_RT. Is that the right BAPI to do this? The material get's created, but if I try to change it in MM42 I get the following error message: Message no. MH084: Assig