derivation of column using the logic of date

Hello

I have the tables below where I need the output as below

main_table

MI_ACC_IDENTIFIERENT_PST_DTE
1112 SEP-14 00.00.00
1112 OCTOBER 14 00.00.00

Table_reference

MI_ACC_IDENTIFIERCHARGE_START_DATECHARGE_END_DATE
111ST AUGUST 14 00.00.0031 AUGUST 14 00.00.00
1101 OCT-14 00.00.0030 SEP-14 00.00.00
111ST OCTOBER 14 00.00.0031 OCTOBER 14 00.00.00

bucket

INPUT_REFPROD_BUCKET_IDMI_ACC_IDENTIFIERACT_START_DATEACT_END_DATE
9991478119 JULY 07 00.00.00JUNE 4 08 00.00.00
99914771101 OCT-14 00.00.0031 OCTOBER 14 00.00.00

output

MI_ACC_IDENTIFIERENT_PST_DTECHARGE_START_DATECHARGE_END_DATE
1112 SEP-14 00.00.001ST AUGUST 14 00.00.0031 AUGUST 14 00.00.00
1112 OCTOBER 14 00.00.0001 OCT-14 00.00.0030 SEP-14 00.00.00

Requirement

01. I need to check the ent_pst_dte of main_table between dates of table_reference and take into account the previous dates

02 ent_pst_dte of the table main must firstly between dates of bucket table into that he will fall in 1477 (prod_bucket_id), then only it should check if between dates of table_reference

There may be multiple records in the bucket with id unique input_ref whenever the dates change the prod_bucket_id changes so I refer are based on columns input_ref and mi_acc_indentifier

Queries:

CREATE TABLE 'MAIN_TABLE '.

("MI_ACC_IDENTIFIER" NUMBER (10,0) NOT NULL ACTIVATE,)

DATE OF THE 'ENT_PST_DTE '.

);

Insert into main_table (MI_ACC_IDENTIFIER, ENT_PST_DTE) values (11, to_date (12-SEP14 00.00.00','DD-MON-RR HH24.MI.)) SS'));

Insert into main_table (MI_ACC_IDENTIFIER, ENT_PST_DTE) values (11, to_date (October 12, 14 00.00.00','DD-MON-RR HH24.MI.)) SS'));

CREATE TABLE 'TABLE_REFERENCE.

("MI_ACC_IDENTIFIER" NUMBER (10,0) NOT NULL ACTIVATE,)

DATE OF THE "CHARGE_START_DATE."

DATE OF THE 'CHARGE_END_DATE '.

);

Insert into table_reference (MI_ACC_IDENTIFIER, CHARGE_START_DATE, CHARGE_END_DATE) values (11, to_date (1 August 14 00.00.00','DD-MON-RR HH24.MI.)) SS'), to_date (August 31, 14 00.00.00','DD-MON-RR HH24.MI.) SS'));

Insert into table_reference (MI_ACC_IDENTIFIER, CHARGE_START_DATE, CHARGE_END_DATE) values (11, to_date ('01 - SEP - 14 00.00.00','DD-MON-RR HH24.MI.)) SS'), to_date (30-OCT-14 00.00.00','DD-MON-RR HH24.MI.) SS'));

Insert into table_reference (MI_ACC_IDENTIFIER, CHARGE_START_DATE, CHARGE_END_DATE) values (11, to_date (1 October 14 00.00.00','DD-MON-RR HH24.MI.)) SS'), to_date (31 October 14 00.00.00','DD-MON-RR HH24.MI.) SS'));

CREATE TABLE 'BUCKET '.

(VARCHAR2 (10 BYTE) "INPUT_REF",

VARCHAR2 (10 BYTE) "PROD_BUCKET_ID."

NUMBER (10,0) "MI_ACC_IDENTIFIER."

DATE OF THE "ACT_START_DATE."

DATE OF THE 'ACT_END_DATE '.

);

Insert in bucket (INPUT_REF, PROD_BUCKET_ID, MI_ACC_IDENTIFIER, ACT_START_DATE, ACT_END_DATE) values ('999 ', ' 1478', 11, to_date (9 July 07 00.00.00','DD-MON-RR HH24.MI.)) To_date SS'), (4 June 08 00.00.00','DD-MON-RR HH24.MI.) SS'));

Insert in bucket (INPUT_REF, PROD_BUCKET_ID, MI_ACC_IDENTIFIER, ACT_START_DATE, ACT_END_DATE) values ('999 ', ' 1477', 11, to_date ('01 - SEP - 14 00.00.00','DD-MON-RR HH24.MI.)) SS'), to_date (31 October 14 00.00.00','DD-MON-RR HH24.MI.) SS'));

Your condition isn't all Claire - you want to find the lines of main_table where the date in a date range of bucket; then find the corresponding line of table_reference, but note the dates of beginning and end of the period last ? Something like that, maybe?

WITH ref_plus AS)

SELECT r.ml_acc_identifier,

r.charge_start_date,

r.charge_end_date,

LAG (r.charge_start_date) OVER (partition by order of r.charge_start_date r.ml_acc_identifier) prev_start_date,.

LAG (r.charge_end_date) OVER (partition by order of r.charge_end_date r.ml_acc_identifier) prev_end_date

From table_reference r)

SELECT m.ml_acc_identifier,

m.ent_pst_dte,

r.prev_start_date charge_start_date,

r.prev_end_date charge_end_date

OF main_table m

INNER JOIN bucket b

ON b.ml_acc_identifier = m.ml_acc_identifier

AND m.ent_pst_dte BETWEEN b.act_start_date AND b.act_end_date

INNER JOIN ref_plus r

ON r.ml_acc_identifier = m.ml_acc_identifier

AND m.ent_pst_dte BETWEEN r.charge_start_date AND r.charge_end_date

Tags: Database

Similar Questions

  • How to get a column using the logical AND operator on two columns?

    All columns are the VARCHAR2 data type.

    I got out of the table in this way:
    col1 col2
    True True
    True false
    False false
    but I want an extra column in this way:
    col1 col2 result
    True True True
    True false false
    Fake fake fake
    as the clear sound output shows this column resut is logical operator AND
    col1 and col2. How to get there?
    WITH t AS
         (SELECT 'True' col1, 'True' col2 FROM DUAL
          UNION ALL
          SELECT 'True' col1, 'False' col2 FROM DUAL
          UNION ALL
          SELECT 'False' col1, 'True' col2 FROM DUAL
          UNION ALL
          SELECT 'False' col1, 'False' col2FROM DUAL)
    SELECT col1,col2,CASE
              WHEN col1 = 'True' AND col2 = 'True'
                 THEN 'True'
              WHEN col1 = 'True' AND col2 = 'False'
                 THEN 'False'
                 WHEN col1 = 'False' AND col2 = 'True'
                 THEN 'False'
              WHEN col1 = 'False' AND col2 = 'False'
                 THEN 'False'
           END AS RESULT
      FROM t
    
  • Use the project start Date and duration to calculate the end Date of project

    I'm trying to calculate the end date of the project in a report using the project end Date and time entered on the opportunity.
    For example, if the start date of the project filled an opportunity is 31/01/2009 and the length (integer) is entered on the opportunity is 5, the project end date is in the report must be 30/06/2009.

    I'm trying to TIMESTAMPADD forumaul allows you to add the duration (number of months) to the project start date
    This Fx works TIMESTAMPADD (SQL_TSI_MONTH, 12, '-used Custom Attributes ".) DATE_40)
    But if I try to replace the number twelve by the length (integer field) I get an error when you try to save: TIMESTAMPADD (SQL_TSI_MONTH, "-opportunity Custom Metrics".) S_INT_0, '-used custom attributes. DATE_40)

    Any ideas on how I can get this to work would be greatly appreciated.

    Hi, try this. It might solve your prioblem TIMESTAMPADD (SQL_TSI_MONTH, CAST (YOUR FIELD AS INTEGER), account. (' "Last modified")

    -John CRMIT

  • using a column having the nvl char data type...

    The entity table has 4 records with 'X' account status and 42 records with account_status with null.

    Select * entity where nvl (account_status, 'X') = 'X '.

    When I run the query above, must be extracted all 46 records but only 42 records with only statement null is read.

    Also when I run the query below

    Select * entity where nvl(account_status,'T') = 'X '. No line is fethced.

    The account_status column is char data type.

    When I use the same type of query with a number data type column it works correctly.

    NVL work differently for the char data will type column? Could someone help me on this? I don't know if I am wrong anywhere.

    vesrion of Oracle that I use here is Oracle 10 g.

    Hello

    SELECT * ENTITY WHERE NVL (UPPER (TRIM (ACCOUNT_STATUS)), 'X') = 'X '.

    Check the empty space in the field you are trying to cut.

    Thank you

  • Average of column with the format of date/time in the response of BI

    Hello world

    We working on the response of BI and training to get the average of the hours of work of departments. Work hours column is the Date in the database format, so we tried to converted to CHAR through the Cast function to modify columns in BI answers formula, and this gave us date "2007/09/01' as a result! We have also tried to throw the working hours for:

    CAST (CHARACTER of WORK HOURS FORMAT AS 'yyyyMMdd-HHmmss')

    NOTE: In working hours, we have null values...

    work real hours to appear in the picture of the response is "01/07/2009-06:13.


    How to get the column of working hours average on response BI?

    Appreciate your help
    Concerning

    Published by: user817525 on July 21, 2009 23:15

    No, u do not attend the general tab. you need to go to the Data Type and click the button change. you will see a list of logical column. In your case, you will need to find the logical column when u used to store your WorkingHour and click on the button with three love (close your logical column). Now you have expression builder where you put formula: EXTRACTS ("Ain_Access" TIME. "" "" Fact_Access '. "" Hours of work)

    I hope this helps?

    all best
    Phoenix
    Belgrade

  • selection of the first column of the clicked row data

    All,

    Ive a report with a custom template and I want to return / select the first value in the column of the clicked folder, how can I get this data by using javascript code in DA or jquery?

    I did some research but couldn't do something similar.

    Classic report

    Apex 4.2

    Scott,

    I used the expression below, but it works only when the column ID/first appears, but if you set a column to not show IE uncheck the show of the column attribute, then it cannot read this value.

    $(this.triggeringElement) .find ('td:first').text())

    is there a way to always get that ID/first column when figure is not on the report?

    concerning

  • Whine of high ground by speakers when using the logic or Garage Band

    Yesterday, I downloaded and installed Logic Pro. During the last part of the installation process my speakers started to whine. It is not very strong, but quite noticeable and irritating. I use these speakers (Alesis M1 Active 520) for years and have never had this problem.

    When I restart, before launching logic, the speakers are silent - which means that there is no groan even when the speakers are turned at full volume. Logic Pro is launched as soon as the whining begins.

    When I go in the preferences in the logic and change the parameters of the device, for example I pass the entrance 'none', the whine disappear momentarily while the changes are applied, then it returns a few seconds later. The only way I can get the groan to stop is to choose one output other than "USB Audio Codec" - which then of course I hear nothing of logic, except through the Mac Mini, built in speaker, other sounds play through speakers normally without any annoying groan.

    Logic Pro to quit smoking will also stop the whine.

    Reminder, my speakers will only commit the groan Logic Pro is running. The moan is noticeable when the speaker (speaker button) is set to a level higher than 30%. I normally set it to about 50-60%.

    I just opened Garage Band and it has the same problem. Final Cut Pro X (and any other programs that I use) but do not.

    Looks like you have found your comments from your Audio input... maybe the built in Mic?

    That switch off in the preferences Audio Logic... by choosing a different input audio and see if that fixes it.

  • What is the speed of data transmission when using the dashboard of data?

    Hello, everyone, I've seen it doesn't matter if an iphone or a Chinese tablet is used, the speed of transmission of data with the shared Variables and dashboard of data is almost the same and is at reduced speed. Does anyone know how I could measure this baud rate? Thank you in advance.

    Hello there;

    The rate of updating the dashboard data for 1.0 is set to 1 second of webservices and 0.2 second for variable network shared, of course depends on the amount of information on the network continuously. On the second version of the dashboard of data, you can specify your update frequency within a range

    You can find this info in this KB

    Hope this info helps.

    See you soon

  • Can I automate creating a cluster in LabView using the structure of data created in a generated automatically. CSV, C header or XML file?

    Can I automate creating a cluster in LabView using the data structure created in an auto generated. CSV, C header or XML file?  I am trying to take the data structure defined in one or more of these files listed and have LabView automatically create a cluster with structure types and the same data.  (Ideally, I would like to do it with a C header file only.)  Basically, I'm trying to avoid having to create the cluster by hand, as the number of cluster elements could be very large. I looked in EasyXML and contacted the rep for the add-on.  Unfortunately, this feature was not created yet.  Did anyone done something like this before? Thanks in advance for the help.


  • Transformation of table names and a column in the logic model (CCM)

    In addition to my previous question on the transformations of the relational model logical I would like to set for the names of tables like school_units to become SchoolUnit when you do: engineer to the logic model. Ditto for the columns for attributes, i. e. I would like to convert a column of class_sign to classSign.
    With the help of Philip Stoyanov, I could set the mixed case to emphasize the shape of logic to the relational model. But now I can't engineer to the logic model without losing all the work accomplished in the logic model (concerning the designation of entities and attributes).

    Best regards, Robert

    Hi Robert,.

    You can try to define "Incomplete modifiers" in your glossary so the name validation will not fail (against the glossary) because it is existing only don't not in the glossary of terms.

    If the name is not recognised as valid then separator is changed, but setting camel case is not considered - I logged a bug about this.

    Philippe

  • How to upgrade a table column using the values in the Oracle collection

    create or replace procedure test_coll
    
    IS
    
    CURSOR upd 
    IS
    SELECT CONTACT_NAME FROM Supplier_16;
    
    TYPE dept IS TABLE OF upd%rowtype;
    cur_var dept;
    
    Type List Is table Of  varchar2(20);
    Name List:=  List('Shilpi','Sunil','Shreyas','Saral');
    
    BEGIN
    
    OPEN upd;
    LOOP
         FETCH upd BULK COLLECT INTO cur_var;
    --    EXIT WHEN upd%NOTFOUND;
    
         FORALL i IN cur_var.FIRST..cur_var.LAST
      
         UPDATE supplier_16
    **  SET Contact_name= name(i);  ***
         
         COMMIT;
    
    END LOOP;
    CLOSE upd;
    
    END;
    On the "BOLD" line, I don't know how I should move the values of the collection of name I said without which are set all the values in the table supplier_16 = 'Saral.

    Help, please.

    Aashish S. wrote:
    Thank you very much...

    Yes, I slide collections and was trying to reach somwthing on similar lines to which you provided the code example...

    My essay is equipped to take a collection: initialized with values of say 3-4...

    Take other tables... A column... and update the column in the table (not PK, FK anything) using the values of the initialized collection...

    However, I am stuck between the two on how the UPDATE clause should be...

    OK, if it's just because you want to practice with collections, you might do something like this...

    SQL> set serverout on
    SQL> create table supplier_16 as
      2  select 'Frederick' as contact_name from dual union all
      3  select 'Robert' from dual union all
      4  select 'Jeremy' from dual union all
      5  select 'Simon' from dual
      6  /
    
    Table created.
    
    SQL> create or replace procedure test_coll is
      2    CURSOR upd IS
      3      SELECT CONTACT_NAME
      4      FROM Supplier_16
      5      FOR UPDATE;
      6    Type List Is table Of  varchar2(20);
      7    Name List := List('Shilpi','Sunil','Shreyas','Saral');
      8    v_contact_name varchar2(30);
      9    v_idx          number := 1;
     10  BEGIN
     11    OPEN upd;
     12    LOOP
     13       FETCH upd INTO v_contact_name;
     14       EXIT WHEN upd%NOTFOUND;
     15       UPDATE supplier_16
     16       SET    contact_name = name(v_idx)
     17       WHERE CURRENT OF upd;
     18       DBMS_OUTPUT.PUT_LINE(v_contact_name||' update to '||name(v_idx));
     19       v_idx := v_idx + 1;
     20    END LOOP;
     21    CLOSE upd;
     22    COMMIT;
     23  END;
     24  /
    
    Procedure created.
    
    SQL> exec test_coll;
    Frederick update to Shilpi
    Robert update to Sunil
    Jeremy update to Shreyas
    Simon update to Saral
    
    PL/SQL procedure successfully completed.
    
    SQL> select * from supplier_16;
    
    CONTACT_N
    ---------
    Shilpi
    Sunil
    Shreyas
    Saral
    

    Of course, there is treatment rank by rank and is not best for performance, but it allows you to access your collection that you created names.

  • How to use the aggregate with Date function

    Hi all

    I have a Group date is it possible of Max and Min to date.

    I tried like this but its out errored <? MIN (current - group () / CREATION_DATE)? >.

    I also tried this, but it does not work
    <? xdoxslt:minimum (CREATION_DATE)? >

    Is it possible to use the function of aggregation with date values.

    Thanks and greetings
    Srikkanth

    You can use
    Ensure that the "date" is in canonical format

  • 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.

  • Flex 3: how to use the trace print data in the console

    Hello

    I heard that we can use trace to print data on the console in Flex Builder 3. But when I try, it's of no luck.

    Below is a simple program, in which I was out of luck.


    public function callMe (): void
    {
    trace ("AAA");

    }

    < mx:Button id = 'Save' name = 'Save' label = "Save" height = "23" click = "callMe ()" / >

    Here in the porogram above, after you have clicked on the button, I can't see 'AAA' related inside my Flex Builder.

    Any help?

    Thank you.

    Hi Kiran

    Made a breakpoint to the line of trace and debug the application you can find the message u typed in the console... trace works only in debug mode... not in development mode...

    Good day

    Thank you

    RAM

  • change the column using the trigger

    Hello
    is there any possibility or a way around to change a LONG column in a trigger BEFORE INSERT and BEFORE UPDATE?
    the scenario is like this.
    Old DOS applications (this is why we must use LONG in the Oracle), they inserting a record in Oracle (9.2.0.8 - HP UX).

    They are inserting ASCII characters that must be converted properly by Oracle using REPLACE.
    But the problem is that I can not handle a long TIME in relaxation.

    We have set the Oracle Client and Server NLS_LANG by using the same character set ISO-8859-1.
    but in some sort the ASCII character has managed to go to the Oracle, and it had not stored in the database.

    Use change will take more time than making a cleaning trash in the database.

    Is there a way around that you think.

    OK, you have your problem:

    Check this box:

    SQL> create table t
    (
       user_id        number,
       user_account   varchar2 (10),
       user_status    varchar2 (1),
       user_message   long
    )
    /
    Table created.
    
    SQL> create or replace trigger t_trg
       after insert
       on t
       for each row
    declare
       l_new_long   long;
    begin
       execute immediate '
           declare
             l long;
           begin
             select user_message into l from t@loopback where user_id = :1;
             update  t@loopback set user_message = replace(l, ''Some'', ''Some other'') where user_id = :1;
           end;
              ' using :new.user_id;
    end t_trg;
    /
    Trigger created.
    
    SQL> insert into t  values (1,  'michael', 'Y',  'Some Message')
    /
    1 row created.
    
    SQL> select * from t
    /
       USER_ID USER_ACCOUNT USER_STATUS USER_MESSAGE
    ---------- ------------ ----------- --------------------
             1 michael      Y           Some other Message
    1 row selected.
    

Maybe you are looking for

  • 38 TB freezing while typing a message

    Win10x64 TB crashes when you type a message. This happens several times before I completed it and from 30 seconds to a few minutes at a time, completely random. I tried safe mode and the different settings and nothing seems to have no effect. The nex

  • Beats not selectable 1 and Quick Play on Apple Watch

    Hello I have Apple Watch sport with watch Os 2.1. I want to play my watch 1 bat instead of having to press listen on my phone all the time to activate it.  In my view, there is an option in the menu music on the watch, but it is not selectable.  Quic

  • Pavilion TouchSmart 23-f364: Hp Pavilion 23-f364 BIOS "finds it difficult to" hard drive Detection

    I have a HP Pavilion TouchSmart f364 23 for Christmas in 2013 and in 2014, the hard drive has begun to act. I would like to turn on the computer and it does not detect the drive or does not see the files it contains. The CD drive is detected and work

  • cannot change the xp administrator password...

    someone had blocked my access to the internet... I tried to change the admin by regedit, ctrl + alt + delete, start mode without failure, mmc, cmd, but which is not supposed... It always seems system error... I don't know what else to do... Please he

  • WRT610N ver.2 fast or Gbit Ethernet?

    Just installed.  Network very easy.  Desktop Dell Precision to the router to the modem cable to ISP. Local network connection XP says it's 1 Gbps.  E'net card is Intel (r) PRO/1000 MTW Network Connection. No other computer on LAN (yet). Destop to Rou