Using dbms_lob in trigger 10gR2

Hello,
I'm trying to read from a clob using dbms_lob in my trigger and assigning the value to a variable. My trigger is compiling fine, but it doesn't seem to be working.
I'm using 10gR2. Am I misunderstanding how to read from/assign to a variable in a trigger?
Line from trigger code:
v_serial_start := dbms_lob.instr(:new.search_xml_clob,'serial=') + 8;
Thanks,
Mimi

Here's a quick example that works fine for me....
ME_XE?create table clobberin_tyme
  2  (
  3     some_column    number,
  4     variable_value number default 0,
  5     some_clob      clob default empty_clob()
  6  );
Table created.
Elapsed: 00:00:03.98
ME_XE?
ME_XE?
ME_XE?create or replace trigger clobberin_tymeT01
  2  before insert or update on clobberin_tyme
  3  for each row
  4  declare
  5     v_serial_start    number;
  6  begin
  7
  8     v_serial_start       := dbms_lob.instr(:new.some_clob,'serial=') + 8;
  9
10     :new.variable_value  := v_serial_start;
11
12  end;
13  /
Trigger created.
Elapsed: 00:00:02.62
ME_XE?
ME_XE?
ME_XE?insert into clobberin_tyme (some_column) values (1);
1 row created.
Elapsed: 00:00:00.31
ME_XE?
ME_XE?select * from clobberin_tyme;
       SOME_COLUMN     VARIABLE_VALUE SOME_CLOB
                 1                  8
1 row selected.
Elapsed: 00:00:00.17
ME_XE?
ME_XE?update clobberin_tyme
  2     set   some_column = 2,
  3           some_clob = 'hello world serial= coco puffs, i am cucu for them';
1 row updated.
Elapsed: 00:00:00.25
ME_XE?
ME_XE?select * from clobberin_tyme;
       SOME_COLUMN     VARIABLE_VALUE SOME_CLOB
                 2                 21 hello world serial= coco puffs, i am cucu for them
1 row selected.
Elapsed: 00:00:00.01

Similar Messages

  • Need help in using dbms_lob.read

    I need to upload a file into an Oracle table into a Blob column. The file name along with the file contents are all in one BLOB column.
    Once that is done I need to read from the file and extract the file contents and load it into a staging table.
    File being uploaded is a *.CSV* file.
    E.g. Of the .CSV file is: ABC.csv file and its contents will look like:
    1,Hello,Nisha
    2,Hi,Ravi
    3,Bye, Rahul
    Etc…..
    Therefore the table containing the BLOB column will contain:
    File Creation_date
    ABC.csv 09/11/2009
    How can I read a file from the BLOB column and upload into a staging table?
    Final Staging table should look like:
    Record Number Greet Name
    1 Hello Nisha
    2 Hi Ravi
    3 Bye Rahul
    I think I am suppose to use dbms_lob.read, but I am not really sure how to use it. If there is any script, kindly mail me the same.
    Thanks....

    Nisha,
    Check this example (test) and see if it can be any help. I have utl_file and sqlldr
    First Method -- I loaded alert.log successfully and you can imagine how big this file can be (5MB in my test case)
    create table t1clob
    ( clob_text clob);
    CREATE OR REPLACE DIRECTORY DIR AS '/path_to_csv_file/;
    DECLARE
       clob_data   CLOB;
       clob_file   BFILE;
    BEGIN
       INSERT INTO t1clob
       VALUES (EMPTY_CLOB ())
       RETURNING clob_text INTO clob_data;
       clob_file   := BFILENAME ('DIR', ABC.csv');
       DBMS_LOB.fileopen (clob_file);
       DBMS_LOB.loadfromfile (clob_data,
                              clob_file,
                              DBMS_LOB.getlength (clob_file)
       DBMS_LOB.fileclose (clob_file);
       COMMIT;
    END;Second Method: Use of Sqlldr
    Example of controlfile
    LOAD DATA
    INFILE alert.log "STR '|\n'"
    REPLACE INTO  table t1clob
       clob_text char(30000000)
    )Hope this helps.

  • Data-acquisition with NI 6036E DAQ card & GPIB using an external trigger

    Hi all,
    I hope somebody could give me some help with the following and answer some questions:
    Simple system description:
    Labview 6.1
    PCI-GPIB card
    6036E DAQ card
    In my system, I am using an external analog trigger signal (A) for continuous data-acquisition. Characteristics of the analog trigger signal (A) are: ~40 Hz, signal height +1.48V, triggered by rising edge (the analog trigger signal (A) could be changed to a TTL signal). Each data-acquisition is done within ~1.0 ms after the rising edge of the trigger pulse. The timing of the data-acquisition and analyzing procedure is controlled by execution in a sequence structure placed in a loop.
    Now, I connected a power meter to the system, to measure the laser power during the data-acquisition. The power meter has two options to provide the laser power data:
    a) via analog signal output (voltage corresponds to laser power in watts)
    b) via GPIB (direct output reading of laser power in watts).
    Problem:
    During a certain point in my data-acquisition sequence structure (defined by a frame), I want to use the next occuring analog trigger signal (A) to acquire 1 value from the power meter.
    How do I do this in Labview programming for the following two situations?
    a) If I connect the analog output from the power meter to an analog input channel of the 6036E DAQ card. The analog trigger (A) would be connected to a second analog input channel (In case the analog trigger signal (A) is changed to a TTL signal it would be connected to the PFI0/Trig input pin on the DAQ card).
    b) If I use the GPIB connection of the power meter. The analog trigger (A) would be connected to a second analog input channel (In case the analog trigger signal (A) is changed to a TTL signal it would be connected to the PFI0/Trig input pin on the DAQ card).
    An other possibility would be to trigger the power meter directly, so it outputs constantly power meter values at ~40 Hz. How could I than acquire 1 power meter value (at a certain time im my sequence structure) via analog input at DAQ card or GPIB?
    Additional questions:
    How do I configure the PFI0/Trig pin on the 6036E DAQ board individually as an INPUT?
    How do I use an analog trigger signal (A) as counting signal for a loop, or as an activation signal for a sequence structure which includes GPIB commands?
    It would be very nice if somebody could give me some help.
    Kind regards,
    beam

    Hi beam,
    I just want to verify that I understand your situation correctly:
    An external trigger signal (A) is wired to one of your input channels (e.g. CH0) to trigger data acquisition of a second channel (e.g. CH1). Your power meter is connected to an analog input channel, which you would like to trigger with a certain rising edge at some of your sequence structure.
    Problem:
    During a certain point in my data-acquisition sequence structure (defined by a frame), I want to use the next occuring analog trigger signal (A) to acquire 1 value from the power meter.
    How do I do this in Labview programming for the following two situations?
    a) If I connect the analog output from the power meter to an analog input channel of the 6036E DAQ card. The analog trigger (A) would be connected to a second analog input channel (In case the analog trigger signal (A) is changed to a TTL signal it would be connected to the PFI0/Trig input pin on the DAQ card).
    If a task has been configured to acquire signal from one analog channel, it's not possible to run a second analog input task or to add a second channel on the fly. You had mentioned that it's possible to read from the instrument through GPIB. Is it possible to perform a software trigger such that at a certain frame of your structure, when the trigger signal A reaches voltage "x", a GPIB command is written to your power meter to query a measurement reading?
    Additional questions:
    How do I configure the PFI0/Trig pin on the 6036E DAQ board individually as an INPUT?
    You do not need to explicitly configure the PFI0 line as an input. If you want to use it as an input such that it acts as an analog trigger, simply wire the trigger signal to this pin. When configuring the trigger in your software, specify PFI0 as the trigger source.
    How do I use an analog trigger signal (A) as counting signal for a loop, or as an activation signal for a sequence structure which includes GPIB commands?
    You can try using the Limit VI to find out when the trigger signal reaches a certain level, and count how many times this level is reached. Similarly, you can use this as the condition to execute GPIB commands.
    Hope this helps,
    Lesley

  • With DAQmx, how to use AO start trigger for AO/AI synchronization with finite AI sampling

    I am a new user to DAQmx and I am trying to synchronize AI (finite samples) with AO in LabVIEW 7.1 using a PCI 6229 card. I want to generate a finite waveform (AO) and, subsequently, collect a finite number of voltage samples (AI). I would like to repeat the AO-AI cycles in a while loop.
    Alternatively, I could use an infinite AO generation and collect finite number of voltage samples on AI but always exactly at the same spot of the AO buffer.
    Using traditional DAQ and a 6024E card, I used a counter triggered by AO start trigger signal (example attached). I have problems with translating this example into DAQmx.
    Please help!
    Ruber
    Attachments:
    AIAODelay_traditional_Eseries.vi ‏155 KB

    Lesley,
    Thank you very much for your suggestion. Late last night I actually tried a to use AI start trigger instead of AO start trigger and it worked (since I tried the AI & AO to start simultaneously, it does not matter what triggers what), even in the loop. The devil is in details, as I had to carefully wire the number of data points and what to place inside/outside the loop.
    The problem with shared clock is that I need to sample the AI and AO at different rates but using AO and AI clock separately did not seem to affect the performance.
    I still want to try to use the AO start trigger (as you suggest) because I would like to delay the AI by a few ms from the AO. Is there a simple way to to that?
    I suppose, switching from traditional DAQ to DAQmx requires your brain to be rewired - after playing with it for a couple of days and nights I developed a "feeling" for it. One of the differences was that, in order to use this example in the loop, one has to use 'stop task' inside and 'clear task' outside the loop.
    Thanks again!
    Radek Uberna

  • Error while creating AW using DBMS_LOB with XML..

    Hi All,
    I am trying to create AW using DBMS_LOB package with XML,
    while creating AW,i am facing the following error.find the code also below :
    declare
    xml_awcreate_clob clob;
    xml_awcreate_st varchar2(4000);
    begin
    DBMS_LOB.CREATETEMPORARY(xml_awcreate_clob,TRUE);
    dbms_lob.open(xml_awcreate_clob, DBMS_LOB.LOB_READWRITE);
    dbms_lob.writeappend(xml_awcreate_clob, 48, '<?xml version = ''1.0'' encoding = ''UTF-8'' ?>');
    dbms_lob.writeappend(xml_awcreate_clob, 43, '');
    dbms_lob.writeappend(xml_awcreate_clob, 63, '<AWXML version = ''1.0'' timestamp = ''Mon Feb 11 13:29:11 2002'' >');
    dbms_lob.writeappend(xml_awcreate_clob, 15, '<AWXML.content>');
    dbms_lob.writeappend(xml_awcreate_clob, 25, ' <Create Id="Action41">');
    dbms_lob.writeappend(xml_awcreate_clob, 19, ' <ActiveObject >');
    dbms_lob.writeappend(xml_awcreate_clob, 163, ' <AW Name="NEW_XML_AW" LongName="NEW_XML_AW" ShortName="NEW_XML_AW" PluralName="NEW_XML_AW" Id="NEW_XML.AW"/>');
    dbms_lob.writeappend(xml_awcreate_clob, 19, ' </ActiveObject>');
    dbms_lob.writeappend(xml_awcreate_clob, 11, ' </Create>');
    dbms_lob.writeappend(xml_awcreate_clob, 16, '</AWXML.content>');
    dbms_lob.writeappend(xml_awcreate_clob, 8, '</AWXML>');
    dbms_lob.close(xml_awcreate_clob);
    xml_awcreate_st := sys.interactionExecute(xml_awcreate_clob);
    end;
    ORA-21560: argument 2 is null, invalid, or out of range
    ORA-06512: at "SYS.DBMS_LOB", line 833
    ORA-06512: at line 12
    Any idea or thought on this would be appreciable.
    Thanks in advance.
    Anwar

    Did you change any of the text in the lob write statements ?
    I believe you get this error if you increase the number of characters without increasing the 1st argument which looks as though it represents the number of characters

  • Error while converting CLOB to varchar using DBMS_LOB.SUBSTR() in Oracle11g

    Hi
    Whenever I am using DBMS_LOB.SUBSTR(columnname,4000,1) package for a clob column in a simple Select Query, the following error is thrown for Oracle 11g version.
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small ORA-06512: at line 1.
    Please find the installation details of the database and the character set
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    PL/SQL Release 11.2.0.1.0 - Production
    CORE     11.2.0.1.0     Production
    TNS for Linux: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production
    PARAMETER VALUE
    NLS_LANGUAGE AMERICAN
    NLS_TERRITORY AMERICA
    NLS_CURRENCY $
    NLS_ISO_CURRENCY AMERICA
    NLS_NUMERIC_CHARACTERS .,
    NLS_CHARACTERSET AL32UTF8
    NLS_CALENDAR GREGORIAN
    NLS_DATE_FORMAT DD-MON-RR
    NLS_DATE_LANGUAGE AMERICAN
    NLS_SORT BINARY
    NLS_TIME_FORMAT HH.MI.SSXFF AM
    NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM
    NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZR
    NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZR
    NLS_DUAL_CURRENCY $
    NLS_COMP BINARY
    NLS_LENGTH_SEMANTICS BYTE
    NLS_NCHAR_CONV_EXCP FALSE
    NLS_NCHAR_CHARACTERSET AL16UTF16
    NLS_RDBMS_VERSION 11.2.0.1.0
    It is working fine if I reduce from 4000 to 3500 . But I want to use 4000.
    Please let me know if any solution

    you are using a multibyte character set:
    NLS_CHARACTERSET AL32UTF8
    so each character takes between 1 and 4 bytes of storage.
    a varchar2(4000) column can only hold 4000 BYTES. Regardless of the character set - varchar2 is limited to 4000 bytes.
    In a single byte character set, that is 4000 characters as a character = a byte
    In your character set, a varchar2(4000) can hold somewhere between 1000 and 4000 characters - depending on what the characters are.
    So, you must have some CLOB whose first 4000 characters include at least one "more than one byte" character. That won't fit into a varchar2(4000)
    Your approach of backing off the substr size is reasonable (and you'll need to remember that in your application - end users can type in as little as 1000 characters and get an error about the column being too small!) as it reduces the number of BYTES to be belong 4000.

  • Error while using Before report trigger. -- Urgent

    Dear All,
    The following error I am getting when I execute my data template where I have used Before Report Trigger. I am also pasting the Data Template that I have developed.
    ============================
    Error
    ============================
    XDO Data Engine Version No: 5.6.3
    Resp: 20560
    Org ID : 204
    Request ID: 4846248
    All Parameters: P_LOB=01:P_DIV_FROM=:P_DIV_TO=:P_FROM_ORG=:P_TO_ORG=:P_INV_FROM=:P_TO_INV=:P_TRX_DATE_FROM="2003/01/01 00:00:00":P_TRX_DATE_TO="2003/01/15 00:00:00"
    Data Template Code: SSBWIPANA_MFGR
    Data Template Application Short Name: WIP
    Debug Flag: N
    {P_DIV_FROM=, P_TRX_DATE_TO=2003/01/15 00:00:00, P_DIV_TO=, P_FROM_ORG=, P_TO_ORG=, P_TRX_DATE_FROM=2003/01/01 00:00:00, P_INV_FROM=, P_LOB=01, P_TO_INV=}
    Calling XDO Data Engine...
    [122407_011745100][][EXCEPTION] SQLException encounter while executing data trigger....
    java.sql.SQLException: ORA-06550: line 2, column 12:
    PLS-00302: component 'P_LOB' must be declared
    ORA-06550: line 2, column 1:
    PL/SQL: Statement ignored
    ORA-06550: line 3, column 12:
    PLS-00302: component 'P_DIV_FROM' must be declared
    ORA-06550: line 3, column 1:
    PL/SQL: Statement ignored
    ORA-06550: line 4, column 12:
    PLS-00302: component 'P_DIV_TO' must be declared
    ORA-06550: line 4, column 1:
    PL/SQL: Statement ignored
    ORA-06550: line 5, column 12:
    PLS-00302: component 'P_FROM_ORG' must be declared
    ORA-06550: line 5, column 1:
    PL/SQL: Statement ignored
    ORA-06550: line 6, column 12:
    PLS-00302: component 'P_TO_ORG' must be declared
    ORA-06550: line 6, column 1:
    PL/SQL: Statement ignored
    ORA-06550: line 7, column 12:
    PLS-00302: component 'P_FROM_INV' must be declared
    ORA-06550: line 7, column 1:
    PL/SQL: Statement ignored
    ORA-06550: line 8, column 12:
    PLS-00302: component 'P_TO_INV' must be declared
    ORA-06550: line 8, column 1:
    PL/SQL: Statement ignored
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
         at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:743)
         at oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableStatement.java:215)
         at oracle.jdbc.driver.T4CCallableStatement.executeForRows(T4CCallableStatement.java:967)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1168)
         at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3327)
         at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3433)
         at oracle.jdbc.driver.OracleCallableStatement.execute(OracleCallableStatement.java:4394)
         at oracle.apps.xdo.dataengine.XMLPGEN.executeTriggers(XMLPGEN.java:699)
         at oracle.apps.xdo.dataengine.XMLPGEN.processData(XMLPGEN.java:254)
         at oracle.apps.xdo.dataengine.XMLPGEN.processXML(XMLPGEN.java:205)
         at oracle.apps.xdo.dataengine.XMLPGEN.writeXML(XMLPGEN.java:237)
         at oracle.apps.xdo.dataengine.DataProcessor.processData(DataProcessor.java:364)
         at oracle.apps.xdo.oa.util.DataTemplate.processData(DataTemplate.java:236)
         at oracle.apps.xdo.oa.cp.JCP4XDODataEngine.runProgram(JCP4XDODataEngine.java:293)
         at oracle.apps.fnd.cp.request.Run.main(Run.java:157)
    =====================================================
    Data Template
    ====================================================
    <dataTemplate name="SSBWIPANA_MFGR" defaultPackage="PRODUCTION" version="1.0">
    <parameters>
    <parameter name="P_LOB" datatype="charecter"/>
    <parameter name="P_DIV_FROM" datatype="charecter"/>
    <parameter name="P_DIV_TO" datatype="charecter"/>
    <parameter name="P_FROM_ORG" datatype="charecter"/>
    <parameter name="P_TO_ORG" datatype="charecter"/>
    <parameter name="P_FROM_INV" datatype="charecter"/>
    <parameter name="P_TO_INV" datatype="charecter"/>
    <parameter name="P_TRX_DATE_FROM" datatype="charecter"/>
    <parameter name="P_TRX_DATE_TO" datatype="charecter"/>
    </parameters>
    <dataQuery>
    <sqlStatement name="Q_1">
    <![CDATA[SELECT DISTINCT MSI.CONCATENATED_SEGMENTS, MMT.INVENTORY_ITEM_ID,
                    MSI.DESCRIPTION, MMT.TRANSACTION_UOM, SDT.TRX_DATE,
                    MTP.ORGANIZATION_CODE, MMT.ORGANIZATION_ID
               FROM MTL_MATERIAL_TRANSACTIONS MMT,
                    MTL_PARAMETERS MTP,
                    MTL_SYSTEM_ITEMS_VL MSI,
                    SSBWIP_DATE_TEMP SDT
              WHERE MMT.INVENTORY_ITEM_ID = MSI.INVENTORY_ITEM_ID
                AND MMT.ORGANIZATION_ID = MSI.ORGANIZATION_ID
                AND MSI.ORGANIZATION_ID = MTP.ORGANIZATION_ID
                AND MMT.ORGANIZATION_ID = MTP.ORGANIZATION_ID
                AND MMT.TRANSACTION_TYPE_ID IN (17, 44)
                AND MMT.ORGANIZATION_ID IN (
                       SELECT MP.ORGANIZATION_ID
                         FROM MTL_PARAMETERS MP, GL_CODE_COMBINATIONS GCC
                        WHERE MP.MATERIAL_ACCOUNT = GCC.CODE_COMBINATION_ID
                          AND GCC.SEGMENT1 = :P_LOB
                          AND (GCC.SEGMENT2 BETWEEN NVL (:P_DIV_FROM,
                                                         GCC.SEGMENT2)
                                                AND NVL (:P_DIV_TO, GCC.SEGMENT2)
                AND MTP.ORGANIZATION_CODE BETWEEN NVL (:P_FROM_ORG,
                                                       MTP.ORGANIZATION_CODE
                                              AND NVL (:P_TO_ORG,
                                                       MTP.ORGANIZATION_CODE
                AND MSI.CONCATENATED_SEGMENTS BETWEEN NVL
                                                        (:P_FROM_INV,
                                                         MSI.CONCATENATED_SEGMENTS
                                                  AND NVL
                                                        (:P_TO_INV,
                                                         MSI.CONCATENATED_SEGMENTS
           ORDER BY MSI.CONCATENATED_SEGMENTS, MTP.ORGANIZATION_CODE]]>
    </sqlStatement>
    <sqlStatement name="Q_2">
    <![CDATA[SELECT NVL (SUM (TRANSACTION_QUANTITY), 0) COMPLETION
           FROM MTL_MATERIAL_TRANSACTIONS
         WHERE INVENTORY_ITEM_ID = :INVENTORY_ITEM_ID
           AND ORGANIZATION_ID = :ORGANIZATION_ID
           AND TRANSACTION_TYPE_ID = 44
           AND TRUNC (TRANSACTION_DATE) = :TRX_DATE]]>
    </sqlStatement>
    <sqlStatement name="Q_3">
    <![CDATA[SELECT NVL (SUM (TRANSACTION_QUANTITY) * -1, 0) INCOMPLETION
          FROM MTL_MATERIAL_TRANSACTIONS
        WHERE INVENTORY_ITEM_ID = :INVENTORY_ITEM_ID
          AND ORGANIZATION_ID = :ORGANIZATION_ID
          AND TRANSACTION_TYPE_ID = 17
          AND TRUNC (TRANSACTION_DATE) = :TRX_DATE]]>
    </sqlStatement>
    <sqlStatement name="Q_4">
    <![CDATA[SELECT DESCRIPTION
          FROM FND_FLEX_VALUES_VL
        WHERE FLEX_VALUE_SET_ID = 1002470
              AND FLEX_VALUE = :P_LOB]]>
    </sqlStatement>
    <sqlStatement name="Q_5">
    <![CDATA[SELECT DESCRIPTION
         FROM FND_FLEX_VALUES_VL
        WHERE FLEX_VALUE_SET_ID = 1012471
          AND FLEX_VALUE = :P_DIV_FROM
          AND PARENT_FLEX_VALUE_LOW = :P_LOB]]>
    </sqlStatement>
    <sqlStatement name="Q_6">
    <![CDATA[SELECT DESCRIPTION
         FROM FND_FLEX_VALUES_VL
        WHERE FLEX_VALUE_SET_ID = 1012471
          AND FLEX_VALUE = :P_DIV_TO
          AND PARENT_FLEX_VALUE_LOW = :P_LOB]]>
    </sqlStatement>
    </dataQuery>
    <dataTrigger name="beforeReport" source="PRODUCTION.beforereporttrigger(:P_TRX_DATE_FROM,:P_TRX_DATE_TO)"/>
    <dataStructure>
    <group name="G_CONCATENATED_SEGMENTS" source="Q_1">
    <element name="CONCATENATED_SEGMENTS" datatype="charecter" value="CONCATENATED_SEGMENTS"/>
    <element name="DESCRIPTION" datatype="charecter" value="DESCRIPTION"/>
    <element name="TRANSACTION_UOM" datatype="charecter" value="TRANSACTION_UOM"/>
    <element name="INVENTORY_ITEM_ID" datatype="number" value="INVENTORY_ITEM_ID"/>
    <element name="ORGNIZATION_ID" datatype="number" value="ORGANIZATION_ID"/>
    <group name="G_TRX_DATE" source="Q_1">
    <element name="TRX_DATE" datatype="date" value="TRX_DATE"/>
    <group name="G_1" source="Q_1">
    <element name="ORGANIZATION_CODE" datatype="charecter" value="ORGANIZATION_CODE"/>
    <group name="G_ORGANIZATION_CODEC" source="Q_2">
    <element name="COMPLETION" datatype="number" value="COMPLETION"/>
    </group>
    <group name="G_ORGANIZATION_CODEI" source="Q_3">
    <element name="INCOMPLETION" datatype="number" value="INCOMPLETION"/>
    </group>
    </group>
    </group>
    </group>
    <group name="G_LOB" source="Q_4">
    <element name="CF_LOB" datatype="charecter" value="description"/>
    </group>
    <group name="G_FROM_DIV" source="Q_5">
    <element name="CF_DIVFROM" datatype="charecter" value="description"/>
    </group>
    <group name="G_TO_DIV" source="Q_6">
    <element name="CF_DIVTO" datatype="charecter" value="descrption"/>
    </group>
    <element name="CS_COUNT" function="count()" datatype="number" value="G_CONCATENATED_SEGMENTS.CONCATENATED_SEGMENTS"/>
    </dataStructure>
    </dataTemplate>
    Pls. suggest me.
    null

    Hi,
    without checked the whole document .... you've defined all paramaters as datataype charecter instead of character.
    Regards
    Rainer

  • How to insert 10 files from a directory to database,can i use dbms_lob??

    Hii
    I want to load 10files in my local drive into a table...how to do this.I'm able to do this individually using dbms_lob.loadfromfile and bfil but ,I want to copy all the files i that drive at time to my table...Is there any way to do this..?

    Okay... Here is some sample code that will help you store the files in binary format into db tables.
    create table t_blob(bid integer, blbdata blob);
    select * from t_blob;
    create or replace directory ext_tab_dir as 'C:\Oracle\ExtTab_Dir';
    grant read, write on directory ext_tab_dir to priya;
    declare
          src_file bfile;
          dest_file blob;
          len_file pls_integer;
    begin
          src_file:=bfilename('EXT_TAB_DIR','XML.doc');
          insert into t_blob values(1,empty_blob()) returning blbdata into dest_file;
          select blbdata into dest_file
            from t_blob
           where bid=1 for update;
          dbms_lob.fileopen(src_file,dbms_lob.file_readonly);
          len_file:=dbms_lob.getlength(src_file);
          dbms_output.put_line(len_file);
          dbms_lob.loadfromfile(dest_file,src_file,len_file);
          update t_blob
             set blbdata = dest_file
           where bid = 1;
          dbms_lob.fileclose(src_file);
    end;
    /I haven't used the wrap utility yet, so not much hands on with it. I guess the wrap utility at the OS level. Not sure if it will work at SQL prompt.

  • Using dbms_lob

    Hi,
    I have a need to open blob_content files from wwv_document$ and read/print them in a portlet. Can i do that using dbms_blob?. If so can somebody guide me the steps to follow? Else is there any other way sicne the files are really huge and i need to read from DB only.
    Thanks in advance
    null

    A lot of the answer to your question depends on what is in your BLOB and what you are trying to do with it. If you can post more details about your end goals.. and what is being stored in your documents (MS Word Docs, Random Binary Files, Images, Text files... etc) I can post specific details about what statements to use.
    In general you can use DBMS_LOB.READ to pull information directly out of a BLOB. See the Packages Reference documentation for details about the syntax. When you need to pass the BLOB locator, that is just what you get when you do a simple select on the BLOB_CONTENT column in the WWDOC_DOCUMENT$ table.

  • Using DBMS_LOB.LOADCLOBFROMFILE

    Dear all,
    I got some difficulty in trying to use DBMS_LOB.LOADCLOBFROMFILE. Suppose I have this procedure that load an OS file into a CLOB and read, however I keep getting error saying that
    ERROR at line 1:
    ORA-22275: invalid LOB locator specified
    ORA-06512: at "SYS.DBMS_LOB", line 890
    ORA-06512: at "HR.SOME_PROC", line 14
    ORA-06512: at line 1This is the procedure:
    create or replace procedure some_proc is
    note_clob clob;
    note_bfile bfile;
    note_var varchar2(10000);
    warning int;
    dest_off int:=1;
    src_off int:=1;
    lang_ctx int:=0;
    amount int:=dbms_lob.lobmaxsize;
    begin
    note_clob:=empty_clob();
    note_bfile:=bfilename('TEMP_DIR','note.txt');
    dbms_lob.fileopen(note_bfile);
    dbms_lob.loadclobfromfile(note_clob,note_bfile,1000,dest_off,src_off,0,lang_ctx,warning);
    --dbms_lob.read(note_clob,amount,1,note_var);
    dbms_lob.fileclose(note_bfile);
    --dbms_output.put_line(note_var);
    end some_proc;
    /I comment out the part that reads and prints for debugging purpose. Could anybody point me out where did I do wrong on LOADCLOBFROMFILE?
    best regards,
    Val

    Specify below line before loading into target...
    DBMS_LOB.CREATETEMPORARY(note_clob,true);

  • Using DBMS_LOB.COPY - (ORA-22275)

    Hi All,
    I need to copy BLOB value from one table to another.
    For that i am using DBMS_LOB.COPY.
    I am not sure if this is the right approach. If not, can someone help me out.
    Mentioned below is my sample procedure:
    CREATE OR REPLACE PROCEDURE INS_UPD_BLOB
    i_ID number,
    o_OutputStatus OUT NUMBER,
    o_OutputMessage OUT VARCHAR2
    as
    v_blob_data_d blob;
    v_blob_data_s blob;
    amt INTEGER := 4000;
    begin
    select BLOB_DATA
    into v_blob_data_d
    from blob_test_dest -- My Destination Table
    where id = i_ID
    for update;
    select BLOB_DATA
    into v_blob_data_s
    from blob_test -- My Source Table
    where id = i_ID;
    DBMS_LOB.COPY(v_blob_data_d, v_blob_data_s, amt);
    o_OutputStatus := 0;
    o_OutputMessage := 'SUCCESS';
    EXCEPTION
    WHEN OTHERS THEN
    o_OutputStatus := -1;
    o_OutputMessage := 'Procedure ins_upd_blob Failed at step no:- '||v_ErrorFlag|| ' SQL ERROR:- '||SUBSTR(SQLERRM,1,100);
    END;
    After execution i am getting following error:
    ORA-06502: PL/SQL: numeric or value error: invalid LOB locator specified: ORA-22275
    Thanks,
    Srikanth

    how about using merge instead of dbms_lob package?
    CREATE OR REPLACE PROCEDURE INS_UPD_BLOB
    i_ID number,
    o_OutputStatus OUT NUMBER,
    o_OutputMessage OUT VARCHAR2)
    as
    v_blob_data_d blob;
    v_blob_data_s blob;
    amt INTEGER := 4000;
    begin
    merge into blob_test_dest b1
    using (select id, blob_data from blob_test) b2
    on (b1.id = i_id and b1.id = b2.id)
    when not matched then insert(b1.id, b1.blob_data) values(b2.id,b2.blob_data)
    when matched then update set b1.blob_data = b2.blob_data;
    END;
    /

  • Using dbms_lob append to insert text how do you insert a new line inbetween

    DBMS_LOB.APPEND (P_TEXT,'* Operator Phone,');
    ---- inbetween I need to insert new I am using DBMS_LOB.APPEND (P_TEXT,CHR(10)); IS there amy better method?
    DBMS_LOB.APPEND (P_TEXT,'* Operator Email Address,');

    Sorry if the question was not clear ---
    Lets say in the folowing example every write append needs to start on a new line followed by text. How do we do that?
    Do we add another writeappend(cvar,22, chr(10)); inbetween?
    dbms_lob.writeappend(cvar, 19, '<root><book><title>');
    dbms_lob.writeappend(cvar, length(r.title), r.title);
    dbms_lob.writeappend(cvar, 14, '</title><desc>');
    dbms_lob.writeappend(cvar, length(r.description), r.description);
    dbms_lob.writeappend(cvar, 27, '</desc></book><author_name>');
    dbms_lob.writeappend(cvar, length(r.author_name), r.author_name);
    dbms_lob.writeappend(cvar, 21, '</author_name></root>');
    Edited by: user521218 on May 7, 2009 12:34 PM

  • Use dbms_lob.loadfromfile to handle chinese character

    Hello,
    I have a database with NLS_LANG=TRADITIONAL CHINESE_HONG KONG.ZHT16BIG5
    There is a table with clob type column.
    I've tried to use dbms_lob.loadfromfile to load file content into the clob type column.
    But the result is that no matter the file is english or chinese character, the column's content will become "monster".
    Is there any method to solve this problem ?
    Can anyone help ?
    Rgds,
    Edward
    null

    Hi, it's me again.
    I just want to share my experience and hope that it can help someone and someone can help me !
    I've created a database with UTF8 as my character set.
    With session's character set = UTF8, when I tried to use dbms_lob.loadfromfile to load data into clob column from a file with chinese character content. What has been stored is "monster" character. I know that it's because bfile is with binary type and will not do character set conversion when loadfromfile is being used.
    I've tried the other way, I use dbms_lob.read to read the file and use utl_raw to convert it to UTF8 character set and store it in a varchar2. It works !
    But what I want is to store the chinese character into the clob column.
    I've tried to use the following option but still fail :
    - convert (it's seems that has no effect)
    - utl_raw.translate (it always get oracle error, I've use this as : utl_raw.translate(RAW, 'UTF8', 'UTF8'))
    - utl_raw.convert
    Hope that some have experience can help me !
    Rgds,
    Edward
    null

  • How to use 2 Time trigger UI elements

    Hi Experts,
      My user doesn't want to see the time out error in the webdynpro application after leaving(idle mode) the browser for hours. And one more thing is he wants a popup for every 15mnts to show a message on the screen.
    So, I have used 2 Time Trigger UI elements to achieve this functionality,
          1st one(Time Trigger UI Element) is used to show the pop up message and It is working fine to show the message in a Pop Up .
          2nd one is used to handle the Time Out Error for hours and this is not working as expected, if user leaves the browser for hours .
    I hope you understand my requirement and issue.
    Could you please suggest me how to achieve this functionality.
    1000 Thanks in advance.
    Regards,
    Giri

    Hi,
    If I set the 3 hours to 2nd Time Trigger UI element and tested after 2 hours and browser is still throwing the time out error message.
    After 2hrs is the time out error throwing by the Timed trigger or the standard session time out? I believe after 2 hrs the standard session time out is throwing! You need to give the delay time less than your session time out.
    You can get the session timeout using wdr_task=>server->session_timeout ( in mins ) And you can get the application server time out using
    data: name type pfeparname,
            value type pfepvalue.
      name = 'rdisp/plugin_auto_logout'.   " parameter
      call 'C_SAPGPARAM' id 'NAME'  field name
                                        id 'VALUE' field value.   " value contains time out 
    Regards,
    Kiran

  • Is it possible to start a PCI4472 and a PCI-MIO-16E-1 simultaneously using an analog trigger (with pre-trigger)?

    I would like to start several PCI 4472 and a PCI-MIO-16E-1 simultaneously. All boards are connected via a RTSI cable.
    My program works fine if I use software trigger, or an analog trigger from a PCI4472 channel. However, the analog trigger works only when I set pre-trigger (or pre-scan) to 0.
    Is it possible to start a PCI4472 and a PCI-MIO-16E-1 simultaneously using an analog trigger (with pre-trigger)?
    Thanks.
    Ian Ren

    Hi, Bill
    I think it is possible to set more than 38 pre-trigger scans on a single 4472 card. I've done this before. You can verify this by running the Labview example "Acquire N - Multi-Analog Hardware Trig.vi" which comes with LabView.
    What I try to do but without success/luck so far is to start data acquisitions of several 4472 cards and a PCI-MIO-16E-1 card using an anlog trigger (with pre-trigger).
    Thanks for your help.
    Ian

Maybe you are looking for