How to change the name of the column for dynamic query

I would like to change the name of the column name to bidderone, biddertwo and bidderthree. the only problem is the vendors name unknown when I run the query and sometimes the query returns two vendors. the maximum vendor is three. here is the query and please let me know how this can be done. thank you so much. I am using oracle 10i
FOR lv_rec IN   ( SELECT vendor, calcbtot
  FROM (SELECT t.*, ROW_NUMBER () OVER (ORDER BY t.calcbtot Asc) rn
          FROM (  SELECT DISTINCT
                         s.vendor,
                         TO_CHAR (s.calcbtot, '999,999,999.00') calcbtot
                    FROM bidtabs b, bidders s
                   WHERE     b.CALL = s.CALL
                         AND b.letting = s.letting
                         AND b.vendor = s.vendor
                         AND b.letting = v_letting
                         AND b.CALL = v_call
                ORDER BY 2) t)
WHERE rn <= 3 )                 
   LOOP
      lv_sql :=
            lv_sql  || ', TO_CHAR(MAX(DECODE(TRIM(S.VENDOR),'''|| TRIM (lv_rec.vendor) || ''', S.BIDPRICE)),  ''$999,999,999.00'') AS "'|| TRIM (lv_rec.vendor) ||'" ';
   END LOOP;

thank you so so much for your help on this. I am sorry i did not post the entire code. my intention is to use bidderone, biddertwo,bidderthree as a column name insead of the name of the vendors and also calcuate the average of the three vendors. the maximum vendor will be three but the minumum could be one or two. hope this is enought information to help me out further . thank you
CREATE OR REPLACE PROCEDURE biddersquoteforbridge (
   p_spnumber   IN       VARCHAR2,
   p_result     OUT      sys_refcursor
IS
   v_letting   VARCHAR2 (40);
   v_call      VARCHAR2 (40);
   lv_sql      VARCHAR2 (32767) := NULL;
BEGIN
   SELECT DISTINCT L.LETTING, CALL
              INTO v_letting, v_call
              FROM LETPROP L, PROPOSAL P
             WHERE L.LCONTID = P.CONTID AND CPROJNUM= p_spnumber;
   lv_sql :=
      'SELECT   O.PRPITEM "Item Number",
                INITCAP(FUNC_GET_ITEM_DESCRIPTION(O.PRPITEM)) "Description",
                O.CONTID "Contract Id",O.SECTION "Section" , P.CPROJNUM "SP Number", P.CFACSSUP "District",
                FUNCT_GET_SECTION_IDENTIFIER(O.SECTION, O.CONTID) "Section Title",  ''Q''||(TO_CHAR(D.DATELET, ''Q-YYYY'')) "Quarter",
                O.IPLINENO "Line Number", O.QTY "Quantity" ';
  FOR lv_rec IN   ( SELECT vendor, calcbtot
  FROM (SELECT t.*, ROW_NUMBER () OVER (ORDER BY t.calcbtot Asc) rn
          FROM (  SELECT DISTINCT
                         s.vendor,
                         TO_CHAR (s.calcbtot, '999,999,999.00') calcbtot
                    FROM bidtabs b, bidders s
                   WHERE     b.CALL = s.CALL
                         AND b.letting = s.letting
                         AND b.vendor = s.vendor
                         AND b.letting = v_letting
                         AND b.CALL = v_call
                ORDER BY 2) t)
WHERE rn <= 3 )                 
   LOOP
      lv_sql :=
            lv_sql  || ', TO_CHAR(MAX(DECODE(TRIM(S.VENDOR),'''|| TRIM (lv_rec.vendor) || ''', S.BIDPRICE)),  ''$999,999,999.00'') AS "'|| TRIM (lv_rec.vendor) ||'" ';
   END LOOP;
   lv_sql :=
         lv_sql
      || '
        FROM   PROPITEM O  ,                   
               PROPOSAL P  ,
               LETPROP  L  ,
               BIDDERS  B  ,
               BIDTABS  S  ,
               BIDLET   D
         WHERE O.CONTID = P.CONTID
                AND P.CONTID = L.LCONTID
                AND L.CALL = B.CALL
                AND L.LETTING = B.LETTING
                AND B.CALL = S.CALL             
                AND B.LETTING = S.LETTING
                AND B.VENDOR = S.VENDOR 
                AND S.IPLINENO = O.IPLINENO
                AND L.LETTING = D.LETTING             
                AND O.LINEFLAG =''L''    
                AND L.LETTING = :B1
                AND L.CALL = :B2
         GROUP BY
               O.CONTID,
               O.SECTION,
               O.IPLINENO,
               O.PRPITEM,
               O.QTY,
               P.CPROJNUM,
               P.CFACSSUP,
               O.PRICE ,
               D.DATELET             
         ORDER BY O.IPLINENO ';
  -- DBMS_OUTPUT.put_line (lv_sql);
   OPEN p_result FOR lv_sql USING v_letting, v_call;
END;

Similar Messages

  • How to change display name of the attachment item attribute.

    Hello Experts
    I have a requirement to send a notification with attachment but attachment name should be attachment name,
    Is there any way to change the display name of the Attachment
    Please advise;
    Thanks
    Rajesh.

    Azmathulla,
    It is not possible to change the name of the server, but you can add a label to it (see attached screenshot).  And yes, it can be done during production hours, this doesn't affect the production data.
    Please let me know if this answers your question.

  • Desktop shows only Icons with WEBLOC how to change these names to the website names

    In the latest vesion downloaded in Mavericks, all my web Icons on my desktop changed to a blue pictue with WEBLOC in the middle.  How can I remove
    those WEBLOC icons and replace with my web icons from my websites?? I normally just drag the web icon from the address bar to desk top and click it.
    Now all of them only will show  the Icon webloc? This happened on the last download version. I had ask someone in apple chat about this, and
    got cut off and they have never responded to me, its been a week?? Poor chat service.

    Do a backup.
    Go to Finder and select your user/home folder. With that Finder window as the front window, either select Finder/View/Show View options or go command - J.  When the View options opens, check ’Show Library Folder’. That should make your user library folder visible in your user/home folder.  Select Library. Then go to Preferences/com.apple.finder.plist and com.apple.desktop.plist.  Move the .plists to your desktop.
    Re-launch Finder by restarting the computer and test. If it works okay, delete the plists from the desktop.
    If the same, return the .plists to where you got it  from, overwriting the newer one.
    Thanks to leonie for some information contained in this. 

  • How to split 'Full Name' into two columns for 'First' and 'Last' name??

    Any ideas on how to achieve this? http://office.microsoft.com/en-us/excel-help/split-names-by-using-convert-text-t o-columns-HA001149851.aspx

    If:
    A1 = Fistname Lastname
    For firstname:
    (First Name) B1 =SUBSTITUTE($A1," " & $C1, "")
    For the Last name:
    (Last Name) C1 =RIGHT(A1,LEN(A1)-FIND("#",SUBSTITUTE(A1," ","#",LEN(A1)-LEN(SUBSTITUTE(A1," ","")))))
    If
    A1 = Lastname, Firstname
    (Last Name) B1 =SUBSTITUTE($A1,", " & $C1, "")
    (First Name) C1 =RIGHT($A1,LEN($A1)-FIND("#",SUBSTITUTE($A1," ","#",LEN($A1)-LEN(SUBSTITUTE($A1," ","")))))
    Let me know if you need one that traps multiple commas or middle names.

  • Can I Change My name in the Profile

    Hi All,
    Don't mine any one that  I Asked this Q here
    How To Change My Name in the SDN Profile ???
    I Given My Pet name At the Time of Registration in SDN.
    So I Want to Change My Display Name As Wel As The name in the Database
    I Tried Like this
    GotoMy Profile-Update Profile
    Here I Changed First name Last name Display Name
    I Logoff the User
    Then Dispaly name Has been Changed But In My Postings my old name is Remains Same
    I Want to See the Changes to Those Also
    Please Let me Know
    Regards
    Vamsi

    Vamsi,
    <b><i>Then Dispaly name Has been Changed But In My Postings my old name is Remains Same</i></b>
    Where u are seeing ur old name in ur thread? Please make sure only the display will change not the contents which u wrote in ur questions/replies. Like Best regards Vamsi, this one u are referring to? If yes then it won't changes.
    Best regards,
    raj.

  • How can i set a column which would show me the name of the user

    how can i write a trigger which would show me the name of the user now make changes in the table.

    872959 wrote:
    how can i write a trigger which would show me the name of the user now make changes in the table.I think what sb is trying to say is: if you mean the database user, you can use the USER session variable to identify the database user:
    http://download.oracle.com/docs/cd/E11882_01/server.112/e17118/functions227.htm#SQLRF06156
    you would write a before each row trigger to update an "updated_by" column on your table to be USER.
    e.g.:
    :new.updated_by := USER;

  • Tracking the name of the column that is changed

    hi
    How i can track the following information about a table
    say i hve the table name tab1 which is like this
    col1 col2
    1 2
    Now if i change the value of col1 by a trigger i can track the change value but how can i track the name of the column
    say in the table tab2 i am tracking the result
    changed_col_name changed_val prev_val
    now changed val and prevval can be tracked by trigger but in the column changed_col_name how i can track the name of the column which i changed?
    Thanx in advance

    You are being rather unclear here.
    If you change the name of a column your trigger will need to be amended. I don't think you're actually asking to track changing actual column names.
    What you require is to track value changes and want to know how to assign which value to which column.
    each value is associated with a column, therefore if you track that the 5th value in your value clause has changed that means that the column that is affected is the 5th column in your column list.
    A simple if block would do the trick.
    But probably a better suggestion is to store the rows in a history table.
    Each time theres a change insert into the history table (which has its key column based on a sequence or a timestamp)
    Then to see whats changed you can merely compare the current row to the previous row

  • How can I change the name of the administrator that shows on Home Icon?

    Hello
    I've bought this laptop from a reliable source, went to the Apple Store (Regent St) with the box and they registered it in my name, address and so on. No problems, the mac works fine.
    However, the Home/Icon and administrator is in the name of the old owner. Obviously, he gave me the password. But, I really want to have my name on it.
    I've the box, the discs and all the books. Everything is in really good conditions.
    I read the manuals, the instructions are straight forward but on the net and forum related mac, I can see that are lots of people having problems when they reboot and are unable to login and so on...
    The genius bar at the Apple Store is okay, but the staff main objective is to sell and they are not very patient and neither have much time for you. Normally I end up leaving the store with software that I don't have a clue how to use and the problem unsolved. And it stresses me out.
    Can someone help me please.
    Thank you
    Best regards

    1. Yes, just the Shortname will be changed.
    2. Not easier, but you can do that if you wish.
    since I'm in the official Mac support forum should I expect to receive a reply from a Mac expert staff or it is unlikely to happen?
    Just other Users here like you, trying to help other users. For a real Apple answer I think you have to call AppleCare, but rarely an Apple Host pops in... wouldn't expect it in this case though.
    I do thank you for the info about your software and obviously will make a donation if everything works fine.
    Not mine, but a worhy piece of SW just the same.

  • Existing cross Reference: how to change the name of the file it refers to?

    Hi everybody,
    I am a professional translator.
    One client of mine sent me a complete FrameMaker 9 book file for translation.
    I translated the content via a CAT-Tool and now am in the process of checking if cross references and markers are ok directly into the file.
    I noticed that many cross references are linked to another file of the book. But in the process of translating each file separately, I gave them a slightly different name (I added the language at the end) so as to be able to recognise them eventually.
    Now I have this problem: I cannot find in the cross reference interface where to change the name of the file into the new one the cross reference is supposed to refer to.
    Am I right in wanting to change the file reference? If so, how do I do that?
    Or is it better to avoid this task and rename the translated file into their original names ? Would it work then?
    Thanks for your help.

    ... book file ...
    ...  each file separately, I gave  them a slightly different name (I added the language at the end) ...
    I'm guessing that you renamed the component files by means other than using the Edit > Rename File from the Book menu.
    If so, do over. Rename from the Book menu. It automatically revises all the cross-references in all the component files.
    In a Book, the only thing that's safe to rename with the file manager is the .book file itself.

  • How to change the name of the Mac I connect to in the drop-down window.

    Using my brand new MacBook, in the drop down menu when I connect to my iMac, it shows up as my name ( which is Derek Walton's Computer) ...... How can I change the name that shows up here? I have tried all areas that iI can think of and altered my name on the iMac but to no avail - e.g. - Network Sharing, Account Name, and so on.... anything anywhere I have changed... but it always shows up with my full name. I have however managed to get the name in the sidebar of the Leopard window to read as I want ( Derek's iMac) but that is all.
    Also, when I am using Airport on my MacBook, in the drop-down menu I see also other neighbours connections.... I am wondering therefore does it follow that they can see my wireless connection ( as Derel Waltons Computer)?
    This has been vexing me all night and I am geting very frustrated, but I bet there is a simple answer..... for those that know!
    Thanks in advance for any help you care to put my way.
    Derek

    It is not a simple issue. Not the same as changing a user account in Preferences. Ttry this link:
    http://docs.info.apple.com/article.html?artnum=106824

  • I found the solution to a Mavericks bug on the Mail program. How can I share it? Several of my mail boxes stopped functioning properly when I updated to Mavericks. After long hours, I discovered that if I change the name of the mailbox, the content works.

    I found the solution to a Mavericks bug on the Mail program. How can I share it? Several of my mail boxes stopped functioning properly when I updated to Mavericks. The title of the mails stored in the mailbox appear, but the content was unavailable.
    After 4 long hours at the phone with the Apple staff unable to help me, I discovered that if I change the name of the mailbox, the contents of the mails stored there become available.
    Please, make this solution available to other people!

    You have found the the way to share it.   Include your problem and its solution in a forum post in the Mavericks forums.   Then mark you own post with a green solved star.
    Note.  You won't get any points for that; points are only awarded where you mark someone else's post as either helpful or solved.

  • How does one change the name of the home folder?

    I would like to change the name of the administrator and home folder on one of my computers. How is this accomplished?
    I'd be most grateful for some help with this.
    Thanks.

    Macworld | Changing the short username in Leopard. Use the last procedure, "The Full Monty."

  • How do I change the name of the Home folder OSX 10.9

    Hi there,
    I am trying to change the name of the Home folder on my Macbook Pro running OSX 10.9  I had a clean install of 10.9, and used migration assistant to restore my settings from a Time Machine Backup. 
    The problem is that the Home folder for my user is now named "Cody 1" when it used to be "Cody".  This seems like a minor issue, but all the programs that reference data in the old location, are forcing me to go and find the data manually.  Everything from iPhoto to VirtualBox, all files have to be found manually. 
    I have tried the instructions set forth in this article, http://support.apple.com/kb/ht1428, but the dialog that should, according to the article, allow me to redirect the account to the existing folder, returns an error saying that the user name is already in use.  There is no option to use the existing folder.  I have tried re-naming the folder to something different, to no avail. 
    Ideas?
    Thanks in advance. 
    -Cody

    The Apple Support document you referenced is cumbersome, outdated, buggy, and too likely to result in the sort of problems you described.
    It may be too late now but see the following:
    Niel's post here: How to change name of home folder
    and:
    Apple Support Communities contributor Pondini found an astonishingly simple way to accomplish what you seek. etresoft distilled that information into the following User Tip:
    Changing user account short name
    Note that he writes it has been tested on Mountain Lion but the procedure appears sound and should work equally well with Mavericks.
    Back up your system before doing either one.
    To fix what happened might be possible in Single user mode. I don't have specific instructions but you should be able to find and delete user accounts in the /Users directory.
    Type carefully and don't proceed without knowing the risks.

  • How do you change the name of the owner on the I Pad

    How do you change the name of the owner on the I Pad?

    plug it into itunes and click on the ipad s name 3 times and then you can change the name to whatever youn like

  • For those who have problems RE: My iPhone 4 on connecting to my pc shows my friends name in the DIGITAL camera Drive..It dsiplays my correct name when I`m on iTunes..PLEASE HELP ME HOW DO I CHANGE THE NAME IN THE DIGITAL CAMERA DRIVE??

    For those who have problems RE: My iPhone 4 connecting to my pc shows my friends name in the DIGITAL camera Drive..It dsiplays my correct name when I`m on iTunes..PLEASE HELP ME HOW DO I CHANGE THE NAME IN THE DIGITAL CAMERA DRIVE??
    SOLUTION:
    Iam pointing t0 windows7 os.
    1) go to control panel
    2) open hardware and sound
    3) In that open Devices and printers
    4)In that u can find Apple Iphone.
    5) now right click on this --> Hardware --> Properties --> General --> Uninstall --> ok.
    6) now unplug and plug in ur iphone again.There u go u iphone name changes to its original name.

    I am having this problem.  At first with the new iPhone 5, and then with the iPad 2.  I am not sure why this is happening. 
    My gut feeling is this is an iO6 issue and here's why -
    The problem mainly occurs with apps.  I have about 150 apps, and when I plugged in the phone, iTunes went to sync all of them.  The process would hang up after about 20 - 30 apps were loaded onto the phone. I could tell where about the process hung up because the apps on the phone showed up as "waiting".
    Then on the iPad 2 I plugged in to sync and saw there was a huge "Other" component in my storage.  It required me to restore the iPad 2 from backup.  With this restore the same issues occurred - putting the apps back on the iPad would hang up.  The videos on the iPad also got stuck - maybe after about 10 hours of videos transfered iTunes crashed.
    My solution has been to soft reset the device, restart Windows, and continue the process until it's complete.  This is remarkably inefficient and time-intensive but everything works with patience.
    I have been wondering if others have had these same problems. 

Maybe you are looking for

  • IPod touch not recognized after upgrading to Mac OS X 10.5

    Hello I recently upgraded my macbook pro to os x and now my ipod touch is not connecting to itunes. I'v reset my ipod touch and now when i plug it in nothing happens still. This is quite distressing as Im addicted to my ipod. Any help would be greatl

  • Find the location where forms is installed

    I want to run a report directly from form without showing parameter form. For this i use HOST('c:\orawin95\bin\r22run32.exe report = path of report userid = ' || get_application_property(username) || '/' || get_application_property(password) ||'/'||

  • Getting error in this code

    Hi, please dont consider about the performence in this case. i have a delete statement DELETE FROM GSM_ITEM_INFO WHERE EXPIRE_TIME<SYSDATE-1; this delete statement may delete millions of records,i should not delete all the records at a time. i have t

  • Portal Test Connection Failed for JDBC Connector

    Hi, We are trying to create a JDBC system in EP to connect SQL Server 2005 database. Our aim is to build a model in VC using data services from SQL Server 2005. We deployed the Driver file sqljdbc.jar  and connection was successful when tested by cre

  • COPA Realignment in R/3

    Hi friends, I have one doubt in the Realignment activity... 1. After the completion of Realignment , i have checked the TKEBWL table in R/3... It was showing that the DIRTY FLAG is empty for certain COPA datasources.... Why some COPA datasources havi