Using the TRIM output as a parameter for IN

I have a CLOB containing column (for example):
,1074,1075,1076,1077,1078,1050,
The idea is to use values of this field in another query as a parameter for IN selection (basically something like this:)
 SELECT columns FROM table WHERE column IN (values from previous field);
If I run:
 SELECT columns FROM table WHERE column IN (1074,1075,1076,1077,1078,1050);
(values entered in the statement) everything is ok. But the problem is that this original area also contains comas at the beginning and at the end.

In order to deal with them, I tried:
TRIM(',' FROM column)
but I received:
ORA-00932: inconsistent datatypes: expected - got CLOB
00932. 00000 -  "inconsistent datatypes: expected %s got %s"
I also tried many TO_ functions as well as CAST funtion - does not work.

In addition, I tried
SELECT DBMS_LOB.SUBSTR(TS_FAULT_REPORTS,DBMS_LOB.GETLENGTH(column)-2,2)  FROM table;
but received error
ORA-01722: invalid number
01722. 00000 -  "invalid number"
No idea how to solve this problem?

Hello

Welcome to the forum!

So, you have a subquery which produces a string separated by commas, like ', 1074,1075,1076,1077,1078,1050,': is that correct?

The best solution might be to change the subquery so that produce a result set with each item on a separate line. Who can actually do the subquery simpler and more effective.

If you don't really have to use the comma-separated string, see the following links for dynamic IN-lists:
http://tkyte.blogspot.com/2006/06/varying-in-lists.html
http://www.Oracle-base.com/articles/Misc/DynamicInLists.php

You coul also convert your string table number and use INSTR to see if it exists in the list:

WHERE     INSTR ( comma_delimited_string
           , ',' || column_x || ','
           ) > 0

Extra commas are to avoid the problem of 'the mother's in chemotherapy If column_x is 1 (or 0, 107, or 7, or 74 or 4) you don't want that corresponding to '1074'.
This assumes that comma_delimited_list already begins and ends with the delimiter, as in your example. If this isn't the case, you can add them manually.

I hope that answers your question.
If not, post a small example of data (CREATE TABLE and only relevant columns, INSERT statements) for all tables and also post the results desired from these data.
Always tell what version of Oracle you are using.

You will find the answers better faster if you always provide this information whenever you post a question.

Tags: Database

Similar Questions

  • get the error when you use the TRIM method in the collections

    Hi Experts,

    When you use the TRIM method I get below error. I make any mistake here?

    DB: Oracle 11g

    SQL > declare

    2

    emp_tab of type 3 is the employee table % rowtype index directory.

    4 l_emp_tab emp_tab;
    5

    6 start

    7

    8 select * bulk collect into l_emp_tab of employees;

    9 l_emp_tab.trim (5);

    10 dbms_output.put_line (l_emp_tab.count);

    11

    12 end;

    13.

    l_emp_tab. Trim (5);

    *

    ERROR on line 9:

    ORA-06550: line 9, column 2:

    PLS-00306: wrong number or types of arguments in the call to 'TRIM '.

    ORA-06550: line 9, column 2:

    PL/SQL: Statement ignored

    Thanks in advance for your help.

    See you soon,.

    Suri

    For PL/SQL collections "index by" you cannot use the TRIM function. If your collection statement excludes the portion "index of...» ", then you can.

    Gerard

  • Is it possible to connect my Mac mini to my Mac Pro laptop using the memory on my mac mini for installing software Ableton as I don't have 3 GB available on my Mac Pro.

    Is it possible to connect my Mac mini to my Mac Pro laptop using the memory on my mac mini for installing software Ableton as I don't have 3 GB available on my Mac Pro.

    I want to download Ableton software, but it requires 3 GB of free memory that I have available on my MacPro laptop not because most of it is used for my library of music because I'm a DJ.

    I'm not sure how I can do it or not at all.

    Thank you very much.

    1. a Mac Pro is not a laptop. Its a big desktop computer.  You probably have a MacBook Pro, which is a laptop.

    2. No, you cannot share the memory (live RAM) or storage (disk space, which is not memory) like that between computers.

    However, it is very very bad practice to have so little storage space available for your computer.   If you have less than 3 GB, you should seriously consider an external drive. and unload some files on the outside. Its best not to leave your hard drive to go below 10 GB of free space because it can seriously affect your computer's performance.

  • I have a proof of purchase of my Adobe CC license, but according to the site and the app I'm in a free trial. I just got a new Mac and everything transferred and has been using the application on an old PC for a while so I'm not sure is this is what is ca

    I have a proof of purchase of my Adobe CC license, but according to the site and the app I'm in a free trial. I just got a new Mac and all transferred to an older Mac and has been using the application on an old PC for a while so I'm not sure is what is causing my problem. I have bank statements indicating payments of my subscription to Adobe for this product update.

    Hi Seth,

    First of all, disconnect, then back into creative cloud, using adobe id to pay for your subscription.

    https://helpx.Adobe.com/creative-cloud/help/sign-in-out-activate-apps.html

    Then, if you launch any product of CC 2015 and the pop up still shows a trial message window, please check this link for the resolution:

    https://helpx.Adobe.com/manage-account-membership/CC-reverts-to-trial.html

    Hope this helps!

  • How to remove the trial version of Acrobat DC 30 days that I have somehow on my MacBook Pro?  I don't want the dang thing, and it prevents me from using my Acrobat Pro 11 software.  Trying to access using the tree without end of support for Adobe is reall

    How to remove the trial version of Acrobat DC 30 days that I have somehow on my MacBook Pro?  I don't want the dang thing, and it prevents me from using my Acrobat Pro 11 software.  Trying to access using the tree without end of support for Adobe of really making me cranky.

    Hi thomh65004143,

    You simply drag the Acrobat DC application from the applications folder to the trash to uninstall.

    Then restart your system & install Acrobat XI Download Adobe Acrobat products. Standard, Pro | DC, XI, X.

    Let me know if you are still having a problem.

    Kind regards

    Nicos

  • Is it save to use the digital output as a digital input for another channel signal

    Hi all

    I know it's a stupid question, but I don't have another generator of signals by hand. What I want to know is, can I use the signal digital output of my USB-6001 as an input for the same signal device, but on other digital port? I wasn't directly because I don't want to burn the device...

    Thank you

    Done all the time. No problems.

  • Using the procedure output parameter in the success message

    I have a page process that calls a procedure of database with 2 output parameters.

    The source of my page process looks like this:
    DECLARE
       --variables to hold output parameters
       matched_count NUMBER;
       unmatched_count NUMBER;
    BEGIN
       USP_MATCH_PROCESS (matched_count, unmatched_count);
    END;
    I would like to be able to display the value of the 2 output settings in the Message of success of the process for the process.

    Is there a simple way to do this or I have to create the hidden page items and complete these source code, then reference these? Or even better, can reference variables in the source directly from the success of the process Message?

    Hello

    You can use something like this: -.

    apex_application.g_print_success_message: = matched_count | » '|| unmatched_count;

    Concerning

    Paul

  • How to use the record type as a parameter IN PL/SQL procedure or package

    Hi people,

    I need help on the record as the OUT parameter type. I am able to get out a single line as a parameter, but not getting do not idea how to get a multi ranks as output parameter.

    I have the code that works very well for a single line. Please see CODE1.

    But when I try to get several lines, I'm failing to do. Please see the CODE2. I get the error of compilation as


    Error report:

    ORA-06550: line 11, column 35:

    PLS-00487: Invalid reference to the variable "P_NAME.

    ORA-06550: line 11, column 1:

    PL/SQL: Statement ignored

    06550 00000 - "line %s, column % s:\n%s".

    * Cause: Usually a PL/SQL compilation error.

    Any help or a sample execution of script would be really useful.

    Thanks in advance.

    YZ

    --------------------------CODE1------------------------------------------

    -------------------------Package Spec-------------------------------

    CREATE OR REPLACE

    PACKAGE xx_sample_pkg as

    --

    Xx_sample_table_rectype RECORD TYPE IS

    (p_name varchar2 (40))

    number of p_emp_id

    );

    PROCEDURE xx_sample_prc (xx_sample_rec1, OUT xx_sample_table_rectype);

    END xx_sample_pkg;

    ------------------------------Package Body------------------------

    create or replace

    PACKAGE xx_sample_pkg AS BODY

    --

    PROCEDURE xx_sample_prc (xx_sample_rec1 OUT xx_sample_table_rectype) IS

    BEGIN

    SELECT ename, empno

    IN xx_sample_rec1

    FROM scott.emp

    WHERE ename = 'SMITH ';.

    END xx_sample_prc;

    END xx_sample_pkg;

    -------------------------------------------Execute----------------------

    DECLARE

    l_rec_type xx_sample_pkg.xx_sample_table_rectype;

    BEGIN

    dbms_output.put_line ('xx_sample_prc appeal');

    xx_sample_pkg.xx_sample_prc (l_rec_type);

    dbms_output.put_line ('YZ' | l_rec_type.p_name |') '|| l_rec_type.p_emp_id);

    END;

    ---------------------------------------------------------------

    -------------------------CODE2-------------------------------------------

    -------------------------Package Spec-------------------------------

    CREATE OR REPLACE

    PACKAGE xx_sample_pkg as

    --

    Xx_sample_table_rectype RECORD TYPE IS

    (p_name varchar2 (40))

    number of p_emp_id

    );

    PROCEDURE xx_sample_prc (xx_sample_rec1, OUT xx_sample_table_rectype);

    END xx_sample_pkg;

    ------------------------------Package Body------------------------

    create or replace

    PACKAGE xx_sample_pkg AS BODY

    --

    PROCEDURE xx_sample_prc (xx_sample_rec1 OUT xx_sample_table_rectype) IS

    BEGIN

    SELECT ename, empno

    IN xx_sample_rec1

    FROM scott.emp;

    END xx_sample_prc;

    END xx_sample_pkg;

    -------------------------------------------Execute----------------------

    DECLARE

    l_rec_type xx_sample_pkg.xx_sample_table_rectype;

    BEGIN

    dbms_output.put_line ('xx_sample_prc appeal');

    xx_sample_pkg.xx_sample_prc (l_rec_type);

    for l_rec in 1.l_rec_type.p_name.count

    loop

    dbms_output.put_line ('YZ' | l_rec_type.p_name (l_rec) |) » '|| l_rec_type.p_emp_id (l_rec));

    end loop;

    end;

    ---------------------------------------------------------------

    bb8c573a-6ca3-4d7c-90ed-e55c2df67201 wrote:

    But now, my question would be why the record type could not be used? My understanding is missing some concept between use of type type array collection record vs. Please specify.

    Do not confuse the folder with the collection.

    SY.

  • cRIO - H bridge using the PWM output and input only encoder control

    Hello

    I am currently working on a project to control a 230V brushed servo motor using cRIO. The engine drives a linear step and the final project needs to create a control of position of the engine that the user is able to enter a speed, position and control steps to move to this position.

    I use a bridge using NOR-9401 and H to power the motor circuit and a PWM output to move the engine. I also have an encoder, quadrature, connected to a NOR-9403 read position and speed. I use the example program of encoder for the NI 9505 - in my application.

    There is no voltage or current on the drive circuit sensors so I wouldn't be able to have a closed loop current in this case. The scene release mechanism is such that the position is locked if the motor does not move and I do not need a torque control to keep the engine in place.

    To achieve this, I just wouldn't be able to use a single PID VI (probably the FPGA VI express for discrete PID)?

    I am not very well versed in the theory of control, and therefore no indication in the common sense would help me a lot.

    Thank you very much!

    Sexy,.

    in general, it is best to use a cascade control loop structure but in principle must also be able to use the output of the control loop of position as an input to the PWM generator. The main disadvantage of this configuration is the current limitation missing. Without current meaning is no longer the only way to protect your engine from drawing too much current to limit to the current maximum output of your diet, or to limit the maximum duty cycle of PWM. Without current information, the last method is quite inaccurate, but better than nothing.

    I agree with Mike, you should look in the examples of the 9505 module and use the controller position vi of these examples. This PID controller is optimized for motion control applications and it is implemented in the fixed point arithmetic, offering the best performance on and FPGA.

    Kind regards

    Jochen Klier

    National Instruments

  • How to manage no data found in pdf format using the rtf output

    Hello

    In my rtf model, I have two frames - frame1 and frame2,

    These frameworks are based on the G1 group. Group G1 features of elements empid, empname

    My requirement is

    1. to return frame1 when the query (i.e. group G1) has given, this frame1 would print out the pdf of the report xml editor - correct work

    in the xml output, I saw that < LIST_G1 / > generates as below

    < LIST_G1 >

    < G1 >

    < EMPID > 1234 < / EMPID >

    JOHN < EMPNAME > < / EMPNAME >

    < G1 >

    < G1 >

    < EMPID > 1235 < / EMPID >

    BRAND of < EMPNAME > < / EMPNAME >

    < G1 >

    < G1 >

    < EMPID > 1236 < / EMPID >

    TONY < EMPNAME > < / EMPNAME >

    < G1 >

    < / LIST_G1 >

    2 return frame2 whenever the request (i.e. the group G1) has no data this frame2 output print pdf of the xml editor saying no report given - would not exist currently working.

    output is

    < LIST_G1 >

    < / LIST_G1 >

    (see there is no entry for < G1 > < / G1 > at all.)


    Now because of that, my frame1/frame2 who checks the value <? choose:? > <? When: County (G1). = 0 ? > out of the reutrning in the first case (as expected)

    but don't return do not all outputs in the 2nd case (his does not work as expected by me)


    Any pointers or help appreciated.


    Thanks in advance

    It solved using the IF ELSE block in the two frames, I'm back frame1 for the scenario IF count (G1) > 0 and return frame2 for another scenario.

  • How to use the NVL function to a parameter with comma delimited values

    Gurus,

    It is confusing to me.  I am trying to use the NVL function, but the setting that I'm passing in my cursor contains multiple values with commas.  The NVL function is confused when analyzing the values.

    'Where' cursor clause...

    and nvl (sn.c_attribute1,'x@#$%') in nvl (p_desig,'x@#$%'( )

    translated parameter values...

    and nvl (sn.c_attribute1,'x@#$%') in nvl ('SPRT''GOOD' 'BAD' 'x@#$%') -NVL does not parse the value correctly

    Any idea on how to get NVL recognize 'x@#$%' , if p_desig is null?

    Thank you

    Scott

    HI, Scott.

    Whenever you have a problem, please post a small example data (CREATE TABLE and only relevant columns, INSERT statements) of all the tables involved, so that people who want to help you can recreate the problem and test their ideas.

    Also post the results you want from this data, as well as an explanation of how you get these results from these data, with specific examples.

    Always say what version of Oracle you are using (for example, 11.2.0.2.0).

    See the FAQ forum: https://forums.oracle.com/message/9362002#9362002

    My best guess, based on what you posted bone is present, that your problem is discussed in the following:

    http://tkyte.blogspot.com/2006/06/varying-in-lists.html

    http://www.Oracle-base.com/articles/Misc/DynamicInLists.php

  • Using the slider as a procedure parameter

    Hello

    I'm new in PL/SQL, but I need to build the procedure and trigger to check for a condition.
    I scoured the web, but I can't find something similar as my problem (maybe that I can not describe it well, or I'm doing something I shouldn't...)

    Well, I am designing a database that will manage the groups. A group can include another, so I need to check that there is no recursion.

    Let's say I have this table INC. where GID is my GroupID and INCLUDES the ID of the groups included in the first.
     GID   INCLUDES
    ---- ----------
      13         12
      13         14
      13         15
      16         11
      16         13
    I have also a subgroups procedure which lists all the groups included in that given:
    CREATE OR REPLACE PROCEDURE subgroups(cur OUT SYS_REFCURSOR, parent_id IN NUMBER)
    IS
    BEGIN
      OPEN cur FOR
        SELECT includes
        FROM inc
          START WITH gid= parent_id
          CONNECT BY PRIOR includes=gid ;
    END ;
    /
    This procedure will also be used in a PHP script, so I would keep independent.
    Now my problem is in this trigger:
    CREATE OR REPLACE TRIGGER t_inc_check_recurs
      BEFORE INSERT OR UPDATE ON inc
      FOR EACH ROW
    DECLARE
      cur SYS_REFCURSOR ;
      --i cur%ROWTYPE ;
      i inc%ROWTYPE;
    BEGIN
      subgroups(cur, :NEW.gid) ;
      LOOP
          FETCH cur INTO i ;
          EXIT WHEN cur%NOTFOUND;
          dbms_output.put_line('Test '||i.includes);
      END LOOP;
      CLOSE cur;
    END ;
    /
    In this case, it seems that I have trouble with the types used:
    SQL> insert into inc values(12,13) ;
    insert into inc values(12,13)
                *
    ERROR at line 1:
    ORA-06504: PL/SQL: Return types of Result Set variables or query do not match
    (1) is there anyone who could tell me how I should send the cursor as a parameter?
    It works fine:
    SQL> var cur refcursor ;
    SQL> exec subgroups(:cur, 13);
    SQL> print cur ;
    (2) do you know how can I declare 'i' in this genre: I heart % ROWTYPE?


    Thank you very much!

    >
    In this case, it seems that I have trouble with the types used:
    >
    No.-you have problems because you're trying to extract a value in a rowtype that requires TWO values

    Your procedure uses a cursor which is only expecting a SINGLE value

      OPEN cur FOR
        SELECT includes
        FROM inc
    

    But your trigger defines a rowtype for the entire line

      i inc%ROWTYPE;
    BEGIN
      subgroups(cur, :NEW.gid) ;
      LOOP
          FETCH cur INTO i ;
    

    And if you get this error
    >
    ORA-06504: PL/SQL: return variables of the game results or the query types do not match
    >
    Also - you can also declare and define a cursor in a package specification, and then use this cursor definition in the procedure and the trigger.

  • HOW to use the file/BLOB data temporary - email for multiple users... Please see code

    Dear gurus
    the code below works fine, he sends a good fixation to the first user, but to the 2nd user, it send blank (empty) file.
    What I want, I have read the data from the source and enter the temporary BLOB and use the same data to send several users in the loop.


    create or replace
    PROCEDURE dba_ho.emailattacheulhr is
    / * LOB related operation varriables * /.
    v_src_loc BFILE.
    l_buffer RAW (54);
    l_amount directory: = 54;
    l_pos INTEGER: = 1;
    l_blob BLOB: = EMPTY_BLOB;
    l_blob_len INTEGER.
    v_amount INTEGER.
    / * Related UTL_SMTP varriavles. */
    v_connection_handle UTL_SMTP. CONNECTION;
    v_from_email_address VARCHAR2 (200);
    v_to_email_address VARCHAR2 (200);
    v_cc VARCHAR2 (200);
    v_smtp_host VARCHAR2 (50);
    v_subject VARCHAR2 (500);
    l_message VARCHAR2 (30000);
    l_filename VARCHAR2 (4000);
    CustNo number (8);
    CNAME varchar2 (50);

    cst slider is
    Select a.EMAIL_ADDR, a.CARDHOLDER_NAME
    Cust a
    ORDER BY a.cust_no;

    / * This procedure of send_header is mentioned in the documentation * /.
    PROCEDURE send_header (pi_name IN VARCHAR2, pi_header IN VARCHAR2) AS
    BEGIN
    UTL_SMTP. WRITE_DATA (v_connection_handle,
    pi_name | ': ' || pi_header | UTL_TCP. CRLF);
    END;

    BEGIN
    v_src_loc: = BFILENAME ('DIR_MMAIL', 'MAKPROM.pdf');
    v_from_email_address: = '[email protected] ';
    v_cc: = '[email protected] ';
    v_smtp_host: = 'mailhost.mak.com ';
    v_subject: = 'list of Promotion of Mak;
    -l_blob BLOB: = EMPTY_BLOB;
    / * Prepare the LOB of attachment file. */
    DBMS_LOB. OPEN (v_src_loc, DBMS_LOB. LOB_READONLY); -Read the file
    DBMS_LOB. CREATETEMPORARY (l_blob, TRUE); -Create a temporary LOB to store the file.
    v_amount: = DBMS_LOB. GETLENGTH (v_src_loc); -Amount to be stored.
    DBMS_LOB. LOADFROMFILE (l_blob, v_src_loc, v_amount); -A temporary file in LOB loading
    l_blob_len: = DBMS_LOB.getlength (l_blob);


    Begin
    CSE opened;

    loop
    extract the CSE in custno, v_to_email_address, cname;
    When the output cst % notfound;

    l_message: = 'Dear customer ' | UTL_TCP. CRLF;
    l_message: = l_message | CNAME | UTL_TCP. CRLF;
    l_message: = l_message | UTL_TCP. CRLF;
    l_message: = l_message | "Thanks for choosing. Enclosed please find our current list of promotion for your review. '||
    UTL_TCP. CRLF;
    l_message: = l_message | UTL_TCP. CRLF;
    l_message: = l_message | "Sincere friendships. UTL_TCP. CRLF;
    l_message: = l_message | UTL_TCP. CRLF;
    l_message: = l_message | UTL_TCP. CRLF;
    l_message: = l_message | "To Mak' | UTL_TCP. CRLF;
    l_message: = l_message | ' www.mak.com' | UTL_TCP. CRLF;

    / * Associated with coding UTL_SMTP. */
    v_connection_handle: = UTL_SMTP. OPEN_CONNECTION (v_smtp_host, 25);
    UTL_SMTP. HELO (v_connection_handle, v_smtp_host);
    UTL_SMTP. MAIL (v_connection_handle, v_from_email_address);
    UTL_SMTP. RCPT (v_connection_handle, v_to_email_address);
    UTL_SMTP. RCPT (v_connection_handle, v_cc);

    UTL_SMTP. OPEN_DATA (v_connection_handle);
    send_header ("", v_from_email_address) ;--|| ("<>'");
    send_header ("TO", v_to_email_address) ;--|| ("<>'");
    send_header ('CC', v_cc);
    send_header ('Subject', v_subject);

    -MIME header.
    UTL_SMTP. WRITE_DATA (v_connection_handle,
    "MIME-Version: 1.0 ' |" UTL_TCP. CRLF);
    UTL_SMTP. WRITE_DATA (v_connection_handle,
    ' Content-Type: multipart/mixed; ' || UTL_TCP. CRLF);
    UTL_SMTP. WRITE_DATA (v_connection_handle,
    "boundary =" ' | "'" Sample.SECBOUND' | '"' ||
    UTL_TCP. CRLF);
    UTL_SMTP. WRITE_DATA (v_connection_handle, UTL_TCP. CRLF);

    -Body of the message
    UTL_SMTP. WRITE_DATA (v_connection_handle,
    '--' || "Sample.SECBOUND" | UTL_TCP. CRLF);
    UTL_SMTP. WRITE_DATA (v_connection_handle,
    ' Content-Type: text/plain; "|| UTL_TCP. CRLF);
    UTL_SMTP. WRITE_DATA (v_connection_handle,
    'charset = US-ASCII' | UTL_TCP. CRLF);
    UTL_SMTP. WRITE_DATA (v_connection_handle, UTL_TCP. CRLF);
    UTL_SMTP. WRITE_DATA (v_connection_handle, l_message |) UTL_TCP. CRLF);
    UTL_SMTP. WRITE_DATA (v_connection_handle, UTL_TCP. CRLF);

    -Attachment of e-mail
    UTL_SMTP. WRITE_DATA (v_connection_handle,
    '--' || "Sample.SECBOUND" | UTL_TCP. CRLF);
    UTL_SMTP. WRITE_DATA (v_connection_handle,
    ' Content-Type: application/octet-stream' |
    UTL_TCP. CRLF);
    UTL_SMTP. WRITE_DATA (v_connection_handle,
    ' Content-Disposition: attachment; ' || UTL_TCP. CRLF);
    UTL_SMTP. WRITE_DATA (v_connection_handle,
    "filename =" ' | "MakMail.pdf" | '"' || UTL_TCP. CRLF);
    UTL_SMTP. WRITE_DATA (v_connection_handle,
    ' Content-Transfer-Encoding: base64' | UTL_TCP. CRLF);
    UTL_SMTP. WRITE_DATA (v_connection_handle, UTL_TCP. CRLF);
    / * Write the BLOB into pieces * /.
    While l_pos < l_blob_len LOOP
    DBMS_LOB. READ (l_blob, l_amount, l_pos, l_buffer);
    UTL_SMTP.write_raw_data (v_connection_handle,
    UTL_ENCODE. Base64_encode (l_buffer));
    UTL_SMTP. WRITE_DATA (v_connection_handle, UTL_TCP. CRLF);
    l_buffer: = NULL;
    l_pos: = l_pos + l_amount;
    END LOOP;
    UTL_SMTP. WRITE_DATA (v_connection_handle, UTL_TCP. CRLF);

    -E-mail nearby
    UTL_SMTP. WRITE_DATA (v_connection_handle,
    '--' || "Sample.SECBOUND" | '--' || UTL_TCP. CRLF);
    UTL_SMTP. WRITE_DATA (v_connection_handle,
    UTL_TCP. CRLF. '.' || UTL_TCP. CRLF);
    UTL_SMTP. CLOSE_DATA (v_connection_handle);
    UTL_SMTP. Quit (v_connection_handle);
    -DBMS_LOB. FREETEMPORARY (l_blob);
    -DBMS_LOB. FileClose (v_src_loc);

    End loop;


    EXCEPTION
    WHILE OTHERS THEN
    UTL_SMTP. Quit (v_connection_handle);
    DBMS_LOB. FREETEMPORARY (l_blob);
    DBMS_LOB. FILECLOSE (V_SRC_LOC);
    dbms_output.put_line (SQLERRM); -try to print the error message.
    END;
    DBMS_LOB. FREETEMPORARY (l_blob);
    DBMS_LOB. FileClose (v_src_loc);
    End;

    -end of code

    Help, please.

    Concerning

    S.Garewal

    This is what happens when you copy a code without understanding.
    Take a look at the code here

    /* Writing the BLOB in chunks */
    WHILE l_pos < l_blob_len LOOP
    DBMS_LOB.READ(l_blob, l_amount, l_pos, l_buffer);
    UTL_SMTP.write_raw_data(v_connection_handle,
    UTL_ENCODE.BASE64_ENCODE(l_buffer));
    UTL_SMTP.WRITE_DATA(v_connection_handle, UTL_TCP.CRLF);
    l_buffer := NULL;
    l_pos := l_pos + l_amount;
    END LOOP;
    

    Discover the parameters of DBMS_LOB. READ.
    For the first time it's good reading but your position and the quantity is not initialized when you loop and read again and is not read correctly.

  • Use the ipad as a second monitor for Mac

    I remember using my iPad as a second monitor a couple of years, just as an exercise of "isn't this cool? Now, I really need, everyone remember this feature, or it was just a dream? Thank you in advance for your help! STF

    Given that the iPad is not a connector for a monitor, how is that going to work?

  • Data acquisition using the USB-GPIB 82357 B interface for 4395 impedance Analyzer has:

    Hi all

    I tried to communicate Analyzer 4395A impedance with interface USB GPIB 82357 B using the command of expert keysight and Labview module tutorial. I couldn't able to find orders of SCPI (Standard for programmable Instruments orders) for 4395 A impedance Analyzer in the expert keysight command. Please help me on the subject of what are the other possibilities to acquire data from the Analyzer of impedance 4395 A using the interface USB GPIB 82357 B.? Is it possible to get LABVIEW plug & play drivers for USB-GPIB 82357 B interface? Our main goal is to control the parameters of impedance measurement and draw F vs IZI and theta vs F as well as get parameters of equivalent circuit on a PC with LABVIEW GUI.

    Can't wait to help.

    Hello!

    I agree with 'heavy '. For more information on how to program a 3rd device contact the manufacturer because they have the knowledge. Unless there is already a LabVIEW driver for this device, you would have to implement that yourself and need information from the manufacturer.

    Regarding your question if the GPIB-USB is unsuitable, it is quite easy to answer: If you want to communicate with a peripheral GPIB NI GPIB-USB can do this. But you would probably need a driver to use the GPIB of meaningful communication bus.

    Best regards

    Christoph

Maybe you are looking for