Extract of LONG

Hello everybody,
I am a problem, with the Oracle's Function.
I create a table A : CREATE TABLE A (id NUMBER, name LONG);
I want extract from the characters of 'name'. I use the function SUBSTR : SELECT SUBSTR(name,1,2) FROM A;
However, Oracle produce a error : ORA-00932: types de données incohérents ; attendu : NUMBER ; obtenu : LONG.
How that this fact that I cannot have a result? However, LENGTH is character strings.

maybe this example might be of some help.
CREATE OR REPLACE Function convert_long_to_char( pTableName in varchar2,
                                                 pColumnName in varchar2,
                                                 pRowId in rowid ) return varchar2 As
  vCursor    integer default dbms_sql.open_cursor;
  vN         number;
  vLongVal  varchar2(4000);
  vLongLen  number;
  vBuflen    number := 4000;
  vCurPos    number := 0;
begin
  dbms_sql.parse( vCursor,'select ' || pColumnName || ' from ' || pTableName ||
                                                          ' where rowid = :x',
                  dbms_sql.native );
  dbms_sql.bind_variable( vCursor, ':x', pRowId );
  dbms_sql.define_column_long(vCursor, 1);
  vN := dbms_sql.execute(vCursor);
  if (dbms_sql.fetch_rows(vCursor)>0) then
    dbms_sql.column_value_long(vCursor, 1, vBuflen, vCurpos ,
                               vLongVal, vLongLen );
  end if;
  dbms_sql.close_cursor(vCursor);
  return vLongVal;
end convert_long_to_char;
SQL> describe long_tab;
Name                                      Null?    Type
PCOL                                               LONG
SQL> select * from long_tab;
no rows selected
SQL> insert into long_tab
  2  values
  3  ('1234567890 ABCDEFGHIJLKMNOPQRSTUVWXYZ '||
  4   '0987654321 POIUYTREWQASDFGHJKLMNBVCXZ '||
  5   '1029384756 QWERTYUIOPASDFGHJKLZXCVBNM '||
  6   '1357924680 QAZWSXEDCRFVTGBYHNUJMIKOLP '||
  7   '2468013579 MNBVCXZLKJHGFDSAPOIUYTREWQ '||
  8   '2143658709 ZXCVBNMLKJHGFDSAQWERTYUIOP '||
  9   '5647382910 QAWSEDRFTGYHUJIKOLPMNBVCXZ '||
10   '1029384765 ZXASQWERDFCVBNGHTYUIJKMLOP '||
11   '3142758609 IKLOPMJUYHNBGTRFVCDEWSXZAQ '||
12   '6789054321 TGBVFREDCXSWQAZYHNMJUIKLOP');
1 row created.
SQL> commit;
Commit complete.
SQL> select * from long_tab;
PCOL
1234567890 ABCDEFGHIJLKMNOPQRSTUVWXYZ 0987654321 POIUYTREWQASDFGHJKLMNBVCXZ 1029
SQL> select convert_long_to_char('long_tab','pcol',rowid) pcol
  2    from long_tab;
PCOL
1234567890 ABCDEFGHIJLKMNOPQRSTUVWXYZ 0987654321 POIUYTREWQASDFGHJKLMNBVCXZ 1029
384756 QWERTYUIOPASDFGHJKLZXCVBNM 1357924680 QAZWSXEDCRFVTGBYHNUJMIKOLP 24680135
79 MNBVCXZLKJHGFDSAPOIUYTREWQ 2143658709 ZXCVBNMLKJHGFDSAQWERTYUIOP 5647382910 Q
AWSEDRFTGYHUJIKOLPMNBVCXZ 1029384765 ZXASQWERDFCVBNGHTYUIJKMLOP 3142758609 IKLOP
MJUYHNBGTRFVCDEWSXZAQ 6789054321 TGBVFREDCXSWQAZYHNMJUIKLOP
SQL>

Similar Messages

  • Delta extraction too long

    Hi Guys,
      The loading performance is very slow to our cubes, the daily report needs to be up by early morning..........
    the extraction time in the data packets is taking too long
    is it because of huge change log data
    the server load isnt much
    Thanks,
    your help will be rightly appreciated

    Hi,
    If there any Indexes on your cube,then delete indexes before loading the data.
    And minimise your data packet size.not more than 50 thousend records.
    Check you data base space.
    You can go to T-Code DB20 which gives you all the performance related information like
    Partitions
    Databases
    Schemas
    Buffer Pools
    Tablespaces etc
    I hope this will help you .Assign points if this helps.
    Regards........
    Tg

  • Extracting LTP (Long Term Planning) Data from SAP ECC to SAP BW

    Hello all
    Here is the task in hand. There is a standard report that Production Planners execute post their MRP/LTP runs. This report can be accessed through T-code "MCB)". The program in action is RMCB1200. I tried looking for any standard extractors but to no avail. I would be fine to know either or both of the following:
    An extractor
    All the primary tables involved ( I have found a few tables through the program but a list by some expert will help me understand that I have not missed anything significant)
    Also, if anyone has done this before, how was your experience with the extraction in terms of extraction volume and performance.
    Regards
    Gajendra

    After further digging, here is some information that I found out.
    T-code
    Program
    BADI
    MSEX
    RMDMRPEXTRACT02
    MD_SR_LIST_EXTRACT
    This could possibly provide the data required. The program can be scheduled and the output can be managed by SPRO settings for Extraction Mode. I am running tests to confirm if it provides me the correct information and matches with MCB) output.
    Here are some tables, just for reference:
    LTP Tables: PLSC, PBHI, PLPT, MDTP, PLPR, PLPB
    MRP Records:
    MDKP
    MRP Document Header Data
    MDTB
    MRP Table Structure (no data)
    PLSC
    Planning Scenario (Long-term Planning)
    MDFD
    MRP Firming Dates
    MDVM
    Planning File Entries
    S094
    LIS -- Stock/Requirements Analysis

  • Data extraction taking long time in source system.

    Hi all,
    I have created one custom datasource which is full update (not delta).
    we are extracting data using function module in the source system.
    it works well in Dev system but when I try to pull even 10 days data from source system to BW in production environment it generates huge log in source system. job log gets full & we have to cancel the job.
    Job log looks as follows
    Job started
    Step 001 started (program SBIE0001, variant &0000000642922, user ID ALEREMOTE)
    Asynchronous transmission of info IDoc 2 in task 0001 (0 parallel tasks)
    DATASOURCE = ZDSHIPTRACKN
    *          Current Values for Selected Profile Parameters               *
    * abap/heap_area_nondia......... 2000000000                              *
    * abap/heap_area_total.......... 2000000000                              *
    * abap/heaplimit................ 40000000                                *
    * zcsa/installed_languages...... DE                                      *
    * zcsa/system_language.......... E                                       *
    * ztta/max_memreq_MB............ 2048                                    *
    * ztta/roll_area................ 6500000                                 *
    * ztta/roll_extension........... 2000000000                              *
    Call customer enhancement BW_BTE_CALL_BW204010_E (BTE) with 3,858 records
    Result of customer enhancement: 3,858 records
    Call customer enhancement EXIT_SAPLRSAP_001 (CMOD) with 3,858 records
    Result of customer enhancement: 3,858 records
    PSA=0 USING & STARTING SAPI SCHEDULER
    Asynchronous send of data package 1 in task 0002 (1 parallel tasks)
    IDOC: Info IDoc 2, IDoc No. 7775180, Duration 00:00:00
    IDoc: Start = 28.01.2011 11:26:36, End = 28.01.2011 11:26:36
    Call customer enhancement BW_BTE_CALL_BW204010_E (BTE) with 0 records
    Result of customer enhancement: 0 records
    Call customer enhancement EXIT_SAPLRSAP_001 (CMOD) with 0 records
    Can someone plz tell me what can be the issue.?
    Thank you

    Hi
    Whats logic for datasource?
    can you share code here?
    it might work fine after some ABAP tuning.
    Regards
    Sudeep

  • Extract the Long Text in txt file

    Hi
    I want a generic program which can extact the long text for any of the object(Material, Customer, Vendor..) and for n number of records in the upload file format taken by the LSMW for long text.
    Regards,

    using FM create_text  you can upload multiple lines of text..,  there is no  separate LSMW program for this.....

  • Extracted Audio longer than movie clip, please help...

    I was reading some of your FAQ's about extracted audio being
    recomposed with a mono instead of stereo for exported audio from a microphone or other mono device, and then importing it back into iMovie after mixing it in Quicktime, to make it stereo (albeit with only mono feed).
    My question is this:
    I extract the audio from the clip that I am running, and it is fine and good while within iMovie, however, once I drag and drop it to my desktop, and open it with quicktime and either play it or export it as mono to get it to play through both speakers, it uses the original
    length of audio not the edited version that i pull from imovie. It is very frustrating, and I am not sure why it keeps doing this.
    While it is in iMovie, the audio and video match, and are synched. But, when I export it, for some reason, it exports the original audio from the unedited clip (which has already been deleted!), and I don't know what to do to get it to export just the audio clip as it stands now within iMovie.
    Any help would be appreciated.
    Thanks,
    Chris
    G5   Mac OS X (10.4.9)  

    Hi Aesthesia - that is a fact of life of non-destructive editing. When audio is extracted from a shortened, cropped clip, it actually extracts the entire audio from the underlying original source clip. You can test this by extracting audio from a cropped clip, and you will find that you can, by direct editing, extend it back to its original length.
    That explains why the audio file when played outside of iMovie plays at the original length.

  • Why is it taking so long to extract the free trial download of creative suit

    why is it taking so long to extract the free trial download of creative suit

    And what specifically? You need to provide much more info. anyway, if the extraction takes longer than half an hour, start over or manualyl extract the files from teh 7z archive using WinZip or WinRar.
    Mylenium

  • Extracting LONG RAW's (Off Topic)

    Hi all,
    Do you know of any function/SQL to extract a LONG RAW to a file
    from the Oracle Server 8.0.5 Linux?
    I.e. I've got records with an ID and a LONG RAW containing binary
    data. I want to export the binary data to a file on then
    server with the same name as the record ID.
    Sorry if this is a bit off-topic but no one else seems to
    know if it's even possible ...
    TIA, Ben.
    null

    Ben Cant (guest) wrote:
    : Hi all,
    : Do you know of any function/SQL to extract a LONG RAW to a file
    : from the Oracle Server 8.0.5 Linux?
    : I.e. I've got records with an ID and a LONG RAW containing
    binary
    : data. I want to export the binary data to a file on then
    : server with the same name as the record ID.
    : Sorry if this is a bit off-topic but no one else seems to
    : know if it's even possible ...
    : TIA, Ben.
    We use perl to do this and it works ok.
    Regards,
    Michael.
    null

  • How long can I expect the extracting process to take?

    I've downloaded the trial version of Premiere, it has taken about 1h 45m.  Now it is "extracting", how long will this take?

    It shouldn't take too long. If it does, switch off of anti-virus for a while and then try again. That should speed up the process.

  • How to download and upload long text for project, WBS , Network,

    Hi all,
    I have two isssues.
    1) I am extracting Projects, WBS , Network , Network activity and network activity element from a SAP 4.7 system using bapi's
    BAPI_PROJECTDEF_GETDETAIL
    BAPI_PROJECT_GETINFO
    BAPI_NETWORK_GETINFO
    BAPI_BUS2054_GETDATA
    I am able to get all the details except long text. I want to know how do i extract the long text other than getting it manually by using select_text and Read_text Function module, is there any bapi to achieve this.
    The reason why i am not using Function modules Read_text and Write_text is, object name( TDNAME ) value stored in STXH table for project, wbs and network are the project, wbs and network itself so i dont have any issues with this but the TDname value for activity and activity element are completely different ( Routing number and counter is stored respectively ) which i am not getting as the part of the bapi(BAPI_NETWORK_GETINFO) output.
    2)  I have to upload the extracted Project and it sub object data to ECC 6.0 system , i am able to achieve this by using BAPI's BAPI_PROJECTDET_CREATE, BAPI_PROJECT_MAINTAIN and BAPI_NETWORK_MAINTAIN. I am not able to load the longtext for the same, is there any way to load the long text .
    All help will be greatly appreciated and rewarded.
    Thanks & Regards,
    Rajanidhi Rajasekeran.

    I don't think there is any BAPI to do it.
    We are doing it by read_text & edit_text . required fields for text name can be fetched by following select
      if not e_activity[] is initial.
        select aaufnr aaufpl baplzl bobjnr b~vornr
          into corresponding fields of table t_longtext
          from afko
            as a
        left join afvc
            as b
            on aaufpl = baufpl
           for all entries in  e_activity
           where a~aufnr = e_activity-network
           and a~aufnr is not null.
      endif.
          txtname = wa_longtext-objnr.
          replace c_nv in txtname with sy-mandt.

  • How to upload and download Long text for WBS, Project, Network

    Hi all,
    I have two isssues.
    1) I am extracting Projects, WBS , Network , Network activity and network activity element from a SAP 4.7 system using bapi's
    BAPI_PROJECTDEF_GETDETAIL
    BAPI_PROJECT_GETINFO
    BAPI_NETWORK_GETINFO
    BAPI_BUS2054_GETDATA
    I am able to get all the details except long text. I want to know how do i extract the long text other than getting it manually by using select_text and Read_text Function module, is there any bapi to achieve this.
    The reason why i am not using Function modules Read_text and Write_text is, object name( TDNAME ) value stored in STXH table for project, wbs and network are the project, wbs and network itself so i dont have any issues with this but the TDname value for activity and activity element are completely different ( Routing number and counter is stored respectively ) which i am not getting as the part of the bapi(BAPI_NETWORK_GETINFO) output.
    2)  I have to upload the extracted Project and it sub object data to ECC 6.0 system , i am able to achieve this by using BAPI's BAPI_PROJECTDET_CREATE, BAPI_PROJECT_MAINTAIN and BAPI_NETWORK_MAINTAIN. I am not able to load the longtext for the same, is there any way to load the long text .
    All help will be greatly appreciated and rewarded.
    Thanks & Regards,
    Rajanidhi Rajasekeran.

    One thread in the correct forum is good enough, no need to double post across ABAP forums.  Thanks.
    Regards,
    Rich Heilman

  • Long text field in CAT2

    Hello Friends,
    How can I extract the long text while runing the CADO report?
    Regards
    Naveen

    there is a tab called EXTRAS and select a output line you ll get long text
    or make a column appear as TEXT change the layout you ll get to see column which can be made visibke
    you should Transaction CATS_DA instead of CADO

  • Extracting Custom Hierarchies, with additional filters to restrict data.

    I am currently working on extracting custom hierarchies from SAP R/3.
    I read a article related to it at
    [http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/50cbb737-b36f-2c10-c78b-b63d116ce313?QuickLink=index&overridelayout=true]  authored by Nilesh Ramesh Ahir.
    My requirement is slightly different though. Since the extraction takes long time, I need to add few fields to selection screen in data source to restrict the data.
    P.S: I tried enhancing the extract structure ROHIEROS, but it cannot be enhanced.
    So please guide me on this.

    Hello Prakash,
    Please check the function module RSSH_HIERARCHY_TRANSFER and see if it helps.
    Regards,
    Praveen

  • Problem with extracting audio

    Hi. I just ripped a show episide from a DVD using handbrake software. Then I imported the episode into imovie. I want to extract a small clip of the audio and bring in into Garageband and use it as a sample.
    I split the video and the audio so I could have the one section that I wanted to use. I selected only that one section, and I extracted the audio from only that one section. It's only supposed to be about 20 seconds of audio. Instead, imovie keeps extracting that audio ffrom the entire 24 minute show no matter what I do.
    The audio clip itself plays correctly in imovie. But whenever I copy it onto my desktop, or in Garageband, it copies the audio from that whole show. The info window for that clip states that it lasts 24 minutes even though it's only 20 seconds long. it makes absolutally no sense. I just need halp extracting the audio that I need. Thanks for your help.

    Earlier versions of iMovie used to sometimes corrupt bits of the project, especially if or when you emptied iMovie's Trash.
    iMovie was re-engineered (..starting with version 5, I think..) so that it now does "non-destructive editing". This means that when you choose to split bits of things into separate clips, or to choose to extract the audio from just one small section of a clip, iMovie nevertheless does not split the clip into small pieces, but directs its attention to just that section which you want to work with.
    It always retains the whole entirety of the original clip(s), so that there's less possibility of corruption of all the tiny bits.
    This means that when you come to extract just a few seconds of - for instance - a 30 minute clip, iMovie extracts the whole 30 mins instead of just the teeny bit you want, but then makes available to you just the few seconds you're interested in.
    This was intended to improve the stability and reliability of iMovie HD ..though it makes some aspects more long-winded.
    A more circuitous way around this, but a "workaround" which will give you exactly what you want, is to:
    1 Split the original video clip so that you have just the one small video section which you want to extract the audio from.
    2 Click on and Select just that one small section.
    3 Click on File and Export and choose the QuickTime tab and alongside "Compress movie for:" choose 'Full Quality', and tick the box marked "Share selected clips only". In the next dialogue, give the clip a meaningful name (like "20 secs video clip") and Save it in your Movies folder.
    4 When that's done, in iMovie choose File and Import, and choose the file you just exported (e.g; "20 secs video clip") and that will be imported into iMovie. Put it on your Timeline, and Extract the audio. It'll extract very quickly, as you've got only a very short video clip to extract it from. You'll now have an audio clip of exactly the right length.
    Simple, logical ..but necessary because iMovie now has some "safeguards" built into it ..but they can make audio extraction a longer process than before.

  • 0ACCOUNT_TEXT no long text?

    Hi all.
    I need to load the long text for 0ACCOUNT, but if I check the datasource only medium and short text exists. However if I check the extract structure long text does exist.
    This is propably very simple, but what do I have to do in order to get the long text extracted?
    BR
    Stefan

    Hi stefan,
    are u able to see the field in the ROOSFIELD table...for ur datasource....check the field attribute coloum for ur TXTLG ..it may be "A"
    if it is A there
    check the properties
    Definition of the individual values:
    'A': Field is hidden in OLTP and BW, property cannot be changed  the customer.
    'M': The DataSource requires a selection across this field before it is able to extract data (Required field for the generation of a request); property cannot be changed by the customer
    'X': The Data Source can select across this field. The customer can change selections and visibility (the field is currently visible and selectable, compare with 'P', '3')
    '1': Pure selection field for the DataSource. The customer can change the selection, but not the visibility (the field is currently selectable , compare with '2').
    '2': Pure selection field for the DataSource. The customer can change the selection, but not the visibility (field is currently no selectable, compare with '1').
    '3': The DataSource can select across this field. The customer can change selection and visibility (the field is currently not visible not selectable, compare with 'P', 'X')
    '4': The DataSource cannot select across this field. The customer can change visibility (the field is currently not visible, compare with ' ')
    hop eit helps
    regards
    AK
    Message was edited by:
            A K

Maybe you are looking for

  • Problem with MSSQL 2005 maintenence plan

    Hi, I am facing a problem with MSSQL 2005 maintenance plan. I created a plan which takes full backup of all the db's and in the same plan I added a clean up task which is suppose to clean all the files older that 1 day. To gain compression I converte

  • Add Cost field in email

    Our customer is looking to add $ amount in an email send from SAP.  Does anyone know where you can edit the info that is included in an email.  View the link to see an what I mean.  http://screencast.com/t/bFgUeiDfMO6p They understand that they can o

  • Newbie questions about Database replication, "backups", and sql version

    Just created my first Sql Database using the "SQL Database Management Portal". A blast but three questions come to mind: 1. Is this DB automatically "replicated"? (In other words,  is DB "failover" or clustering,  a feature of all newly created Azure

  • Monitor multi processor

    hey all.. how i can monitor each processor in my multi processor machine which have solaris 8 .. and if i create thread by using java language why i not see it in the prosess list by use PS command..

  • Adobe photoshop write error not granted??

    Trying to save images from adobe and I keep getting write access not granted. How can I fix this?