Store Substring output to a table

Hi,
declare Input VARCHAR(10) :='011000141'
declare rt StringOutput%rowtype;
begin
SELECT SUBSTR(Input , SumOfLength - ColLength + 1, ColLength) FinalOutput INTO rt FROM mytable ;
end;
I need to store the result to a temp table rt.
Thanks!

933663 wrote:
Hi,
declare Input VARCHAR(10) :='011000141'
declare rt StringOutput%rowtype;
begin
SELECT SUBSTR(Input , SumOfLength - ColLength + 1, ColLength) FinalOutput INTO rt FROM mytable ;
end;
I need to store the result to a temp table rt.
Thanks!What do you mean by TEMP TABLE? And please explain in detail what you are trying to achieve. I would suggest you to read {message:id=9360002}

Similar Messages

  • REPORT OUTPUT to Internal table

    Hi,
    I order to achieve my requirement i need to know if this can happen:
    Q: I want to write a report REP1 (which has ITAB1) in which I want to run an already existing report REP2 and direct the result of the REP2 to ITAB1. So that upon this ITAB1 contents i will again perform some queries.
    Is this possible? If YES can anyone please let me know how?
    Thanks in advance,
    Karuna.

    Hi,
    Try using the command
    SUBMIT report_name AND RETURN EXPORTING LIST TO MEMORY.
    This will call the report and store the output of called report in momory. Then you can retrieve it in your main program by FM 'LIST_FROM_MEMORY'.
    See Below Sample Code.
    Hope it Helps. Reward points if useful.
        SUBMIT zefl_soff_update_single
                           WITH so_objid IN fin_tran
                          AND RETURN
                          EXPORTING LIST TO MEMORY.
        CALL FUNCTION 'LIST_FROM_MEMORY'
          TABLES
            listobject = t_list
          EXCEPTIONS
            not_found  = 1.
        REFRESH t_ascii.
        CALL FUNCTION 'LIST_TO_ASCI'
          TABLES
            listasci           = t_ascii " list converted to ASCII
            listobject         = t_list
          EXCEPTIONS
            empty_list         = 1
            list_index_invalid = 2
            OTHERS             = 3.
    Regards,
    Shailesh Jadhav

  • Store report output to blob column

    Hi,
    I would like to know whether it is possible to execute a report built using Report 10G and store its output, e.g. PDF content, onto a blob column of a table directly? If it's possible, could anyone show me an example in achieving it. Thank you.
    Regards,
    John

    Navneet,
    Thanks for the sample. I've tried setting up this custom destination and I get the following error when trying to run a report.
    REP-50125: Caught exception: java.lang.NullPointerException
    The URL that I am using is as follows:
    http://server_name:port/reports/rwservlet?report=report_name.rdf&userid=username/password@tnsname_entry&destype=BLOBdestination&desformat=PDF&DESNAME=http://username/password@host_name:port/instance/table_name/document_column_name/primary_key_column_name/10/report_desc_column_name
    Any ideas on what I've done wrong?
    Thanks
    David

  • To store the output of the OutputStream in the String

    I can get the output of the transformer.transform("","") to be printed on the screen, but the aim is to store the output in the String.
    I checked out the API, one way to get the data would be to store the output in the file using.....
    new StreamResult(new File("x.html")) and then get the data. But I am not suppose to use a temporary storage in the form of a file. Is there any other way I can get the data in the form of a String.
    The code is :
    File file = new File("table.xsl");
    StreamSource xslSource = new StreamSource(file);
    File file1 = new File("test.xml");
    StreamSource xmlSource = new StreamSource(file1);
    TransformerFactory tFactory = TransformerFactory.newInstance();
    Transformer transformer = tFactory.newTransformer(xslSource);
    target = new StreamResult(System.out);
    transformer.transform(xmlSource,target);
    Thanks in advance.
    manibhat

    Hi ecbouma,
    Thanks for the solution.
    I came across another approach..
    StringWriter sw = new StringWriter();
    PrintStream ps = new PrintStream(sw);
    sw.toString();
    It works fine...
    I have a question over here...
    PrintStream takes an argument that extends OutputStream, but looks like StringWriter does not extend OutputStream...
    I am not sure why does the above code works.
    manibhat

  • How to store query results into a table

    I want to store the query results to a table. Is there a way to automatically redirect output to a table without using a PL/SQL script.

    Run the following step only once unless you want to create the tabX everytime
    Create tabX as select x,y,z from tabY;
    Next time when you want to store the new results, run the following statement
    Insert into tabX select x,y,z from tabY;

  • How to store the output of a analog to digital converter into an 2D array

    Hi
    I am doing my M.Tech Thesis in Image reconstruction and I am using labview for simulation and I want to know how to store the output of a analog to digital converter into an 2D labview array.

    nitinkajay wrote:
    I want to know how to store the output of a analog to digital converter into an 2D labview array.
    How exactly are you performing 'Analog to Digital'???
    Grabbing image using camera OR performing data acquisition using DAQ card OR some other way????
    I am not allergic to Kudos, in fact I love Kudos.
     Make your LabVIEW experience more CONVENIENT.

  • I want to store an image in R3 table and retrive it

    Hi,
    i want to store an image in R3 table and retrive it from my function module.
    Can any one tell me what is the step by step procedure to do that.
    I am new to ABAP.
    Regards,
    H.V.Swathi

    Dear Swethi,
    You can move images to SAP using SE78. then u can use them where ever u you require them.
    SE78->GRAPHICS->BMAP here give ur image name and click on save
    Rgds,
    Kiran
    Edited by: Kiran on Jun 11, 2009 7:15 AM

  • How to store PDF files in a table

    Hi,
    Is there a way to store PDF files in a table? Do I use LOB? How do I automatically read them if I want them to be available in a web site?
    Thanks.
    Camille

    U have to use either BLOBs (internal LOBs) or BFILEs (external LOBs). check out docu. at http://www.akadia.com/services/ora_blob.html

  • How to Store an XML Data into Table?

    Hi All,
    My Requirement is "I Have an XML File (or) XML Data as CLOB, now I should decode this XML Data and find the equivalent data for columns in a table and then store that in a relational table",
    Would be greatful if any one can provide me a feasible solution (or) good link where I can get this information with examples.
    Thanks in advance,
    Sunil N

    Or,
    satyaki>
    satyaki>select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
    PL/SQL Release 10.2.0.1.0 - Production
    CORE    10.2.0.1.0      Production
    TNS for Linux: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    Elapsed: 00:00:00.03
    satyaki>
    satyaki>
    satyaki>drop table dump_tab;
    Table dropped.
    Elapsed: 00:00:01.08
    satyaki>
    satyaki>create table dump_tab
      2   (
      3      raw_xml  clob
      4   );
    Table created.
    Elapsed: 00:00:00.00
    satyaki>
    satyaki>
    satyaki>desc dump_tab;
    Name                                      Null?    Type
    RAW_XML                                            CLOB
    satyaki>
    satyaki>
    satyaki>insert into dump_tab
      2  select yy.rxml
      3  from (
      4        select ('  <data>
      5           <var name="document">
      6           <string>Sales Order</string>
      7           </var>
      8           <var name="results">
      9           <recordset rowcount="2">
    10           <field name="sales_num">
    11           <string>12345</string>
    12           <string>60192</string>
    13           </field>
    14           <field name="ord_qty">
    15           <string>10</string>
    16           <string>50</string>
    17           </field>
    18           </recordset>
    19           </var>
    20           </data>'
    21      ) rxml from dual
    22     ) yy;
    1 row created.
    Elapsed: 00:00:00.00
    satyaki>
    satyaki>commit;
    Commit complete.
    Elapsed: 00:00:00.00
    satyaki>
    satyaki>create table results
      2    (
      3      serial_no    number(5),
      4      sales_num    number(7),
      5      ord_qty      number(10)
      6    );
    Table created.
    Elapsed: 00:00:00.00
    satyaki>
    satyaki>desc results;
    Name                                      Null?    Type
    SERIAL_NO                                          NUMBER(5)
    SALES_NUM                                          NUMBER(7)
    ORD_QTY                                            NUMBER(10)
    satyaki>
    satyaki>select * from dump_tab;
    RAW_XML
      <data>
             <var name="document">
             <string>Sales Order</string>
             </var>
             <var name="results">
             <recordset rowcount="2">
             <field name="sales_num">
             <string>12345</string>
             <string>60192</string>
             </field>
             <field name="ord_qty">
    RAW_XML
             <string>10</string>
             <string>50</string>
             </field>
             </recordset>
             </var>
             </data>
    Elapsed: 00:00:00.01
    satyaki>
    satyaki>
    satyaki>ed
    Wrote file afiedt.buf
      1  insert into results(serial_no,sales_num,ord_qty)
      2  with t
      3    as (
      4         select xmltype(raw_xml) xml from dump_tab
      5       ),
      6    t1 as (select rownum rn, t1.column_value.extract('*/text()') sales_num from t t, table(xmlsequence(t.xml.extract('//field[@name="sales_num"]/string'))) t1),
      7    t2 as (select rownum rn, t2.column_value.extract('*/text()') ord_qty   from t t, table(xmlsequence(t.xml.extract('//field[@name="ord_qty"]/string'))) t2)
      8    select t1.rn x,
      9           to_number(regexp_replace(xmlelement("e",sales_num).getstringval(),'<(|/)e>','')) sales_num
    10           to_number(regexp_replace(xmlelement("d",ord_qty).getstringval(),'<(|/)d>','')) ord_qty
    11      from t1,t2
    12*    where t1.rn = t2.rn
    satyaki>/
    2 rows created.
    Elapsed: 00:00:00.00
    satyaki>
    satyaki>select * from results;
    SERIAL_NO  SALES_NUM    ORD_QTY
             1      12345         10
             2      60192         50
    Elapsed: 00:00:00.00
    satyaki>Regards.
    Satyaki De.

  • How to store Multiple Ec\xcels into Table Using sql loder

    Plese guide me to store Multiple Ec\xcels into Table Using sql loder

    I am not clear with your question. Do you want to load multipel Excel Files into a table. If so you can follow this link.
    http://www.orafaq.com/wiki/SQL*Loader_FAQ#Can_one_load_data_from_multiple_files.2F_into_multiple_tables_at_once.3F
    Thanks,
    Karthick.

  • How can I store an output, i.e C from the attatchmen​t in an array?

    How can I store an output, i.e C from the attatchment in an array?
    Attachments:
    Testing.vi ‏18 KB

    Hi, Se
    Take a look my example.
    Attachments:
    Testing.vi ‏23 KB

  • Output text in table form

    Hi all,
    I have a short little applescript that does some math and then outputs a mix of the results and plain text in tabular form, and copies it into a Word document. (I'm a complete novice at AS, this is maybe my third script).
    At present, the script essentially hand-writes the table by including the tabs and returns, e.g. this excerpt:
    set gradingScale to "A+" & tab & Aplus & return & "A" & tab & Astraight & return
    Is there a more efficient way to tell AS to output as a table? Like say, listing everything that belongs in column 1, or somesuch?
    thanks, Daiya

    table_result starts out at the top of the script as a blank string variable. In the example my repeat loop will run three times (the length of column_a) with the integer x. On each successive run x increases by 1, so we'll get the first, then second, then third items of column_a and column_b. Because we are fed these values one at a time, we must concatenate them to the values that we already got on previous runs through the repeat loop. By setting the value of table_result to itself, plus a bunch of new data, we can thus build the table line by line.
    The result term is just a convenient way to get the result of the previous line of code. Here are a few more examples.
    click here to open this script in your editor<pre style="font-family: 'Monaco', 'Courier New', Courier, monospace; overflow:auto; color: #222; background: #DDD; padding: 0.2em; font-size: 10px; width:400px">set x to 1
    repeat 3 times
    say x
    set x to x + 1
    end repeat
    repeat with z from 3 to 1 by -1
    say z
    end repeat
    "Go AppleScript!"
    say result
    </pre>

  • How to store XML data into Oracle Table

    I had trouble to store XML data into Oracle Table with XDK (Oracle 8.1.7 ). The error is:
    C:\XDK_Java_9_2\xdk\demo\java\Test>java testInsert Dept.xml
    <Line 1, Column 1>: XML-0108: (Fatal Error) Start of root element expected.
    Exception in thread "main" oracle.xml.sql.OracleXMLSQLException: Start of root element expected.
    at oracle.xml.sql.dml.OracleXMLSave.saveXML(OracleXMLSave.java:2263)
    at oracle.xml.sql.dml.OracleXMLSave.insertXML(OracleXMLSave.java:1333)
    at testInsert.main(testInsert.java:8)
    Here is my xml file:
    <?xml version = '1.0'?>
    <ROWSET>
    <ROW num="1">
    <DEPTNO>10</DEPTNO>
    <DNAME>ACCOUNTING</DNAME>
    <LOC>NEW YORK</LOC>
    </ROW>
    <ROW num="2">
    <DEPTNO>20</DEPTNO>
    <DNAME>RESEARCH</DNAME>
    <LOC>DALLAS</LOC>
    </ROW>
    <ROW num="3">
    <DEPTNO>30</DEPTNO>
    <DNAME>SALES</DNAME>
    <LOC>CHICAGO</LOC>
    </ROW>
    <ROW num="4">
    <DEPTNO>40</DEPTNO>
    <DNAME>OPERATIONS</DNAME>
    <LOC>BOSTON</LOC>
    </ROW>
    </ROWSET>
    and here is structure of table:
    Name Null? Type
    DEPTNO NOT NULL NUMBER(2)
    DNAME VARCHAR2(14)
    LOC VARCHAR2(13)
    and here is my Java Code:
    import java.sql.*;
    import oracle.xml.sql.dml.OracleXMLSave;
    public class testInsert{
         public static void main(String[] args) throws SQLException{
              Connection conn = getConnection();
              OracleXMLSave sav = new OracleXMLSave(conn,"scott.tmp_dept");
              sav.insertXML(args[0]);
              sav.close();
              conn.close();
         private static Connection getConnection()throws SQLException{
              DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
              Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@amt-ebdev01:1521:mydept","scott","tiger");
              return conn;
    Could you help me ? Thanks !

    The problem is that you need to pass avalid URL , Document...
    Please try this code instead:
    import java.net.*;
    import java.sql.*;
    import java.io.*;
    import oracle.xml.sql.dml.OracleXMLSave;
    public class testInsert
    public static void main(String[] args) throws SQLException{
    Connection conn = getConnection();
    OracleXMLSave sav = new OracleXMLSave(conn,"scott.temp_dept");
    URL url = createURL(args[0]);
    sav.insertXML(url);
    sav.close();
    conn.close();
    private static Connection getConnection()throws SQLException{
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@dlsun1982:1521:jwxdk9i","scott","tiger");
    return conn;
    // Helper method to create a URL from a file name
    static URL createURL(String fileName)
    URL url = null;
    try
    url = new URL(fileName);
    catch (MalformedURLException ex)
    File f = new File(fileName);
    try
    String path = f.getAbsolutePath();
    // This is a bunch of weird code that is required to
    // make a valid URL on the Windows platform, due
    // to inconsistencies in what getAbsolutePath returns.
    String fs = System.getProperty("file.separator");
    if (fs.length() == 1)
    char sep = fs.charAt(0);
    if (sep != '/')
    path = path.replace(sep, '/');
    if (path.charAt(0) != '/')
    path = '/' + path;
    path = "file://" + path;
    url = new URL(path);
    catch (MalformedURLException e)
    System.out.println("Cannot create url for: " + fileName);
    System.exit(0);
    return url;

  • Where does Plan Version field store in SAP project system table?

    Hi,
    I would like to know where where does Plan Version field store in SAP project system table.
    The plan version that I m refering is the Plan Version 1 in the menupath u201COn the Project Info System: Progress Analysis: Initial Screen, Choose Settings > Value display > Plan versionsu201D.
    T-Code: CNE5
    Thanks.

    hi,
    try table TKA09
    regards

  • I want to know the top 10-20 Store procedures used in the table.

    Hello All, 
    There are total 3500+ Store procedures created in the server. So,  I want to know the top 10-20 Store procedures used in the table. Like which store procedures are important and what are they, is there any code to find them? 
    I think the question might be very silly, but i don't know which store procedure to look at it. 
    Please help me on this issue.
    Thanks.
    Thanks, Shyam.

    By what? CPU? Memory? Execution count?
    Glenn Berry wrote this
    -- HIGH CPU ************
          -- Get Top 100 executed SP's ordered by execution count
          SELECT TOP 100 qt.text AS 'SP Name', qs.execution_count AS 'Execution Count',  
          qs.execution_count/DATEDIFF(Second, qs.creation_time, GetDate()) AS 'Calls/Second',
          qs.total_worker_time/qs.execution_count AS 'AvgWorkerTime',
          qs.total_worker_time AS 'TotalWorkerTime',
          qs.total_elapsed_time/qs.execution_count AS 'AvgElapsedTime',
          qs.max_logical_reads, qs.max_logical_writes, qs.total_physical_reads, 
          DATEDIFF(Minute, qs.creation_time, GetDate()) AS 'Age in Cache'
          FROM sys.dm_exec_query_stats AS qs
          CROSS APPLY sys.dm_exec_sql_text(qs.sql_handle) AS qt
          WHERE qt.dbid = db_id() -- Filter by current database
          ORDER BY qs.execution_count DESC
          -- HIGH CPU *************
          -- Get Top 20 executed SP's ordered by total worker time (CPU pressure)
          SELECT TOP 20 qt.text AS 'SP Name', qs.total_worker_time AS 'TotalWorkerTime', 
          qs.total_worker_time/qs.execution_count AS 'AvgWorkerTime',
          qs.execution_count AS 'Execution Count', 
          ISNULL(qs.execution_count/DATEDIFF(Second, qs.creation_time, GetDate()), 0) AS 'Calls/Second',
          ISNULL(qs.total_elapsed_time/qs.execution_count, 0) AS 'AvgElapsedTime', 
          qs.max_logical_reads, qs.max_logical_writes, 
          DATEDIFF(Minute, qs.creation_time, GetDate()) AS 'Age in Cache'
          FROM sys.dm_exec_query_stats AS qs
          CROSS APPLY sys.dm_exec_sql_text(qs.sql_handle) AS qt
          WHERE qt.dbid = db_id() -- Filter by current database
          ORDER BY qs.total_worker_time DESC
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

Maybe you are looking for

  • MacBook Pro/External Hard Drive/Windows PC

    I have a MacBook Pro and a Windows desktop...and an external hard drive.  I want to load some music on the external hard drive using the MacBook and then copy from the external hard drive to the Windows desktop.  Is this possible?

  • New iPhone photos not showing up on new Photos app on iMac

    In the past, when I took a photo on my iPhone, within moments it would show up on Aperture on my iMac in the iCloud tab.  This is not happening on the new Photos app on my iMac using the latest OS. In fact, there is not an "iCloud' stream area within

  • Passing Unix variable into sql

    Hi, I have a shell script with embedded SQL. In the script I have a Unix variable that has a char value id="P_test". I need to pass this variable to a select in a where condition like select * from table where camp1=$id. The problem is $id returns P_

  • The data base DLL 'crdb_dao.dll' could not be loaded.

    This has  been posted in other threads but I've not seen a final resolution. I used VS2008 to create an application that includes Crystal Reports and One Click in VS2008 to create a runtime system to distribute my application.  The system installs an

  • Ichat errors even though ichat not installed

    Hey all, Man Mini "server".  New install. Did NOT install iChat (it is not listed as a service in server admin).  Despite this I get the following errors in system log repeated every three seconds. Jun  4 10:20:27 man1 jabberd/c2s[226]: [8] [::ffff:1