Long datatype

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • orajit
    New Member
    • Nov 2007
    • 75

    Long datatype

    Hi ,

    Can anybody send me sample code for selecting data from column which has long datatype

    Example

    I have table test123, which has 2 colunn id number and data long

    the data column which has long datatype contains
    DOCSTART_1 |
    DOCTYPE|
    VERSION 5.4|
    BILLST 1|
    BILLTY 1|
    BILLTEM 1|
    BILLSEQ 4|
    BVERSION 1|
    PRECISIO T|
    BILLHANDLINGCOD E lDflt|
    INFOCURRENCYCOD E GBP|
    ACCCURRENCYCODE GBP|
    BILLPURPOSE 1|
    DAYTELNO 01253568052|
    FAXNO 0123456789|
    EMAILADDR jaer.ts7@fd.com|

    I wanted to fetch the value of fax number and save it into variable ..

    Can anybody tell me how to do that ,,

    Please send me the sample code for it .

    Thnaks in advance
  • Pilgrim333
    New Member
    • Oct 2008
    • 127

    #2
    Hi,

    What is the problem you are facing? What have you tried till now?

    Pilgrim.

    Comment

    • orajit
      New Member
      • Nov 2007
      • 75

      #3
      Can anybody please send me that sample code for Long datatype.

      Comment

      • amitpatel66
        Recognized Expert Top Contributor
        • Mar 2007
        • 2358

        #4
        Code:
        SQL> declare
          2  data_long VARCHAR2(32767);
          3  CURSOR C1 IS SELECT col1 FROM test1;
          4  BEGIN
          5  FOR I IN C1 LOOP
          6  data_long:= I.col1;
          7  IF(SUBSTR(data_long,1,5) = 'FAXNO') THEN
          8  DBMS_OUTPUT.PUT_LINE('Fax Number is:'||SUBSTR(data_long,7,length(data_long) - 7));
          9  END IF;
         10  END LOOP;
         11  END;
         12  /
        
        PL/SQL procedure successfully completed.
        
        SQL> set serveroutput on;
        SQL> /
        Fax Number is:0123456789
        
        PL/SQL procedure successfully completed.
        
        SQL> 
        
        SQL> desc test1;
         Name                                      Null?    Type
         ----------------------------------------- -------- ----------------------------
         COL1                                               LONG
        
        SQL>

        Comment

        • orajit
          New Member
          • Nov 2007
          • 75

          #5
          Thank you very much ...

          Comment

          Working...