Gettting columns_names and their values

Hi,
I need to write a query that takes all the columns of a table and store them on a collection of column_name, Column_value. The table name and the Where Clause may vary so i need to use dynamic sql.
My query will look like this;
SELECT *
   FROM xxx_table
WHERE xx_column = ?? AND yy_Column = ?? .... --Conditions are dynamic and available only the time of execution. After executing this statement i need to know colunmn_names and the values which returned from above query.
As far as i know * statement tells oracle that get all columns of that table from user_tab_columns table ordered by their column_id. So may achieve my goal like this;
DECLARE
   Key_Val_Arr IS TYPE OF VARCHAR2(50) INDEXED BY VARCHAR2;
   my_table_row_type xxx_table%rowtype; 
   SELECT * INTO my_table_row_type
     FROM xxx_table
  WHERE ......;
  For  rec IN  (SELECT column_name, column_id FROM user_tab_columns WHERE table_name = 'XXX_TABLE'  )
  LOOP
     Key_Val_Arr (rec.column_name ) = my_table_row_type(column_id); --Or something like that. Syntax may be incorrect, but please consider the idea
  END LOOP;
END;Any suggestions will help
Thanks in advance
Edited by: 991792 on Mar 5, 2013 3:44 AM

991792 wrote:
Hi,
I need to write a query that takes all the columns of a table and store them on a collection of column_name, Column_value.Why would you want to do that? That's not a good way to store data, and makes it a nightmare to access later.
The table name and the Where Clause may vary so i need to use dynamic sql.
My query will look like this;
SELECT *
FROM xxx_table
WHERE xx_column = ?? AND yy_Column = ?? .... --Conditions are dynamic and available only the time of execution.
After executing this statement i need to know colunmn_names and the values which returned from above query.
As far as i know * statement tells oracle that get all columns of that table from user_tab_columns table ordered by their column_id. So may achieve my goal like this;
DECLARE
Key_Val_Arr IS TYPE OF VARCHAR2(50) INDEXED BY VARCHAR2;
my_table_row_type xxx_table%rowtype;
SELECT * INTO my_table_row_type
FROM xxx_table
WHERE ......;
For rec IN (SELECT column_name, column_id FROM user_tab_columns WHERE table_name = 'XXX_TABLE' )
LOOP
Key_Val_Arr (rec.column_name ) = my_table_row_type(column_id); --Or something like that. Syntax may be incorrect, but please consider the idea
END LOOP;
END;Ok, you're right that you would need dynamic SQL for your dynamic conditions in your query, but if you also don't know the column names at design time, and it's important to find those out, then you'll need to get into the detail using the DBMS_SQL package. An example of using that, to take a query and output the columns and data as CSV (from my standard library of examples...)...
As sys user:
CREATE OR REPLACE DIRECTORY TEST_DIR AS '\tmp\myfiles'
GRANT READ, WRITE ON DIRECTORY TEST_DIR TO myuser
/As myuser:
CREATE OR REPLACE PROCEDURE run_query(p_sql IN VARCHAR2
                                     ,p_dir IN VARCHAR2
                                     ,p_header_file IN VARCHAR2
                                     ,p_data_file IN VARCHAR2 := NULL) IS
  v_finaltxt  VARCHAR2(4000);
  v_v_val     VARCHAR2(4000);
  v_n_val     NUMBER;
  v_d_val     DATE;
  v_ret       NUMBER;
  c           NUMBER;
  d           NUMBER;
  col_cnt     INTEGER;
  f           BOOLEAN;
  rec_tab     DBMS_SQL.DESC_TAB;
  col_num     NUMBER;
  v_fh        UTL_FILE.FILE_TYPE;
  v_samefile  BOOLEAN := (NVL(p_data_file,p_header_file) = p_header_file);
BEGIN
  c := DBMS_SQL.OPEN_CURSOR;
  DBMS_SQL.PARSE(c, p_sql, DBMS_SQL.NATIVE);
  d := DBMS_SQL.EXECUTE(c);
  DBMS_SQL.DESCRIBE_COLUMNS(c, col_cnt, rec_tab);
  FOR j in 1..col_cnt
  LOOP
    CASE rec_tab(j).col_type
      WHEN 1 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_v_val,2000);
      WHEN 2 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_n_val);
      WHEN 12 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_d_val);
    ELSE
      DBMS_SQL.DEFINE_COLUMN(c,j,v_v_val,2000);
    END CASE;
  END LOOP;
  -- This part outputs the HEADER
  v_fh := UTL_FILE.FOPEN(upper(p_dir),p_header_file,'w',32767);
  FOR j in 1..col_cnt
  LOOP
    v_finaltxt := ltrim(v_finaltxt||','||lower(rec_tab(j).col_name),',');
  END LOOP;
  --  DBMS_OUTPUT.PUT_LINE(v_finaltxt);
  UTL_FILE.PUT_LINE(v_fh, v_finaltxt);
  IF NOT v_samefile THEN
    UTL_FILE.FCLOSE(v_fh);
  END IF;
  -- This part outputs the DATA
  IF NOT v_samefile THEN
    v_fh := UTL_FILE.FOPEN(upper(p_dir),p_data_file,'w',32767);
  END IF;
  LOOP
    v_ret := DBMS_SQL.FETCH_ROWS(c);
    EXIT WHEN v_ret = 0;
    v_finaltxt := NULL;
    FOR j in 1..col_cnt
    LOOP
      CASE rec_tab(j).col_type
        WHEN 1 THEN DBMS_SQL.COLUMN_VALUE(c,j,v_v_val);
                    v_finaltxt := ltrim(v_finaltxt||',"'||v_v_val||'"',',');
        WHEN 2 THEN DBMS_SQL.COLUMN_VALUE(c,j,v_n_val);
                    v_finaltxt := ltrim(v_finaltxt||','||v_n_val,',');
        WHEN 12 THEN DBMS_SQL.COLUMN_VALUE(c,j,v_d_val);
                    v_finaltxt := ltrim(v_finaltxt||','||to_char(v_d_val,'DD/MM/YYYY HH24:MI:SS'),',');
      ELSE
        DBMS_SQL.COLUMN_VALUE(c,j,v_v_val);
        v_finaltxt := ltrim(v_finaltxt||',"'||v_v_val||'"',',');
      END CASE;
    END LOOP;
  --  DBMS_OUTPUT.PUT_LINE(v_finaltxt);
    UTL_FILE.PUT_LINE(v_fh, v_finaltxt);
  END LOOP;
  UTL_FILE.FCLOSE(v_fh);
  DBMS_SQL.CLOSE_CURSOR(c);
END;This allows for the header row and the data to be written to seperate files if required.
e.g.
SQL> exec run_query('select * from emp','TEST_DIR','output.txt');
PL/SQL procedure successfully completed.Output.txt file contains:
empno,ename,job,mgr,hiredate,sal,comm,deptno
7369,"SMITH","CLERK",7902,17/12/1980 00:00:00,800,,20
7499,"ALLEN","SALESMAN",7698,20/02/1981 00:00:00,1600,300,30
7521,"WARD","SALESMAN",7698,22/02/1981 00:00:00,1250,500,30
7566,"JONES","MANAGER",7839,02/04/1981 00:00:00,2975,,20
7654,"MARTIN","SALESMAN",7698,28/09/1981 00:00:00,1250,1400,30
7698,"BLAKE","MANAGER",7839,01/05/1981 00:00:00,2850,,30
7782,"CLARK","MANAGER",7839,09/06/1981 00:00:00,2450,,10
7788,"SCOTT","ANALYST",7566,19/04/1987 00:00:00,3000,,20
7839,"KING","PRESIDENT",,17/11/1981 00:00:00,5000,,10
7844,"TURNER","SALESMAN",7698,08/09/1981 00:00:00,1500,0,30
7876,"ADAMS","CLERK",7788,23/05/1987 00:00:00,1100,,20
7900,"JAMES","CLERK",7698,03/12/1981 00:00:00,950,,30
7902,"FORD","ANALYST",7566,03/12/1981 00:00:00,3000,,20
7934,"MILLER","CLERK",7782,23/01/1982 00:00:00,1300,,10The procedure allows for the header and data to go to seperate files if required. Just specifying the "header" filename will put the header and data in the one file.
Adapt to output different datatypes and styles are required.
As you can see, you can get details of the column names, datatypes and fetch the data explicitly by column position rather than name.

Similar Messages

  • Characterstics and their values

    how can i assign class and their characterstics and their values using Material_maintain_dark.

    Hi,
    you can't.
    To create classification , use the Bapi BAPI_OBJCL_CREATE in a second step
    Regards
    DAvid

  • References to objects and variables and their values.

    When does declaring a primitive type, variable or object as another objectm primitive type, or variable assign the variable THAT VALUE, and when does it just make it another reference to that object. And when it DOES just refer to that object, how do I set it to the value instead of just a reference?
    I can elaborate if necessary. I hope I was clear enough

    KeganO wrote:
    Yes, that's very clear. So all I want to know now is, if I had in my code something like
    Point a = new Point(1, 1);
    then say 50 lines later, I want to create a new point object, with the same VALUE as a but does not refer to the same object. How would I do that?That depends on the class. Look at Point's docs. If it implements Cloneable, you can call clone(). If it has a constructor that takes a reference to a point as an argument (copy constructor), you can use that. Otherwise you'll have to extract the two values and call new Point(oldPointX, oldPointY).
    Some classes you might not be able to do it at all.
    There's no guaranteed way to do it provided by the language though. It all depends on whether the class is implemented to provide it.
    >
    Also, what are the code tags?When you put code into a forum message, in order to preserve formatting, you put it between [code] and [/code].
    [code]
    for (int i = 0; i < 10; i++) {
    if (something) {
    doStuff(i);
    [/code]
    becomes
    for (int i = 0; i < 10; i++) {
      if (something) {
        doStuff(i);
    }

  • Help required: Classes and class values for Func Loc

    Dear All,
    I have a requirement to get the classes and values associated with a functional location.
    Any idea how to get this data, as in IL03.
    Thanks,
    nsp.

    Hello nsp,
    You can try to check out the Function module ALM_ME_TOB_CLASSES to see how they fetched class, characteristics and their values.
    You can keep a break-point in this module and run MAM30_031_GETDETAIL and check how we can pass the appropriate values.
    However, above FMs are available from PI 2004.1 SP 14 of release 4.6c, 4.7 and 5.0.
    If you are in ERP 6.0, the FM's are available.
    Hope this helps
    Best Regards,
    Subhakanth

  • Display "group name" values and their average formulas (calculation of average age) on a single line or row

    <p>I have four groupings, Domain, Area, Priority (3rd level of grrouoping) and then Problem ID. Priority group could have values such as &#39;1&#39;, &#39;2&#39;, &#39;3&#39;, &#39;4&#39; and &#39;5&#39; with corresponding "average" age formula on these group level. values.</p><p>Example:  1         Avg Age= 30</p><p>               2         Avg Age= 45</p><p>               3         Avg Age= 69</p><p>Reguirement:  Display group name values and their corresponding average formula on a single line/row.</p><p>Sample Solution:   Priority 1 = 30, Priority 2 = 45, Priority 3 = 69 </p><p> ***solution above should be displayed/concatenated on one line.</p><p>Your help is greatly appreciated, thank you in advance.</p>

    So right now - your report looks like this
    GroupHeader 1
       GroupHeader 2
           Priority 1 = 50         (actual display of Group 3)
           Priority 2 = 75         (actual display of Group 3)
           Priority 3 = 45         (actual display of Group 3)
           Priority 4 = 9          (actual display of Group 3)
           Priority 5 = 8          (actual display of Group 3)
    And you want to change that so that it displays horizontally.
    If there will only ever be 5 priorities, I think I would cheat the system a bit.  Create a formula that runs at the group 3 level and dumps the values into 5 separate variables (formula below).
    Then create 5 separate display formulas and put them in Group Footer 2 (if you already have a GF2 - then create a second one and move it above your current GF2).  Suppress the G3 section and you should be close to what you are after (unless you also have detail sections, then we'll need to revisit).
    This could also be accomplished with a multi-column subreport at the G2 or G3 level if you need more flexibility.
    formula *******
    numbervar priority1;
    numbervar priority2;
    numbervar priority3;
    numbervar priority4;
    numbervar priority5;
    if {DB.Priority} = 1 then priority1:= {@avgGroupPriorityAvgAge}
    else if {DB.Priority} = 2 then priority2:= {@avgGroupPriorityAvgAge}
    else if {DB.Priority} = 3 then priority3:= {@avgGroupPriorityAvgAge}
    else if {DB.Priority} = 4 then priority4:= {@avgGroupPriorityAvgAge}
    else if {DB.Priority} = 5 then priority5:= {@avgGroupPriorityAvgAge}

  • HT4759 according to the tech specs' required to use iClode it seems that Apple is ignoring it's promisses to the their valued costumers since 2001..I have to go to an Apple store and buy a new MacBook and iPhone..mm yeah right we are all swimming in cash

    according to the tech specs' required to use iClode it seems that Apple is ignoring it's promisses to their valued costumers since 2001..I have to go to an Apple store and buy a new MacBook and iPhone..mm yeah right we are all swimming in cash. On June Apple had promissed it's old valued costumers that they can continue to access their Mac mail accounts via a browser. But hey ! why keep promisses. Now you need to purchase all the latest gadgets to use y'r Mac mail-iCloud. MOVING TO GMAIL !

    If you had a MobileMe account, and provided you migrated it to iCloud before 1 August, you can access your email at http://icloud.com on any modern browser. 10.7.2 minimum and iOS5 or 6 are required for the devices to use iCloud syncing and other facilities.
    If you have Tiger, Leopard or Snow Leopard you can set Mail up manually to access the email on an existing iCloud account:
    Entering iCloud email settings manually in Snow Leopard or Leopard
    Entering iCloud email settings manually in Tiger

  • NULL and Space value in ABAP

    Hi All,
           I like to know, is it NULL and Space value is same in ABAP, if it is not how to check null value.
    Thank you.
    Senthil

    everything is correct though some answers are not correct.
    A Database NULL value represents a field that has never been stored to database - this saving space, potentially.
    Usually all SAP tables are stored with all fields, empty fields are stored with their initial value.
    But: If a new table append is created and the newly-added fields do not have the 'initial value' marked in table definition, Oracle will just set NULL values for them.
    as mentioned: There is no NULL value to be stored in an ABAP field. The IS NULL comparison is valid only for WHERE clause in SELECT statement. WHERE field = space is different from WHERE field IS NULL. That's why you should check for both specially for appended table fields.
    If a record is selected (fulfilling another WHERE condition) into an internal table or work area, NULL values are convertted to their initial values anyway.
    Hope that sheds some light on the subject!
    regards,
    Clemens

  • Attributes and attribute values for a Product

    Hi all
    Is there any table or FM from where I can get a list of all the attributes and the attribute values linked to a particular product?
    I got tables which link product with Prod Category, Prod Category with Set types and so on.
    Could anyoe please provide me an FM which will give the attribute and its values for a particular product?
    Please help!!
    Regards
    Debolina

    Attributes created under s settype will be under the table with the name of that particular settype itself i.e Table name and the settype name are the same.
    The other part of your question of where to find the list of all settypes and their corresposing attributes, you can make use of COMM_PR_FRG_REL.
    Regards,
    Harshit

  • How to get key and text value of field "TNDRST" in VTTK from R/3 into BI

    There is one field call "TNDRST(Tender Status)" in SAP table VTTK in R/3. We can find  key value, but we are unable to find text for this field in VTTK. However we can see text value if we double click domain:TNDRST and go to value range.
    Questions, how to get key value and text of TNDRST together in BI. Do we need to create a master data source for TNDRST text information in R/3 and extracting into BI, if yes, how to? Are there any easy way to do it??
    Thanks,
    Sudree

    Hi Sudree,
    You need to create a generic Text Datasource to extract this information into BI System.
    1. Create a generic DS based on Table: DD07T
    2. The fields should be put in the extract structure.
              DOMNAME (Make this as Selection in the DS ) -
    Filter the Domain Name
              DOMVALUE_L -
    Key Value of Tender Status
              DDTEXT -
    Text / Description
              DDLANGUAGE -
    Language
    3. DD07T is the table with all the Domain names & their values, so in the Infopackage enter the Selection Value for DOMNAME as 'TNDRST' and then run it.
    Or you can create a view out of this table based on DOMNAME filter as 'TNDRST'.
    Regards,
    Chathia.

  • For iPhone Case Lovers and their concern of Magnet Closers!!

    I recently learned that some have had issues with their iPhone when used with a cases that includes magnets for closing. Sorry mwhitted for your woes.
    While looking for a nice case for myself I became concerned of this, and decide to contact Sena about their Dockable iPhone case. This case seemed to be exactly what I was looking for, but after reading mWhitted and a few others problems I wasn't sure.
    So I sent them a e-mail with the links and question their knowledge about their product.
    This was late last night (about 1:39 am). How about 10:09 in the a.m. I get a response! A Long and thoroughly explained response (read Below).
    Great customer service! I am going to give this company a try and see how well this works.
    I have included my original e-mail to them and their response by Ronda so that you may judge for yourself.
    PS. mWhitted, aparently the case you used may not have had the proper magnets and maybe not assembled appropriately for this phone which may have caused the problem. What do you think, maybe this may have been the cause?
    Thanks for the info by the way.
    Below is my email to them.
    -----Original Message-----
    From: Stephan Singh
    Sent: Wednesday, July 11, 2007 01:39 am PDT (GMT-07:00)
    Subject: Pre-Order Dockable iPhone case
    I have looked up many cases for my iPhone and I have found your Dockable one to be just the style and function I am looking for. Although recently there has been a buzz going around that the magnetic closing cases such as these have caused many iPhones to malfunction.
    I was curious as to if you had any information on this? I also wanted to send you this so that you may look into this to avoid any potential problems with your sales.
    Another question, I would like to know if it would be possible to replace the magnets in this case and apply velcro to it instead as an option for your customers?
    As far as the info that I had on the magnets, you can read tease threads from apple support forums for reference.
    http://discussions.apple.com/thread.jspa?threadID=1018081
    http://discussions.apple.com/thread.jspa?threadID=1036960&tstart=0
    Please contact me asap on this issue, for I would like to know my options on a purchase through you.
    Thank you
    Stephan
    NOW HERE IS THEIR MESSAGE BACK.
    ----- Original Message ----
    From: Sena Cases <[email protected]>
    To: [email protected]
    Sent: Wednesday, July 11, 2007 10:09:26 AM
    Subject: Case Update: 1086 - Pre-Order Dockable iPhone case
    Update for Case #1086 - "Pre-Order Dockable iPhone case"
    We use only non Neodymium magnets that do not interfere with the device. We have done extensive testing with many devices to assure that the magnet use will not harm the internal applications or antenna on the devices which we manufacture cases for. Also we have long created cases for use with the IPOD nano, Ipod 3rd,4th and Ipod Video devices using the non Neodymium magnets in our cases without any interferance at all after selling thousands upon thousands of cases. Sena Cases are designed by Engineers with PhD, they are all handcrafted by skilled craftsmen who have been in the leather industry for many years making them expert leather craftsmen, our cases are not just designed by a purse maker or a designer who is thinking of only fashion and style, because of the engineering focus of the design staff they are detail oriented making sure that each and every feature and function of the device has been addressed and is accessible as well as taking wevery precaution to protect the devices and information which belongs to our loyal customers, and new customers as we hope that each person who finds their way to Sena Cases will become loyal to our products for all devices which they own now and in the future. Because our company's entire focus is PDA, Smartphone and Computer cases Sena Management and Design staff have extensively researched magnets available in the industry and magnetic substrates, with a solid plan to avoid any magnet which would harm any device we have created a case for, So the selection of the magnets available and the possible strengths that we can use are focused on a very limited type and size of magnet, sometimes even shape takes some precidence in the design of certain cases, in regards to the iPhone magnets the staff have created a new installation making the magnet undetectable on the open face of the case so that the form and shape are very sleek and suitable to the high style devbice which is in the Sena Case. Some case makers off shore may just throw a case together without considering future ramifications, These case manufacturers may be selling cases at a lower price point not created out of fine materials or more novelty type accessory cases that are often offered at a bargain price that is unbelievably inexpensive, They may be thinking when creating their own design that " this company and that company use magnets we will to..." this may be how cases get created for devices which may harm the device that they were intended to protect. Sena Cases has taken every precaution to design a slim sleek sexy iphone case that will protect your device in a very stylish fashion throughout the years that you own this expensive device.
    I will pass your forum links on to our design staff and the research group as well as our company president for review, Customer feedback is highly valued here at Sena Cases. I assure you that serious research has been done to assure that your iPHONE case will fit precisely allow access to all features and functions and to protect your investment in the device and the information which it contains as you as well as your referrals and your future business is our main focus and if we dint sweat all the little details to attempt to create you a perfect case for your device we could not expect your loyalty to our brand.
    We do also stand behind all our products with a one year warranty against any manufacturing defects. The best compliment we can receive is for a customer to refer family, friends, colleagues and strangers that they cross paths with to our cases as your refferral of our product is more valuable to us that a full page color ad in a major magazine, if your happy you will refer many people to our products who will refer their friends and so on and so on....
    Stephan, I reccomend that you avoid Neodymium magnets in what ever case you elect to purchase and you will be fine, I am hopefull that you will elect to protect your iPhone in our cases, as we make a fine product as does many competitors in the market, I am not familiar with their designs for this device so I cannot speak openly about any of them, but the iPHONE cases in our office on display as well as future designer cases to be released before the fall are all incredible. Sena Will have some leathers and designs nwever seen before by similar type device owners ever in the past, as our company has searched out new Leather vendors as well as creating our traditional line of stylish Sena cases will be releasing a designer series of cases for iPHONE because the device is phenomonal the design staff and management felt that the cases could also help carry off the devices style in a ddifferent intrepretation.
    You will love any of the Sena Cases designs which are available now or in the future., We have had customers stop by and try on the prototype cases which we have photographed and were in love with the look and fit. The sensor on the face of the case has been revised the original case designed before the device was available to accommodate the proximity/light sensors! The sensor lies above the ear piece at the top of the screen. so there will be two circular oval type openings above the screen. These cases are really off the hook, crazy cool and distinctively beautiful, I am hopeful you will enjoy owning one to protect your device.
    Regards,
    Rhonda
    PC   Windows XP  

    OK. Here it is...
    http://en.wikipedia.org/wiki/Neodymium_magnet
    "Neodymium magnets are very strong in comparison to their mass..."
    A.K.A. "rare-earth magnetS".
    "While most solid state electronic devices are not effected by magnetic fields, some medical devices are not manufactured to mitigate the effects of strong magnetic fields." Maybe phones too?
    These could be the ones that I removed from my case:
    http://www.kjmagnetics.com/proddetail.asp?prod=D603
    From the above sales site:
    "Never place neodymium magnets near electronic appliances."

  • Which table can we see consumption and forecast values in forecast based planning

    Dear SAP Gurus,
    I am working on implementing forecast based planning for Spare parts for my client. They have one Main Plant which do purchase of Spare Parts and through Stock transfers moved to 60+ Plants from where Spares are being sold.
    Now I am carrying out SAP trial runs for a set of 160+ materials with various models and want to compare with their existing methodology of requirement calculation.
    I want to compile Consumption and Forecast data month wise for these trial materials (160+ materials in 60 Plants) . One way I thought is to go individual Material Master and looks for values in Forecast view. However it is tedious and time consuming.
    The table name shows RMCP2 and RM03M for forecast and Cons values, but I could not find the table.
    Hence I want to know which table if I can view I can get the consumption and forecast data calculated for quick copying and compilation. 
    Thanks and Regards,
    R.Velmurugan.

    Dear Mariano,
    Thanks for your valuable inputs.
    Like I could able to get the consumption values for materials using table MVER and fields GSV01,GSV02 etc.,
    What field I need refer in table PROP for getting forecast values.
    As such I could not see any column where in data are similar to Forecast view.
    Thanks and Regards,
    R.Velmurugan.

  • Report to list all computers and their collection membership

    Hi
    I am currently working on a site where direct membership is used for collections but a need has arisen to move to AD Queries.
    I have created a simple powershell script that creates groups based on the contents of a csv file and another script which populates this with the members listed in another csv file.
    To help speed up the process is there a way to generate a report that lists ALL Computers and their Collection membership?
    The only reports I seem to find that are built in require an inputted value of either computer name of collection ID. I simply need a report that lists Computer Name is column 1 and Collection Name in column 2 for all computers and all collections.
    Many Thanks,
    Matt Thorley

    select 
    FCM.Name,
    C.Name
    from 
    dbo.v_Collection C
    join dbo.v_FullCollectionMembership FCM on C.CollectionID = FCM.CollectionID
    Thanks to Garth for original query. I just modified it :)
    Anoop C Nair (My Blog www.AnoopCNair.com)
    - Twitter @anoopmannur -
    FaceBook Forum For SCCM

  • "File Browse" type item: at what point the fields mime_type, file_name, last_update_date get their values?

    Hi there,
    I have an issue with "File Browse" type item, my question is: at what point the fields mime_type, file_name, last_update_date get their values? I want to add them to the collection but if I try to do it in Process "On Submit - After Computations and Validations" the values in those fields are still null (that's for the insert, and for the update they have old values). Also I don't seem to be able to add blob to the collection ("File Browse" type item (which has the source as blob database column) can't be assigned as parameter p_blob001 of APEX_COLLECTION.ADD_MEMBER, error is: PLS-00306: wrong number or types of arguments in call to 'ADD_MEMBER').
    What I am trying to do is this: I have parent table (TABLE1), and child table (TABLE2).  In TABLE2 I store documents. I have a main page that is form on TABLE1, and on it I have button "Add documents" that opens popup window with form on TABLE2. On submit of popup page I want to avoid inserting document into TABLE2, instead I want to send data to the main page (using collection) and insert in only once the main page is submitted.
    I would appreciate any advice on this...
    Thanks,
    Tanya

    Hello Tanya,
    Can you post your PL/SQL code which you are trying?
    Regards,
    Hari

  • How to get active document  swatch color and its value

    Hi
    i want to get the swatch color of active document
    i use 3 to 4 colors both cmyk and pantone which is in swatches
    now i want to get their values using script
    any one please help me
    Thank you
    Appu

    Download the script "Render Swatch Legend" from the following site: http://www.wundes.com/JS4AI/
    This script generates a legend of rectangles for every swatch in the main swatches palette. You should be able to grab the code you need from this.

  • Getting list of all users and their group memberships from Active Directory

    Hi,
    I want to retrieve a list of all the users and their group memberships through JNDI from Active Directory. I am using the following code to achieve this:
    ==================
    import javax.naming.*;
    import java.util.Hashtable;
    import javax.naming.directory.*;
    public class GetUsersGroups{
         public static void main(String[] args){
              String[] attributeNames = {"memberOf"};
              //create an initial directory context
              Hashtable env = new Hashtable();
              env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
              env.put(Context.PROVIDER_URL, "ldap://172.19.1.32:389/");
              env.put(Context.SECURITY_AUTHENTICATION, "simple");
              env.put(Context.SECURITY_PRINCIPAL, "[email protected]");
              env.put(Context.SECURITY_CREDENTIALS, "p8admin");
              try {
                   // Create the initial directory context
                   DirContext ctx = new InitialDirContext(env);     
                   //get all the users list and their group memberships
                   NamingEnumeration contentsEnum = ctx.list("CN=Users,DC=filenetp8,DC=com");
                   while (contentsEnum.hasMore()){
                        NameClassPair ncp = (NameClassPair) contentsEnum.next();
                        String userName = ncp.getName();
                        System.out.println("User: "+userName);
                        try{
                             System.out.println("am here....1");
                             Attributes attrs = ctx.getAttributes(userName, attributeNames); // only asked for one attribute so only one should be returned
                             System.out.println("am here....2");
                             Attribute groupsAttribute = attrs.get(attributeNames[0]); // memberOf
                             System.out.println("-----"+groupsAttribute.size());
                             if (groupsAttribute != null){
                                  // memberOf is a multi valued attribute
                                  for (int i=0; i<groupsAttribute.size(); i++){
                                  // print out each group that user belongs to
                                  System.out.println("MemberOf: "+groupsAttribute.get(i));
                        }catch(NamingException ne){
                        // ignore for now
                   System.err.println("Problem encountered....0000:" + ne);
                   //get all the groups list
              } catch (NamingException e) {
              System.err.println("Problem encountered 1111:" + e);
    =================
    The following exception gets thrown at every user entry:
    User: CN=Administrator
    am here....1
    Problem encountered....0000:javax.naming.NamingException: [LDAP: error code 1 -
    000020D6: SvcErr: DSID-03100690, problem 5012 (DIR_ERROR), data 0
    ]; remaining name 'CN=Administrator'
    I think it gets thrown at this line in the code:
    Attributes attrs = ctx.getAttributes(userName, attributeNames);
    Any idea how to overcome this and where am I wrong?
    Thanks in advance,
    Regards.

    In this sentence:
    Attributes attrs = ctx.getAttributes(userName, attributeNames); // only asked for one attribute so only one should
    It seems Ok when I add "CN=Users,DC=filenetp8,DC=com" after userName, just as
    userName + ",CN=Users,DC=filenetp8,DC=com"
    But I still have some problem with it.
    Hope it will be useful for you.

Maybe you are looking for

  • Oracle Report Team : I need your help

    Hi, I can run my report in 9i in the paper layout, the problem I have now is running it in the report on the web. This report was initially generated using report 6i Thanks reply needed urgently

  • Using LIKE operator doesnt return results

    Hi I'm very new to SQL and databases in general. I have a vb.NET app in which I'm trying to send a SQL server to a SQL Server 2012 server. For testing purposes Im using SQL SErver Management studio. I have one query that works, but when I try to use

  • Printable page not working

    Hi All, When i click on the pdf icon , in the preview printable page section of a worksheet it says "page not displayed" any ideas. Thanks

  • Update Failed for Sum of previous row and current row

    Hi i need to update the column length of the previous row and current row so i followed this method but i'm unable to update what is problem in my syntax SQL> begin 2 DECLARE Total number = 0; 3 UPDATE StringOutput set Total = SumOfLength = Total + C

  • Why won't my CDs/DVDs play any more!?!?

    Hi knowledgeable and helpful peeps here's a problem for you... my CD drive suddenly seems to have stopped working. It seems to coincide with the latest iTunes update. Used to work fine before, was able to rip CDs with no problems. Now it won't work!