Using DBMS_DATAPUMP with LONG data type

I've got a procedure below that calls the DBMS_DATAPUMP procedure using a REMOTE_LINK to move a schema from one database to another. However, a couple of the tables within that schema have columns with the LONG data type. And when I run it I get an error saying that you cannot move data with the LONG data type using a REMOTE LINK. So no data in those particular tables gets moved over.
Has anyone else had this issue? If so, do you have a work around? I tried adding a CLOB column to my table and setting the new CLOB to equal the LONG, but I couldn't get that to work either...even when I tried using a TO_LOB. If I could get that to, then I could just drop the LONG, move the schema, then recreate the LONG column on the opposite side.
Here's my procedure....
DECLARE
     /* EXPORT/IMPORT VARIABLES */
     v_dp_job_handle                    NUMBER ;          -- Data Pump job handle
     v_count                              NUMBER ;          -- Loop index
     v_percent_done                    NUMBER ;          -- Percentage of job complete
     v_job_state                         VARCHAR2(30) ;     -- To keep track of job state
     v_message                         KU$_LOGENTRY ;     -- For WIP and error messages
     v_job_status                    KU$_JOBSTATUS ;     -- The job status from get_status
     v_status                         KU$_STATUS ;     -- The status object returned by get_status
     v_logfile                         NUMBER ;
     v_date                              VARCHAR2(13) ;
     v_source_server_name          VARCHAR2(50) ;
     v_destination_server_name     VARCHAR2(50) ;
BEGIN
     v_project := 'TEST' ;
     v_date := TO_CHAR(SYSDATE, 'MMDDYYYY_HHMI') ;
     v_source_server_name := 'TEST_DB' ;
     v_dp_job_handle := DBMS_DATAPUMP.OPEN(
          OPERATION     => 'IMPORT',
          JOB_MODE     => 'SCHEMA',
          REMOTE_LINK => v_source_server_name,
          JOB_NAME     => v_project||'_EXP_'||v_date,
          VERSION          => 'LATEST') ;
     v_logfile := DBMS_DATAPUMP.KU$_FILE_TYPE_LOG_FILE ;
     DBMS_DATAPUMP.ADD_FILE(
          HANDLE          => v_dp_job_handle,
          FILENAME     => v_project||'_EXP_'||v_date||'.LOG',
          DIRECTORY     => 'DATAPUMP',
          FILETYPE     => v_logfile) ;
     DBMS_DATAPUMP.METADATA_FILTER(
          HANDLE          => v_dp_job_handle,
          NAME          => 'SCHEMA_EXPR',
          VALUE          => '= '''||v_project||''' ') ;
     DBMS_DATAPUMP.START_JOB(v_dp_job_handle) ;
     v_percent_done := 0 ;
     v_job_state := 'UNDEFINED' ;
     WHILE (v_job_state != 'COMPLETED') AND (v_job_state != 'STOPPED')
     LOOP
          DBMS_DATAPUMP.GET_STATUS(
               v_dp_job_handle,
               DBMS_DATAPUMP.KU$_STATUS_JOB_ERROR + DBMS_DATAPUMP.KU$_STATUS_JOB_STATUS + DBMS_DATAPUMP.KU$_STATUS_WIP,
               -1,
               v_job_state,
               v_status) ;
               v_job_status := v_status.JOB_STATUS ;
          IF v_job_status.PERCENT_DONE != v_percent_done THEN
               DBMS_OUTPUT.PUT_LINE('*** Job percent done = '||TO_CHAR(v_job_status.PERCENT_DONE)) ;
               v_percent_done := v_job_status.PERCENT_DONE ;
          END IF ;
          IF BITAND(v_status.MASK, DBMS_DATAPUMP.KU$_STATUS_WIP) != 0 THEN
               v_message := v_status.WIP ;
          ELSIF BITAND(v_status.mask, DBMS_DATAPUMP.KU$_STATUS_JOB_ERROR) != 0 THEN
               v_message := v_status.ERROR ;
          ELSE
               v_message := NULL ;
          END IF ;
          IF v_message IS NOT NULL THEN
               v_count := v_message.FIRST ;
               WHILE v_count IS NOT NULL
               LOOP
                    DBMS_OUTPUT.PUT_LINE(v_message(v_count).LOGTEXT) ;
                    v_count := v_message.NEXT(v_count) ;
               END LOOP ;
          END IF ;
     END LOOP ;
     DBMS_OUTPUT.PUT_LINE('Job has completed') ;
     DBMS_OUTPUT.PUT_LINE('Final job state = '||v_job_state) ;
     DBMS_DATAPUMP.DETACH(v_dp_job_handle) ;
END ;

But the application we have that uses the database cannot be changed to read from a CLOBWhy can't you change the application?
Well, anyway you should point out to your superiors that Oracle documented years ago to not use LONGS anymore...
http://download.oracle.com/docs/cd/B19306_01/server.102/b14220/datatype.htm#sthref3806
It clearly states:
LONG Datatype
Note:
Do not create tables with LONG columns. Use LOB columns (CLOB, NCLOB) instead. LONG columns are supported only for backward compatibility.
Oracle also recommends that you convert existing LONG columns to LOB columns. LOB columns are subject to far fewer restrictions than LONG columns. Further, LOB functionality is enhanced in every release, whereas LONG functionality has been static for several releases.
How do I go from CLOB to LONG?I'm sorry, cannot help you on that one, I don't think you can do that at all (Oracle wants us to stop using LONGS, so, it's a one-way conversion...):
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:1037232794454#15512131314505
So: NO built_in, you'll need to write a program if the clob is ALWAYS LESS THAN 32k in size, you can use plsql..but is that the case in your case? Only you know that.
I believe that question is still unanswered on this forum, but you might try searchin for answers on this forum, and
the 'Database-General' forum: General Database Discussions
Perhaps you can google a Q&D workaround...
( And consider convincing your collegues to just convert your LONGS to LOBS)
Edited by: hoek on Apr 8, 2009 5:43 PM

Similar Messages

  • Moving a table with long data type column

    hi
    1.how to move a table with a long data type column in 8.1.7.3.0 ver database.
    alter table APPLSYS.FND_LOBS_DOCUMENT move lob(BLOB_CONTENT) store as (tablespace testing)
    ERROR at line 1:
    ORA-00997: illegal use of LONG datatype
    2. and a table with varray type column
    alter table APPLSYS.WF_ERROR move lob("USER_DATA"."PARAMETER_LIST") store as (tablespace testing)
    ERROR at line 1:
    ORA-22917: use VARRAY to define the storage clause for this column or attribute
    table description is:
    SQL> desc applsys.wf_error;
    Name Null? Type
    Q_NAME VARCHAR2(30)
    MSGID NOT NULL RAW(16)
    CORRID VARCHAR2(128)
    PRIORITY NUMBER
    STATE NUMBER
    DELAY DATE
    EXPIRATION NUMBER
    TIME_MANAGER_INFO DATE
    LOCAL_ORDER_NO NUMBER
    CHAIN_NO NUMBER
    CSCN NUMBER
    DSCN NUMBER
    ENQ_TIME DATE
    ENQ_UID NUMBER
    ENQ_TID VARCHAR2(30)
    DEQ_TIME DATE
    DEQ_UID NUMBER
    DEQ_TID VARCHAR2(30)
    RETRY_COUNT NUMBER
    EXCEPTION_QSCHEMA VARCHAR2(30)
    EXCEPTION_QUEUE VARCHAR2(30)
    STEP_NO NUMBER
    RECIPIENT_KEY NUMBER
    DEQUEUE_MSGID RAW(16)
    SENDER_NAME VARCHAR2(30)
    SENDER_ADDRESS VARCHAR2(1024)
    SENDER_PROTOCOL NUMBER
    USER_DATA APPS.WF_EVENT_T
    lob column:
    SQL> select owner,table_name,column_name from dba_lobs where table_name='WF_ERROR';
    OWNER TABLE_NAME COLUMN_NAME
    APPLSYS WF_ERROR "USER_DATA"."PARAMETER_LIST"
    APPLSYS WF_ERROR "USER_DATA"."EVENT_DATA"
    pls help me
    thanks and regards
    srinivas

    1. Export and import
    2. Sql*Plus 'copy' command
    It is a good idea to move from 'LONG' to 'CLOB'.

  • How to deal with LONG data type in RTF template

    Hi,
    I'm developing a PO request report in which I should print some attachments. The attachments are stored in the database in table fnd_attachments_long_text in column long_text which data type is LONG. In my case the content of the column long_text is always plain text.
    The query I use to get the text from the table is something like:
    select long_text
    from fnd_documents_long_text
    where <some_conditions....>
    The query runs fine in SQL developer but when I run the XML report I get following error: "Stream has already been closed". The XML file generated is complete in its structure but the XML node which should contain the text of the attachment is empty, therefore I cannot print the attachment in the report.
    I made some researches on metalink and I've found note 832903.1 which explains the same error I'm getting. Looks like I cannot execute more than 1 query using the same JDBC connection if one of these queries retrieves a LONG data type.
    Any advice on how can I get the attachment text to show correctly in my report?
    Thank you

    Hi,
    Thank you for your reply,
    Yes, I tried to get the text as described in that article but maybe I'm missing something because my data template doesn't show the attachment text.
    The article talks about support for BLOB, CLOB and RAW and at the end it states "but we do not have support for RAW and LONG column types at the moment - we're looking into that for a future release". So this makes me think that I won't be albe to retrieve my text since it's stored in a LONG column.
    I think that the error I'm getting is not strictly related to XML publisher but it is in some way related to the JDBC connection used to get the data. Infact I have an old version of the same report I'm trying do develop which is made in Report Builder and it is retrieving the attachment text correctly.
    Right now I'm trying to use the Report Builder engine to get the XML data and then use XML Publisher to create the PDF output. Anyway, if it is possible, I would like to avoid Report Builder and use only XMLP.
    Thanks

  • Working with long data type

    i have table named as testdata in that table
    columns are
    id , data
    id is number,data is long type.
    i want to print the id values which conatains the ' HI H R u' string in data column.

    check this.
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:839298816582

  • Using Long Data type in the Page

    Hi ,
    I have a page (in multiple page creation form ) which is suppose to contain only the NOTES field of the entity being created . The Notes field is defined as LONG data type in the table.
    Two Doubts.
    1. As of now in Jdev , u only have Varchar2 data type when assigning to any messageText layout item. What should be the max value set for Max Lenght of this field on the form . I suppose its 32k+ ,since its Long Field .
    Anybody has used Long notes field before ??
    2. This page has only one item on it , ie Notes ,which i have defined as messageRichText as style. I have been trying to resize this item ,so that it stretches out on entire page . But it just doesnt resizes .. any idea ..below is my PG.xml code
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <!-- dbdrv: exec java oracle/jrad/tools/xml/importer XMLImporter.class java &phase=dat+24 checkfile:~PROD:~PATH:~FILE &fullpath:~PROD:~PATH:~FILE -username &un_apps -password &pw_apps -dbconnection &jdbc_db_addr -userId "1" -rootPackage /oracle/apps/~PROD -rootdir &fullpath:~PROD:mds:directory -->
    <page xmlns:jrad="http://xmlns.oracle.com/jrad" xmlns:oa="http://xmlns.oracle.com/oa" xmlns:ui="http://xmlns.oracle.com/uix/ui" version="9.0.3.8.13_1426" xml:lang="en-US" xmlns:user="http://xmlns.oracle.com/jrad/user" xmlns="http://xmlns.oracle.com/jrad" file-version="$Header$">
    <content>
    <oa:pageLayout id="NotesMainR" amDefName="oracle.apps.xxi.pro.server.ProAM" windowTitle="Pro Notes" controllerClass="oracle.apps.xxi.pro.webui.ProNotesCO">
    <ui:corporateBranding>
    <oa:image id="corporateBrandingImage" source="/OA_MEDIA/FNDSSCORP.gif"/>
    </ui:corporateBranding>
    <ui:contents>
    <oa:messageComponentLayout id="ProInfoR" extends="/oracle/apps/xxi/pro/webui/ProInfoRN"/>
    <oa:pageButtonBar id="PgButton">
    <ui:contents>
    <oa:submitButton id="Back" use="/oracle/apps/fnd/attributesets/Buttons/Back" unvalidated="true" serverUnvalidated="false"/>
    <oa:submitButton id="Save" use="/oracle/apps/fnd/attributesets/Buttons/Save"/>
    <oa:submitButton id="Continue" use="/oracle/apps/fnd/attributesets/Buttons/Continue"/>
    </ui:contents>
    </oa:pageButtonBar>
    <oa:tableLayout id="region3" hAlign="center">
    <ui:contents>
    <oa:rowLayout id="region4" hAlign="left" vAlign="top" width="100%">
    <ui:contents>
    <oa:cellFormat id="region5" height="100%" width="100%" hAlign="left" columnSpan="1" vAlign="top">
    <ui:contents>
    <oa:header id="region6" text="Notes In Table Layout">
    <ui:contents>
    <oa:messageRichTextEditor id="ProNotesI" maximumLength="20000" viewName="CustomerPOVO" viewAttr="ProNotes" fontBar="true" alignmentGroup="true" tipType="shortTip" prompt="Pro Notes" richTextModeDisplayHeight="100%" richTextModeDisplayLength="100%"/>
    </ui:contents>
    </oa:header>
    </ui:contents>
    </oa:cellFormat>
    </ui:contents>
    </oa:rowLayout>
    </ui:contents>
    </oa:tableLayout>
    </ui:contents>
    </oa:pageLayout>
    </content>
    </page>
    any idea??
    thanks

    Hi Padma,
    Thanks for reply !!
    The width is still pain point for me ,as i am unable to increase its width .
    I tried increasing the width of the table to 100%, however ,it still doesn work .
    Any pointers ??
    If you have used this widget before , could you assist me with any sample code u hv ??
    I would really appreciate it
    thanks

  • How can I retrieve a LONG data type using ADO

    In VB I am using an ADODB object to retrieve data from an Oracle table that has a LONG data type column...
    specifically: SELECT TRIGGER_BODY FROM USER_TRIGGERS WHERE TRIGGER_NAME = 'MYTRIGGER'
    I have tried using the GETCHUNK method but it only returns the first 150 or so characters no matter how
    many times I call it???? here is the sample code I'm using........
    Dim Cn As ADODB.Connection, Rs As ADODB.Recordset, SQL As String
    Dim sChunk() As Byte
    Set Cn = New ADODB.Connection
    Set Rs = New ADODB.Recordset
    Cn.CursorLocation = adUseServer
    Cn.Open "Provider=OraOLEDB.Oracle.1;Password=hrzadmin;Persist Security
    Info=True;UserID=hadmin;Data Source=xxx.local"
    SQL = "SELECT trigger_body from user_triggers where trigger_name = 'MYTRIGGER'"
    Rs.Open SQL, Cn, adOpenStatic, adLockReadOnly
    Debug.Print Rs!trigger_name
    Debug.Print Rs!trigger_body
    sChunk = rs.Fields("trigger_body").GetChunk(500)
    Debug.Print sChunk

    I have a similar code which works for chunk size >400,
    The image I am trying to retrieve is huge so the chunksize is also more.
    Did you try with any non meta table?
    For your reference I am pasting my application code below.
    Hope it helps.
    --Jagriti
    Private Sub cmdGetImage_Click()
    Dim bytchunk() As Byte 'variable to store binary data
    Dim destinationFileNum As Integer 'variable for filenumber
    'recordset for fetching Product Image for the product selected form the list
    Dim recProductImage As New ADODB.Recordset
    Dim offset As Long
    Dim totalsize As Long
    Dim roundTrips As Long
    'variables used in calculation of time taken to fetch the image
    Dim startTime As Currency, EndTime As Currency, time As Currency, Freq As Currency
    Dim i As Integer 'counter variable
    i = 0
    On Error GoTo ErrorText 'redirect to error handler
    '** Step 1 **'
    'validating if product is selected from the list
    If cboSelectProduct.Text = "" Then
    MsgBox "Select product from the list!"
    Exit Sub
    End If
    '** Step 2 **'
    'validating if "optChunk" optionbox is selected then
    '"txtChunksize" textbox should contain a value
    If optchunk.Value = True Then
    'validate if chunksize value is null
    If txtChunkSize.Text = "" Then
    MsgBox "Enter value for chunksize "
    Exit Sub
    End If
    'validating that the chunk size entered should be a positive value
    If CInt(txtChunkSize.Text) < 1 Then
    MsgBox "ChunkSize value should be positive!"
    Exit Sub
    End If
    End If
    '** Step 3 **'
    'open image column from product_information table using m_Oracon connection
    recProductImage.Open "SELECT product_image FROM product_information " & _
    " WHERE product_id =" & cboSelectProduct.ItemData(cboSelectProduct.ListIndex) _
    , m_Oracon, adOpenStatic _
    , adLockOptimistic, adCmdText
    'check if product image exists for the product selected
    If Not IsNull(recProductImage!product_image) Then
    'setting mouse pointer on the form "frmChunkSize" to wait state
    frmChunkSize.MousePointer = vbHourglass
    '** Step 4 **'
    'assigning "desitinationFileNum" variable to next file number
    'available for use
    destinationFileNum = FreeFile
    'allocates a buffer for I/O to the temporary file "tempImage.bmp"
    'at the current application path
    Open App.Path & "\tempImage.bmp" For Binary As destinationFileNum
    '** Step 5 **'
    'Get the frequency of internal timer in Freq variable
    QueryPerformanceFrequency Freq
    'start the timer
    QueryPerformanceCounter startTime
    'clear "imgProduct" imagebox
    imgProduct.Picture = LoadPicture("")
    '** Step 6 **
    If optValue.Value = True And optchunk.Value = False Then
    '** Step 7 **
    'using ADO Value property
    bytchunk = recProductImage("product_image").Value
    'appending byte arrary data to the temporary file
    Put destinationFileNum, , bytchunk
    'displaying "No. of Round Trips" in a label to 1
    lblRoundTrips = 1
    ElseIf optchunk.Value = True Then
    '** Step 8 **
    'converting the value entered "txtChunkSize" textbox to long
    'and assigning it to chunksize variable
    m_chunksize = CLng(txtChunkSize.Text)
    'assigning the actual size of the image retrieved to a variable
    totalsize = recProductImage("product_image").ActualSize
    'calculating and assigning the "No. of Round Trips" to a variable
    roundTrips = totalsize / m_chunksize
    'in case fragment of data left, incrementing roundtrips by 1
    If (totalsize Mod m_chunksize) > 0 Then
    roundTrips = roundTrips + 1
    End If
    'In this loop the image is retrieved in terms of chunksize
    'and appended to the temporary file
    Do While offset < totalsize
    '** Step 9 **
    'retrieving product_image from the recordset, in chunks of bytes
    bytchunk = recProductImage("product_image").GetChunk(m_chunksize)
    offset = offset + m_chunksize
    'appending byte arrary data to the temporary file
    Put destinationFileNum, , bytchunk
    Loop
    'displaying "No. of Round Trips" in a label
    lblRoundTrips = roundTrips
    End If
    '** Step 10 **'
    'stop the timer after image retrieval is done
    QueryPerformanceCounter EndTime
    'close the opened file handle
    Close destinationFileNum

  • ADF View Object query to use Oracle  LONG data type

    Hi,
    I'm using a view object that uses Oracle LONG data type.The following exception is thrown
    *"java.sql.SQLException: Stream has already been closed"* and it is not fetching the correct data.
    I have searched in many forums,they suggested to use LOB instead of LONG as LONG is deprecated. But in my case I can't avoid using LONG as some of my legacy applications using the same DB.
    Please suggest me a way
    Thanks in Advance
    Felix

    Thanks for your reply Arun,
    I have solved this problem using the solution suggested by this blog [AskTom-Link|http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:839298816582]
    In the above blog link,they have suggested to convert Long to Varchar by functions and asked to use this function in the column.
    Thank you all guys who have seen this post.
    Regards,
    Felix

  • Need to convert long data type to varchar2

    I need to convert a long datatype in an existing table to a
    varchar2, in either another table or view. I have a 3rd party
    application which needs to query the data in the long data type,
    but it can "handle" the long.
    What is the best way to do this? I tried to make a trigger, but
    I must be missing something. Here is the trigger.
    CREATE OR REPLACE TRIGGER "PROD".SV_GET_RTG_COMNT
    BEFORE INSERT OR UPDATE ON PROD.RELS_RTG_SEQ_COMNT
    FOR EACH ROW
    WHEN (OLD.rels_rtg_no = NEW.rels_rtg_no)
    DECLARE
    -- DECLARE VARIABLES
    RTG_COMNT_VAR VARCHAR2(32);
    RTG_COMNT_LONG LONG;
    BEGIN
    Select COMNT_TXT into RTG_COMNT_LONG
    from rels_rtg_seq_comnt;
    RTG_COMNT_VAR := 'TEXT' || substr(RTG_COMNT_LONG,1,32);
    -- If INSERTING
    Insert into SV_RTG_SEQ_COMNT (print_cd, comnt_no,
    seq_no, rtg_no, comnt_txt) values
    (:new.print_cd, :new.comnt_no, :new.seq_no, :new.rels_rtg_no,
    rtg_comnt_var);
    END;
    I tried to use the substr command on the comnt_txt in view but
    received an invalid datatype error.
    Any help would be greatly appreciated.
    Doug

    create another table with clob datatype
    1)create table clob_tab(pkval number,clob_col clob);
    2) insert into clob_tab (select pkval,to_lob(long_col) from
    long_tab);
    3) use dbms_lob package to do string manipulation using
    substr,instr functions on clob column.

  • Error in getting Long data type from Table

    Hi All,
    I have one table say xx_long. In this table one column is having Long data type.
    Now I want this values will get in to the PL/SQL variable. I taken variable data type as long but it is showing error "ORA-00997: illegal use of LONG datatype".
    Sample code with which I tried:
    declare
    a long;
    begin
    select slno into a from xx_long where slno = 100;
    dbms_output.put_line('Value:'||a);
    end;
    Please help me on this.
    Thanks in advance.
    Regards,
    Hari

    LONG columns cannot appear in certain parts of SQL statements:
    WHERE clauses, GROUP BY clauses, ORDER BY clauses, or CONNECT BY clauses or with the DISTINCT operator in SELECT statements
    The UNIQUE operator of a SELECT statement
    The column list of a CREATE CLUSTER statement
    The CLUSTER clause of a CREATE MATERIALIZED VIEW statement
    SQL functions (such as SUBSTR or INSTR)
    Expressions or conditions
    SELECT lists of queries containing GROUP BY clauses
    SELECT lists of subqueries or queries combined by the UNION, INTERSECT, or MINUS set operators
    SELECT lists of CREATE TABLE ... AS SELECT statements
    SELECT lists in subqueries in INSERT statements

  • Call a method with complex data type from a DLL file

    Hi,
    I have a win32 API with a dll file, and I am trying to call some methods from it in the labview. To do this, I used the import library wizard, and everything is working as expected. The only problem which I have is with a method with complex data type as return type (a vector). According to this link, import library wizard can not import methods with complex data type.
    The name of this method is this:   const std::vector< BlackfinInterfaces::Count > Counts ()
    where Count is a structure defined as below:
    struct Count
       Count() : countTime(0) {}
       std::vector<unsigned long> countLines;
       time_t countTime;
    It seems that I should manually use the Call Library Function Node. How can I configure parameters for the above method?

    You cannot configure Call Library Function Node to call this function.  LabVIEW has no way to pass a C++ class such as vector to a DLL.

  • JDBC insert with XMLTYPE data type

    Hi,
    SOAP to JDBC scenario. Oracle 11G as a receiver.
    Requirement is to  insert whole xml payload message in one of Oracle table fields as a xml string. Target oracle DB table column is defined with XMLTYPE data type, it has capacity to hold xml data more than 4GB. I am using graphical mapping with direct INSERT statement.
    When I try to insert xml payload with smaller size transaction goes through. However when the xml payload size increases it is giving following error in JDBC receiver communication channel monitoring.
    Could not execute statement for table/stored proc. "TABLE_NAME" (structure "StructName") due to java.sql.SQLException: ORA-01704: string literal too long
    Here is insert statement as in communication channel monitoring. (Note: XML payload with bold characters is truncated)
    INSERT INTO  TABLE_NAME (REQ_ID, OUTAGE_OBJ, TIMESTAMP, PROCESSED_FLAG) VALUES (VAL1, <?xml version="1.0" encoding="UTF-8"?>............</>, TO_DATE(2010-11-15 10:21:52,YYYY-MM-DD HH24:MI:SS), N)
    Any suggestions to handle this requirement?
    Thank you in advance.
    Anand More.

    Hi Anand,
    The problem here is definitely the length of the SQL query. i.e "INSERT INTO ......... VALUES......."
    This is what i got when i searched for this ORACLE error code:
    ORA-01704: string literal too long
    Cause: The string literal is longer than 4000 characters.
    Action: Use a string literal of at most 4000 characters. Longer values may only be entered using bind variables.
    Please ask a ORACLE DB expert on how to handle this Also i am not sure how can we handle Bind Varibales in SAP PI.
    I hope this helps.
    Regards, Gaurav.

  • TIPS(63) : LONG DATA TYPE의 LENGTH 구하기

    제품 : PL/SQL
    작성날짜 : 1999-04-15
    TIPS(63) : LONG DATA TYPE의 LENGTH 구하기
    =========================================
    PURPOSE
    다음은 function 을 적용할 수 없는 long data type 의 length 를
    구하는 방법을 소개한다.
    Explanation
    Long DataType 에 대해 Length 를 구하려 하는 경우 다음과 같은 Error 가 발생한다.
    SQL> create table TOY
    2 (Toy_ID NUMBER, Description LONG);
    Table created.
    SQL> select LENGTH(Description) from TOY;
    select LENGTH(Description) from TOY
    ERROR at line 1:
    ORA-00932: inconsistent datatypes
    "Inconsistent DataTypes" Error 는 LONG DataType 으로 정의된 Column 에
    Function 을 적용하였기 때문에 발생한다.
    VARCHAR2 Type 을 사용하면 정상 처리할 수 있으나, Oracle7 에서는 VARCHAR2 는
    2,000 Characters 만 저장할 수 있으며, Oracle8 에서는 4,000 Characters 이다.
    Oracle8 에서는 Long Data 를 저장하기 위해 LOB DataType 을 사용할 수 있으며,
    LONG Data Type 은 Oracle7/Oracle8 모두 Support 되므로 LONG Type 에 대해
    Length 를 확인하는 방법을 알아본다.
    Example
    다음은 anonymous PL/SQL Block 을 통해 TOY Table 에서 LONG Column 의
    Length 를 구하는 Script 이다.
    1. Single Record 에 대한 예
    $ vi len_long.sql
    declare
    length_var NUMBER;
    cursor TOY_CURSOR is
    select * from TO;
    toy_val TOY_CURSOR%ROWTYPE;
    begin
    open TOY_CURSOR;
    fetch TOY_CURSOR into toy_val;
    length_var := LENGTH(toy_val.Description);
    DBMS_OUTPUT.PUT_LINE('Length of Description: '||length_var);
    close TOY_CURSOR;
    end;
    SQL> set serveroutput on
    SQL> @len_long
    Length of description : 21
    PL/SQL procedure successfully completed.
    2. Multiple Record 에 대해서는 cursor FOR Loop 를 사용한다.
    $ vi len_long.sql
    declare
    length_var NUMBER;
    cursor TOY_CURSOR is
    select * from TOY;
    toy_val TOY_CURSOR%ROWTYPE;
    begin
    for toy_val in TOY_CURSOR loop
    length_var := LENGTH(toy_val.Description);
    DBMS_OUTPUT.PUT_LINE('ID: '||toy_val.Toy_ID);
    DBMS_OUTPUT.PUT_LINE('Length of Description: '||length_var);
    end loop;
    end;
    SQL> set serveroutput on
    SQL> @len_long
    ID: 1
    Length of Description: 21
    ID: 2
    Length of Description: 27
    PL/SQL procedure successfully completed.
    Reference Document
    ------------------

    Hi Frank,
    I have the exact same scenario where I have huge data coming from DB and its a must that I provide pagination.
    I tried implementing as per the document but the pagination is not working for me too.
    Details of the scenario:
    1. I have a session facade method which takes a searchCriteria (custom criteria) as the input parameter and returns a list of entities.
    a)This is the first method that I call as a default method activity in my taskflow.
    b)The result of this method is dragged and dropped as table in the jsff. (*which created a methodIterator in pageDef unlike the documentation which has accessorIterator*).
    2. I declared 2 class level variables
    a) List<Entity> result: which is set once the method in the (1) above is executed.
    b) long size: which is also set from the method (1) above.
    3. I defined getEntityAll(int index,int range) method which returns List<Entity> as per the index and range using the result (class level variable populated by method in 1)
    4. I defined getEntityAllSize() method which returns the size (class level variable populated by method in 1).
    5. I created the datacontrol on top of the session facade bean.
    6. I made sure to change the DataControlHandler = "oracle.adf.model.adapter.bean.DataFilterHandler"
    7. I've set the rangeSize = 25 in my pagedef.
    Now when I run my page, my default method activity calls the method in (1) above and populates the table, with a scroll bar.
    Once I start scrolling, it calls my method in (1) but it does not call either of the methods (getEntityAll(int index,int range) & getEntityAllSize()) which adds the pagination behavior.
    After this, my table has just 25 rows and further scrolling does not invoke any of the methods from the session bean.
    I'm using jdev : JDEVADF_11.1.1.4.0_GENERIC_101227.1736.5923 (11.1.1.4.0).
    Please let me know if I am missing anything.
    Thanks in advance!
    Swapna

  • Create Tabel having LONG Data Type

    HI Team,
    I want to create table but for table i have 2 LONG data type is throwing error message please give the light

    JustinCave wrote:
    1) When you're getting an error, it's always helpful to include the error.  Otherwise, we have to guess.  And if we guess wrong, our answers will be incorrect and we'll waste everyone's time.  Including the Oracle version is also useful.
    2) Why, oh why would you want to use the LONG data type?  That type has been depricated since 9.0.1.  It was replaced by the CLOB data type (assuming you are storing large amounts of character data-- BLOB would be the replacement for LONG RAW columns).  Data in a LONG is terribly difficult to work with in PL/SQL.
    3) My recollection is that one of the (many, many, many) restrictions on a LONG is that you can only have 1 per table.  I'm guessing that is the error you're getting (though if you post the error, I wouldn't have to guess).
    Justin
    Even oracle should probably re-consider its data dictionary views not to use long datatype.
    e.g. Does not look perfect when you see LONG datatype for TEXT column in dba_views/all_views/user_views and that too in latest version Oracle 12c
    Cheers,
    Manik.

  • Retrieve data from LONG data types

    Hi,
    I am trying to retrieve data from LONG data types with following query.
    select * from all_views where upper(text) like '%TABLE_NAME%';
    In above query text column has long datatype. This query works for varchar, but it returns an error for long.
    How can I modify the query so that it returns data from text column.
    Thanks in advance,
    Aditya

    You can't use any expressions against LONG. One solution is to use PL/SQL:
    BEGIN
        FOR v_rec IN (SELECT * FROM ALL_VIEWS) LOOP
          IF UPPER(v_rec.text) LIKE '%TABLE_NAME%'
            THEN
              DBMS_OUTPUT.PUT_LINE(v_rec.text);
          END IF;
        END LOOP;
    END;
    /SY.

  • Define variable with void data type.

    Hi,
    I would like to define a variable and a structure with void data type.
    How could I define it?
    regards.

    HI SijinK,
    Thanks for the reply.
    I want to call some "dll" in the TestStand. In this "dll", function requires some variable of void data type as input.
    e.g.  dll - Test.dll
    Function  - short int Func_a (void var_a, long var_b, void *var_c, custom_struc *var_d)
    I want to call this function in the TestStand. Using "C/C++ Dll" adapter module and "Action" step type, I will call this dll and its function.
    For passing values to this function, I need to define some variable with respective data type.
    Please let me know how could I do this.
    Regards.

Maybe you are looking for

  • How to force simple tags and null attributes to appear when using SQL/XML?

    Hello everybody: I'm developing a non-schema based XMLType view. When the XML document is generated, i noticed two things I need to manage in order to achieve the desired result: 1. Oracle generates a <tag></tag> pair for each XMLELEMENT defined; in

  • My MacBook screen is stuck in "presentation" mode after using my "Mini DisplayPort to VGA Adapter." How can I fix this?

    My MacBook screen is stuck in "presentation" mode (I don't know the correct term) after using my Apple Mini DisplayPort to VGA Adapter - meaning the screen fonts and windows are larger than usual. How can I fix this? I've changed the display settings

  • Leading Zeros in the Numeric Field

    I am working with accounting numbers that may start with zero (0). After this information is inputted and you tab or hit return the leading zero is removed and goes to the first numberic digit. How can I make the leading zero display? Thanks,

  • Kipi-plugin too old?

    I get this error when try to batch convert in digikam. "Cannot run properly 'convert' program from 'ImageMagick' package". Looking in to this it seems to be a problem with the kipi-plugin. This was a bug with the beta version from October 2007 and I

  • Blacks Dots at top of webpage and formating issue with table

    I have a basic page with a table layout, spry horizontal menu, spry accordion menu and a bit of Jquery mixed in for the content. In Safari and Chrome two black dots appear at the top of the page. I'm not sure where these are coming from. Thoughts? In