How to write the char value as is in the CSV file

Hi Everyone,
I am creating csv files which contains inventory details for all the products. I am able to create the csv file with utl file concepts. My problem starts after the csv file is being created.
some of the product numbers(Though I am saying Product number, it is varchar2 data type in the table) is like this 3E-12, 3E-54 and so on. I have totally 23 product numbers like this.
When the user opens the csv file it is changing to numbers like this 3.00E-12, 3.00E-54. I want to keep the product number as it is like char value. I tried many quoting and concat methods.
But none of them works for me.
I am using oracle 9i.
Oracle9i Enterprise Edition Release 9.2.0.7.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.7.0 - Production
Please help me to solve this problem.
Thanks in advance,
Vimal...

Hi Friends,
Thanks for the immediate response. Here is my code.
CREATE OR REPLACE PROCEDURE DATA_TO_CSV_FILE
IS
l_file_ptr UTL_FILE.file_type;
l_hdr_text VARCHAR2 (4000);
l_dynamic_sql_str VARCHAR2 (4000);
TYPE l_dynamic_sql IS REF CURSOR;
l_dynamic_cursor l_dynamic_sql;
l_org_id_select VARCHAR2 (200);
l_master_org_id NUMBER;
l_category VARCHAR2 (40);
l_itemno VARCHAR2 (40);
l_description VARCHAR2 (240);
l_brand VARCHAR2 (240);
l_organization_id NUMBER;
l_oh NUMBER;
l_status apps.mtl_system_items.inventory_item_status_code%TYPE;
BEGIN
l_file_ptr := UTL_FILE.fopen ('CSV_DIR', 'inventory.csv', 'w');
l_dynamic_sql_str :=
'SELECT mc.segment2 CATEGORY, itm.segment1 itemno '
|| 'itm.description description, LOG.brand brand,'
|| 'NVL (m.oh, 0) oh'
|| '(select msi.inventory_item_status_code from apps.mtl_system_items msi'
|| ' where msi.inventory_item_id = itm.inventory_item_id'
|| ' and msi.organization_id = '
|| l_master_org_id
|| ' ) status '
|| ' FROM xxx_custom_table m,'
|| ' apps.mtl_item_categories ic,'
|| ' apps.mtl_categories_b mc,'
|| ' apps.mtl_system_items itm,'
|| ' xxx_custom_table1 LOG,'
|| ' xxx_custom_table2 cap'
|| ' WHERE m.item_id(+) = itm.inventory_item_id'
|| ' AND m.org_id(+) = itm.organization_id'
|| ' AND itm.segment1 = cap.itemno(+)'
|| ' AND itm.inventory_item_id = ic.inventory_item_id'
|| ' AND itm.organization_id = ic.organization_id'
|| ' AND ic.category_id = mc.category_id'
|| ' AND mc.segment2 IS NOT NULL'
|| ' AND itm.inventory_item_id = LOG.inventory_item_id'
|| l_org_id_select
|| ' GROUP BY mc.segment2,'
|| ' itm.segment1,itm.inventory_item_id,itm.description,'
|| ' LOG.brand,LOG';
OPEN l_dynamic_cursor FOR l_dynamic_sql_str;
LOOP
FETCH l_dynamic_cursor
INTO
l_category, l_itemno, l_description, l_brand, l_status,l_oh;
EXIT WHEN l_dynamic_cursor%NOTFOUND;
UTL_FILE.put_line (
l_file_ptr,
l_CATEGORY
|| ','
|| l_itemno
|| ','
|| l_description
|| ','
|| l_status
|| ','
|| l_brand
|| ','
|| l_oh
END LOOP;
UTL_FILE.fclose (l_file_ptr);
END;
Hey damorgan,
Can you please give me little more detail about your workaround method. I think I did the ODBC Connection Once for MS ACCESS database. I
hope you are taking about the same method.
Thanks
Vimal....

Similar Messages

  • How to replace the char values into numeric in my string?

    Hi Friends,
    I would like to Replace the Charecter values with numeric value in my string.
    Exp : first in my string I am having the value like this : 'ABCD1234' ( may be any char and num values ), and I want too get it by '99991234'.
    I mean How to replace the char values into numeric in my string?
    Thanks,
    Sridhar

    Hi Sridhar,
    I would like to Replace the Charecter values with numeric value in my string.
    Exp : first in my string I am having the value like this : 'ABCD1234' ( may be any char and num values ), and I want too get it by '99991234'.
    So, if i understand you correctly, you want to replace all characters in a string with 9 as in the above example, irrespective of position of the character, if so try with the below code.
    DATA: l_str TYPE string.
    l_str = 'ASKHSIUDNSBDKJSDH124312431243124saasdfsf'.
    REPLACE ALL OCCURRENCES OF REGEX '\D' IN l_str WITH '9'.
    IF sy-subrc EQ 0.
      WRITE: l_str. "Result will be 9999999999999999912431243124312499999999
    ENDIF.
    Regards,
    Chen
    Edited by: Chen K V on Jun 13, 2011 12:36 PM

  • How to write triggers on startup and shutdown of the server?

    Plz advice.
    How to write triggers on startup and shutdown of the server?
    I could write it but nothing happened!!!

    Small code example for you:
    [email protected]> @ connect mob/mob
    [email protected]> create or replace trigger shutdown_trigger
    2 before shutdown on database
    3 begin
    4 insert into shut_table values(sysdate);
    5 end;
    6 /
    Trigger created.
    [email protected]> create or replace trigger start_trigger
    2 after startup on database
    3 begin
    4 insert into start_table values(sysdate);
    5 end;
    6 /
    Trigger created.
    [email protected]> @ connect "/ as sysdba"
    [email protected]> shutdown immediate
    Database closed.
    Database dismounted.
    ORACLE instance shut down.
    [email protected]> startup
    ORA-32004: obsolete and/or deprecated parameter(s) specified
    ORACLE instance started.
    Total System Global Area 64036368 bytes
    Fixed Size 454160 bytes
    Variable Size 50331648 bytes
    Database Buffers 12582912 bytes
    Redo Buffers 667648 bytes
    Database mounted.
    Database opened.
    [email protected]> select * from mob.start_table;
    START_DAT
    14-SEP-06
    [email protected]> select * from mob.shut_table;
    SHUT_DATE
    14-SEP-06
    Best Regards
    Krystian Zieja / mob

  • How can I get the default value of a particular preference programatically. I know I can see the default value for some of the preferences in about:config but, I need a programatic way to get the default value.

    <blockquote>Locked by Moderator as a duplicate/re-post.
    Please continue the discussion in this thread: [tiki-view_forum_thread.php?comments_parentId=702631&forumId=1]
    Thanks - c</blockquote>
    == Issue
    ==
    I have a problem with my bookmarks, cookies, history or settings
    == Description
    ==
    How can I get the default value of a particular preference in FireFox?.
    I know I can see the default value for some of the preferences in about:config but, I need a programatic way to get the default value.
    I see some that there are values for preferences in firefox.cs but I am not certain that these are being used as the default values for preferences. prefs.js in user's profile only has the updated values and not the default values.
    Any help towards acheiving this programtically is greatly appreciated.
    If the default values are stored in a file, kindly let me know the format in which it is stored for me to parse it programatically.
    == User Agent
    ==
    Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Win64; x64; Trident/4.0; .NET CLR 2.0.50727; SLCC2; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0)

    Dear Friend,
    Here when you have the callableSattement as ?=proc(?), the first ? is an output parameter. So you should register it as out parameter using registeroutparameter.
    Then you can get the value from the outparameter using callablestatement.getXXX().
    Try that way.
    For free tral versions of JDBC Drivers go to www.Atinav.com

  • How to get Basic salary amount in the Housing formula to calculate the housing value as I used the DBI (NICDP_EMPLOYEE_BASIC_SALARY_AMOUNT_ASG_ENTRY_VALUE) but when run the Quick pay for the housing element alone result come 0, How to get Basic salary amo

    How to get Basic salary amount in the Housing formula to calculate the housing value as I used the DBI (NICDP_EMPLOYEE_BASIC_SALARY_AMOUNT_ASG_ENTRY_VALUE) but when run the Quick pay for the housing element alone result come 0, How to get Basic salary amount in the Housing formula to calculate the housing value as I used the DBI (NICDP_EMPLOYEE_BASIC_SALARY_AMOUNT_ASG_ENTRY_VALUE) but when run the Quick pay for the housing element alone result come 0

    Hi,
    Is your formula attached to basic salary element or some other element? You need to make sure that basic salary element has some value and is processed before this formula is called. Are you able to see value for basic salary element after payroll run?
    Regards,
    Pawan

  • Confirm the char value for in UTF8

    Hi Team,
    we are facing an issue with one of the special characters in Oracle Database:
    1. We have description with ® in description
    2. We have the database charset as UTF8
    3. The setting for the application is Unicode
    4. When we query the item on the Application, SQL Developer, the description shows fine
    5. When we run the query connecting to the UNIX server with the charset UTF8, the description shows fine.
    6. When we run the query connecting to the UNIX Server with the charset ISO-8859-1:1998 (Latin-1, West Europe), the description shows ® instead of ®.
    7. The character value in the database shows as 49838.
    8. When we check for the query SELECT CHR (49838) FROM DUAL in SQL developer, the output shows as ®
    9. When we check for the query SELECT CHR (49838) FROM DUAL with the UTF8 as charset then the output shows as ®
    10. When we check for the query SELECT CHR (49838) FROM DUAL with the ISO-8859-1:1998 (Latin-1, West Europe) as charset then the output shows as ®
    11. We have also tried copying the character ® from charmap and using it in the description and even then it shows as ® when connected to UNIX using the charset ISO-8859-1:1998 (Latin-1, West Europe)
    Can anyone confirm the char value for ® in UTF8.
    Thanks
    Madhavi Gadicherla

    194 174 (hex C2 AE)
    http://www.denalimultimedia.com/info/Articles.aspx?cid=07&topic=unicode_utf-8
    http://www.utf8-zeichentabelle.de
    http://www.williamrobertson.net/documents/ascii.html
    194 when interpreted on its own is the  character, and 174 is &reg;. The application needs to know it's a 2-byte UTF-8 character.
    49838 is C2A2 in hex, which looks correct for the CHR function in a UTF-8 database.

  • Checkbox error "The Entered Value is Not on the List of Valid Values".

    Hi All,
    I have a check box attribute inside a node which is bounded to a field of type CHAR 1. I have given the property and value for the attribute as follows:
    Attribute Name     ZCHECK
    Type assignment     Type
    Type                          ZTABLE-ZCHECK
    Read-only                         0
    Default Value     
    Null Value                           0
    Input Help Mode     Automatic
    Determined Input Help     ZCHECK
    Type of Input Help     Fixed values for domains
    Formatting     
    Compression     Default Value
    I have created an onToggle Event for it.
    Now when i execute my component i do the following.
    First i click on a button called 'EDIT'. Now the check box comes to edit mode. Now when i click on the checkbox i get the following error. "The Entered Value is Not on the List of Valid Values".
    When i try to debug, there is no problem in the 'INIT' method. The error is throw even before going inside the onToggle Event for check box.
    Please explain how to over come this.

    Hi,
    Check your field ZTABLE-ZCHECK, if it is of type CHAR1 then only possible values for checkbox should be 'X' and ' '.
    May be your domain has some other values in Fixed Value List.
    its better to bind checkbox with attribute of type boolean
    Also, the input help for attribute bound to checkbox doesn't makes any logic.
    Regards
    Manas Dua
    Edited by: Manas Dua on Feb 26, 2010 3:11 PM

  • Job scheduling error : The return value was unknown. The process exit code was -1073741819. The step failed.

    I am working in Sqlserver 2008 R2, SSIS 64 bit version
    I am getting the below  error while scheduling the job in the development server  Database. 
    The return value was unknown.  The process exit code was -1073741819.  The step failed.
    The SSIS front end execution runs fine.
    Have anyone  faced this issue before?

    Hi Venkat,
    If you already changed to 64bit and still doesn't work then create proxy account.. 
    To create a proxy account
    In Object Explorer, expand a server.
    Expand SQL Server Agent.
    Right-click Proxies and select New Proxy.
    On the General page of the New Proxy Account dialog, specify the proxy name, credential name, and
    description for the new proxy. Note that you must create a credential first before you create a proxy if one is not already available. For more information about creating a credential, see How
    to: Create a Credential (SQL Server Management Studio) or CREATE CREDENTIAL (Transact-SQL).
    Check the appropriate subsystem for this proxy.
    On the Principals page, add or remove logins or roles to grant or remove access to the proxy account.
    Thanks

  • Error «The entered value is not on the list of valid values» in the hierarchy of mss web dynpro abap

    Hello Experts
    The error «The entered value is not on the list of valid values» in the hierarchy of mss web dynpro abap occurs after manager’s following actions:
    selected detailed Team View ;
    selected hierarchy;
    changed style of the hierarchy to any other (for example, the vertical);
    the error occurs after attempting to do any action.
    Our system is EHP7.
    If someone faced with this error, please give me advice how can i resolve this problem.

    Hi John,
    Sorry for the delay in replying. No, we do not have the same problem if we understand you correctly.
    "We have bypassed the MSS Home Page and just embedded the Detailed Team View as a standalone application in our MSS portal role" - we also made for the our customer. BUT we have error «The entered value is not on the list of valid values» in our standard system.
    Regards,
    Andrey

  • Error the entered value does not match the specified field type

    Hi,
    When I try to insert a null value to a field of the User Defined Table I am getting the error "The entered value does not match the specified field type" in SAP Business One version 2007 PL 42.
    Any help would be appreciated.
    Thanks in advance.
    Sudha.

    Hi Sudha,
    It probably have to do with how you defined the field.
    Is Null value allowed?
    What are the field definitions?
    Thanks,
    Jesper

  • SQL 2012 - SSIS Error -The step did not generate any output. The return value was unknown. The process exit code was -1073741819. The step failed.

    Hi guys 
     Trying to run this package on SQL 2012 agent  and getting below error . No more details I could find so far.
    The step did not generate any output.  The return value was unknown.  The process exit code was -1073741819.  The step failed.
    About Package - Its connecting to different version (2000,2005,2008,2008R2,2012) servers and putting Jobs information into one Database table.  
    Any workaround or fix ?
    Thanks
    Please Mark As Answer if it is helpful. \\Aim To Inspire Rather to Teach

    New package or one that used to work? Connecting how? How does it poll?
    On the surface it is an error from a memory space of the binary/non-managed code, so nothing can be really concluded based on what you decided to share with us.
    Arthur My Blog
    So Same package is working fine from my local machine which has SQL 2008 R2 and SQL 2012 installed. I am trying to push the package on server which has sql server 2012 Installed . 
    I don't see any error .
    I ran package manually from server using SQL Data tools and ran successfully...
    Please Mark As Answer if it is helpful. \\Aim To Inspire Rather to Teach

  • BO XI Desk-I graph The negative values are rising form the lowest value up

    The negative values are rising form the lowest value up. Instead of dropping from the Zero-line. Where is the problem originating?  BO FP2.3.
    The positives values are also rising from the lowest value up.
    The problem only occurs withing Desk-I. Within Web-I this problem does not occur.
    Edited by: A. SMULDERS on Sep 7, 2010 10:35 AM

    Hi
    Try with the following symbol in the field
    &ITAB-NETWR(>)&  - will write the sign  as (100.00-)
    &ITAB-NETWR(<)&  - will write the sign  as (-100.00)
    and based on some field  in the program write like
    If itab-shkzg = 'H'.
      itab-netwr = itab-netwe * -1.
    endif.
    and try to print this field in the form.
    <b>Reward points for useful Answers</b>
    Regards
    Anji

  • Ho to Generate the Numeric Values Automatically before saving the records

    Hello to everybody,
    I have a data block naming “BILL” consisting of the following 3 field.
    1. Sr_No
    2. Bill_Amount
    3. Description
    This Data Block consist 10 records at a time.
    I want that whenever I insert records in the above data block.
    Serial No should automatically be generated.
    For this I have applied the following code in “WHEN-NEW-ITEM-INSTANCE” trigger.
    <CODE>
    SELECT NVL(MAX(Sr_No),0)+1 INTO :BILL.Sr_No FROM BILL;
    </CODE>
    Whenever I insert records in the BILL data block, the first row automatically generates the “Sr_No”, but when I move to the next record, (remember currently I have not saved the record), the same value which appeared in the previous record appears in the Sr_No field.
    For example, when I insert records for the first time in the BILL, the Sr_No field automatically generates value “1”, but when I move to the next record while not saving the first record the next row still generating value “1”, while it should be value “2” and so on.
    Note that I want that before saving the previous record when I move to the next row, the Sr_No should generate the next continuous value like in example.
    Please help me to solve out this problem.

    You have practically scratched you left ear with your right foot while jumping on the left foot :-)
    Seriously, you guys don't need to go to all this trouble.
    If you want a serial number incrementation, all you need to do is to either select the max value + 1 from the table or select the next value from a sequence in an PRE-INSERT trigger on block level, and that's it!!!!
    Tony

  • ERROR in  MR8M - The acquisition value is negative in the area 02

    Hello,
    I am not able to reverse by MR8M a document released in MIRO, of an error: "The acquisition value is negative in the area 02 - AA617 message. "
    Can anyone help me?
    Thank you in advance,
    Luiz Henrique

    Hi,
    The reason wold probably be that the Asset master would have been already capitalized or it would have been de-activated.  Kindly check with your finance team before processing MR8M.
    Regards,

  • The default value as "None" for the report filter which is Value List type?

    Hello,
    I want to know is it possible to make the default value as "None" for the report filter which is Value List data type?
    For example:The Project Classification Value List value type which have many value like "Supplier Rationalization" "Category Sourcing" "Contract Regegotiation" etc, and the value "Supplier Rationalization" is in the frist positon in the value list. When i use "Project Classification " as a report filter, the value "Supplier Rationalization" displayed as default value. And in the value list box in report filter of Project Classification , there is a value "None" which should be added automatically by system. So i manually filled the default value with "None" in Filter Prompt screen, but it does not work. After i display the report ,the Project Classification filter still use the ""Supplier Rationalization" as the default value.
    My current ESO version is 5.1. I tried other ESO version like 5.15, if i manaully give a default value "None" in Filter Prompt screen for filter Project Classification, then the default value is "None". It works well.
    Does anybody know if it's possible to do the same thing in ESO 5.1?
    Thanks & Regards,
    David
    Edited by: David Gao on Aug 11, 2010 4:06 AM

    Hi David -
    This is possible, but the technique is not too obvious...
    To make "None" be the default choice for a query definition filter parameter of type value list type, you need to set the default value of the filter parameter to the following:
    <internal id of value list type>:616:NULL
    For example, I believe you will see that the internal id of the Project Classification value list type is 51, so the default value of the filter parameter would be:
    51:616:NULL
    I hope this helps.
    Regards,
    Rob

Maybe you are looking for

  • Target Message for generation HTML email?? : Michal's Blog (2718)

    hey folks, I'm trying out the scenario described in Michal's blog <a href="/people/michal.krawczyk2/blog/2005/11/23/xi-html-e-mails-from-the-receiver-mail-adapter">XI: HTML e-mails from the receiver mail adapter ?</a> What should be the target messag

  • APPLE FOLKS - Please let us access our photos . . .

    like we did before! I'm an educator and my students access the pictures folders for many projects (including PowerPoint, etc.). The way the photo library is locked down now is a hassle and "just one more step" for the kids to pull a picture to the de

  • 32k Limit for Page Header?

    When porting an existing Page to HTML a Template, Page and Region was created, the Page Header was Javascript like code from Go Live. Is there a limit to the Page Header, If so how do you modulize this code for ease of integration, do you put the cod

  • French voice in the iPad

    I am learning French and using my iPad to hear texts written in French. The problem is that the standard voice for pronunciation in French is extremely nasal and unpleasant. I'd like to know if is it possible to change that voice. A female voice simi

  • MacMini 10.7.5 software update never completes

    Had several updates and initiated update.  Eighteen (18) hours later a gray cloth-like screen persisted with a single window device open.  Window has an open carton / box, upper left, a status bar with NO progress, message: "The computer will restart