Retrieve data from similar columns

With the help of Oracle 10 g, SQL Developer v1.5
I have a table with 200 columns.
I'm trying to get the data from all columns ending with "_DT".

I got the list of columns but impossible to incorporate into the SELECT stmt.
SELECT column_name FROM user_tab_columns
WHERE table_name = 'XXX_STG_INST_DEBT'
AND column_name LIKE '%_DT';
How can this be achieved?

Thank you.

Try the following pl/sql

serverout Set size 1000000
declare
ALL OTHERS INTEGER;
ignore the number;
cursor c is
Select column_name
of user_tab_columns
where column_name like '% _DT '.
and table_name = "XXX_STG_INST_DEBT";
SQLSTR varchar2 (20000): = "CREATE VIEW APPOVIEW_FORUM AS SELECT ';
Start
for r in c loop
sqlstr: = sqlstr. r.column_name | «, » ;
end loop;
sqlstr: = rtrim (sqlstr, ','). ' FROM XXX_STG_INST_DEBT';

dbms_output.put_line ('Executing' | sqlstr);

CURSOR_NAME: = DBMS_SQL. OPEN_CURSOR;
DBMS_SQL. PARSE (all other cases, SQLSTR, DBMS_SQL.native);
ignore: = DBMS_SQL. EXECUTE (CURSOR_NAME);
DBMS_SQL. CLOSE_CURSOR (CURSOR_NAME);
end;
/

Select * from appoview_forum;

Drop view appoview_forum;

Max

Tags: Database

Similar Questions

  • How to join two tables to retrieve the data from the columns in table two. Tables have primary and foreign key relationships

    Hello

    I want to join the two tables to retrieve the data from the columns of the two table passing parameters to the join query. Tables have primary and foreign key relationships

    Details of the table

    Alert-1 - AlertCode (FK), AlerID (PK)

    2 AlertCode-AlertDefinition-(PK)

    Help, please


    ----------

    Hi Vincent,.

    I think that you have not worked on adf 12.1.3.  In adf 12.1.3 you don't have to explicitly create the association. When you create the EO to your table, Association xxxxFkAssoc, will be created by ADF12.1.3 for you automatically. Please try this and do not answer anything... You can also follow the links below. I solved the problem by using the following link

    Oracle ADF Guide step by step - Oracle ADF tutorial: creating a relationship of the master / detail using Oracle ADF

    ---

  • to retrieve data from xml data type

    Hello...
    I have a doubt in the oracle database... Here's how to retrieve data from xml data type?

    Like this...

    SQL> ed
    Wrote file afiedt.buf
    
      1  with t as (select xmltype('
      2  
    3 4 toMonth5 5 ctTestPan1 6 costType2 7 toYear2012 8 fromMonth12 9 fromYear2011 10 11
    ') as xml from dual) 12 -- 13 -- end of sample XMLDATA, use below query on your own table etc. as required 14 -- 15 select x.* 16 from t 17 ,xmltable('/DETAILS/FIELDS_VALUES/FIELD' 18 passing t.xml 19 columns name varchar2(30) path './NAME' 20 ,val varchar2(10) path './VALUE' 21* ) x SQL> / NAME VAL ------------------------------ ---------- toMonth 5 ctTestPan 1 costType 2 toYear 2012 fromMonth 12 fromYear 2011 6 rows selected.
  • create the http client to retrieve data from web service

    Hello

    I am newbie on our webworks. I need to retrieve data from web service. How to connect to this service and analyzed. There is a tutorial that can help me get started with it.

    Can any one advice me how can I start working with webworks on blackberry 10

    Thanks for any help

    In general, you will need to use an AJAX call to the server

    It really depends on what the server returns as to how the information is easy to digest

    JQuery provides a simple interface, and returns information easy to use

    If you deal with things gets complicated XML according to namespace

    If you look at the raw XML data and it goes something like fred: name you will have questions requiring an implementation of SAX - JSON is simple if you don't get that even if (nothing too confusing here)

    If using an external data source JSON go if you have the choice

    As examples go - just look to the top of JQuery Ajax [JSON / XML] and you will get where you're going quickly

    SAX is MUCH harder because of the namespace - Dublin is the most common and same XML without namespace is not simple to handle, so avoid it if you can

  • With the help of the socket object to retrieve data from web application without the html files

    I tried to use the socket object to retrieve data from a web application (I just control script version vs version online). So all I want to do is access http://hyle.io/version that returns me the current version of the application (such as a simple string) in order to compare it in my script and then notifies the user accordingly. I have just a few problems using the socket object. I used this code from the Adobe Javascript Tools Guide:


    reply = "";
    conn = new Socket;
    // access Adobe’s home page
    if (conn.open ("www.adobe.com:80")) {
    // send a HTTP GET request
    conn.write ("GET /index.html HTTP/1.0\n\n");
    // and read the server’s reply
    reply = conn.read(999999);
    conn.close();
    }
    

    ... that I then adapted as:

    reply = "";
    conn = new Socket;
    if (conn.open ("hyle.io:80")) {
      conn.write ("GET /version HTTP/1.0\n\n");
      reply = conn.read(999999); 
      conn.close();
    }
    

    And here is what I get:

    HTTP/1.1 400 Bad Request
    Content-Length: 225
    Content-Type: text/html
    Server: Pagodabox-Routing-Mesh
    
    

    Bad Request

    Your browser sent a request that this server could not understand.

    Résultat : true

    I don't know a lot about HTTP requests, but I wondered if it was related to the fact that I am not pointing to a specific HTML file and the type of request was wrong or if I should rather check if there is something wrong with my host?

    The site/app is PHP and is hosted on PagodaBox if it helps.

    Thanks in advance!

    Hi Sebastien Lavoie,

    It should work

    var HTTPFile = function (url, port) {}

    If (arguments.length == 1) {}

    URL = arguments [0];

    port = 80;

    };

    This.url = url;

    This.port = port;

    this.httpPrefix = this.url.match(/http:\/\//);

    This.Domain = this.httpPrefix is nothing? This.URL.Split("/") [0] + ":" + this.port: this .url .split ("/") [2] +":" + this.port;

    This.Call = ' GET ' + (this.httpPrefix == null? ' "). " http://" (+ this.url: this.url) + "HTTP/1.0\r\nHost: ' + (this.httpPrefix is nothing? "This.URL.Split("/ ") [0]: this .url .split (" / ") [2]) +" \r\nConnection: close\r\n\r\n ";

    This.Reply = new String();

    This.Conn = new Socket();

    This.Conn.Encoding = "binary";

    HTTPFile.prototype.getFile = {function (f)}

    var typeMatch = this.url.match(/(\.) (\w{3,4}\b)/g);

    If (this.conn.open (this.domain, "binary")) {}

    This.Conn.Write (this.) Call);

    This.Reply = this.conn.read (9999999999);

    This.Conn.Close ();

    } else {}

    This.Reply = "";

    }

    (Return this.reply.substr(this.reply.indexOf("\r\n\r\n")+4);

    };

    }

    Hyle var = new HTTPFile ("http://hyle.io/version");

    Alert (hyle. GetFile());

    And by the way, I like the idea of 'http://hyle.io'. Can you give me your email address, I want to learn more about this Web site.

    Please send me an email to [email protected]

  • retrieve data from staging account

    Hello

    does anyone know how we can retrieve data from staging of account using 'Segmentation Wizard', "report analysis tool", model of fusion and mailing, etc.?

    Seems that these tools connect only to the production instance...

    Thanks, Sab

    SAB,

    for segmentation Wizard (and perhaps other office files), you will have to go file - properties - Custom and update the values for the name of pod, if you have a job you know what value it is as I am not "have a practice to watch.

    see you soon
    Alex

  • Retrieve data from AddressBook for Webworks Smartphone

    Hi all
    I want to implement the address book API. Where can I get/retrieve data (phone number, address of E-mail etc) for my Application project.
    Is it possible to invoke the address book to recover data?

    I go through this link, but it did not help me https://developer.blackberry.com/html5/apis/blackberry.invoke.addressbookarguments.html#view

    I have searched several times but could not get a code to make it possible.
    Please help me if someone know the solution or have any sample code.

    Thank you best regards &,.
    Castillo

    Its seems quite surprising that no member of this forum suggests even a single code related to this problem...

    However, I still have more research and find the alternative.

    var contactResult = new Array();
    
    var Fname = new blackberry.find.FilterExpression("firstName", "!=", "");
    
        contactResult = blackberry.pim.Contact.find(Fname);
        for ( var i = 0; i < contactResult.length; i++) {
            var totalName = contactResult[i].title+ " "+ contactResult[i].firstName+ " "+ contactResult[i].lastName;
            }
    

    This will retrieve all data or contacts from the address book. For which I have to do a custom address book.

  • SQL to retrieve data from the day before

    Hello

    I am asked to collect intelligence data and generate a daily report to determine the success rate (to do daily data that determines success rate). I have a session_time of column (with the DATE data type) that I try to do the job. I've been using:

    Select * from ABC

    where session_time > = TRUNC (SYSDATE - 2)

    Gives me data, but I get the data from 26/10/14 and 10/28/14 so when I only need data on 27-10-14 (as of the day 28/10/14). I tried a few variations and did not get the expected result. Could someone please help me understand this? Time is also displayed in my outings, maybe I shouldn't include the time?

    I use: TOAD for Oracle 11.5.1.2.

    Oracle Database 11g Enterprose 11.2.0.1.0 Edition

    Thank you in advance.

    Hello

    2632048 wrote:

    Hello

    I am asked to collect intelligence data and generate a daily report to determine the success rate (to do daily data that determines success rate). I have a session_time of column (with the DATE data type) that I try to do the job. I've been using:

    Select * from ABC

    where session_time > = TRUNC (SYSDATE - 2)

    Gives me data, but I get the data from 26/10/14 and 10/28/14 so when I only need data on 27-10-14 (as of the day 28/10/14). I tried a few variations and did not get the expected result. Could someone please help me understand this? Time is also displayed in my outings, maybe I shouldn't include the time?

    I use: TOAD for Oracle 11.5.1.2.

    Oracle Database 11g Enterprose 11.2.0.1.0 Edition

    Thank you in advance.

    Use:

    SELECT *.

    ABC

    WHERE session_time > = TRUNC (SYSDATE) - 1

    AND session_time<  trunc="">

    ;

    It's 09:15 on October 28, 2014, then TRUNC (SYSDATE - 2) is 00:00:00 October 26; The query you posted became data of October 26 and later.  (You may not all future dates in your table.)

    If it's 09:15 October 28, then TRUNC (SYSDATE) is 00:00:00 October 28 (i.e., midnight, at the beginning of October 28) and TRUNC (SYSDATE) - 1 is 00:00:00 October 27.

    Do not be tempted to use

    WHEN TRUNC (session_time) = TRUNC (SYSDATE) - 1 * INEFFECTIVE!  ***

    It will get the same results, but it is slower, you cannot use an index on session_time and requires a call to separate function for each row in the table, it is selected or not.

  • When I extract data from a column that contains and it gets converted to &amp; amp;

    I have data in a column say countries with the following value New Zealand & Australia
    It gets converted into New Zealand & am p;  Australia ... in the text element...
    The value is taken from the column
    How to avoid that this amp; being added.
    Is it a bug how do we get around that.


    Select off_country of contact where contact_No = mnontactno;
    I use this in a dynamic action when I load the page.
    I have a question in the hope of data one can help with this

    Version 4.2 db 11g apex

    Edited by: zycoz100 January 6, 2013 18:59

    Please, don't post duplicate discussions: + {: identifier of the thread = 2482368} +.

    As you can see, doing so does not get answers just more quickly.

    Close this message and stick to the original.

  • [Urgent] Retrieve data from oracle datafile partially crushed

    We have a big problem, we stopped in a backup/restore process from production to the test database because we found that some development SP/package code was not saved previous test DB. Now we have partially crushed oracle datafile and I guess that / hope the compiled code was stored in the last section of the data file, there is a way to retrieve the data from this data file? I intend to use an editor of exadcimal as a last resource, hoping that the data was not encrypted, but if there is another useful tool could be better. There are other storage media like newspapers/redo logs reach where we can try to find the lost code? The machine was not under a protocol of backup, so we can't count on that.

    Help, please

    Fabrizio

    MS code is stored in the dictionary (System tablespace), if you were restoring with RMAN, is the last file to restore.

    Good luck!
    : p

  • Which service API should I use to retrieve data from Eloqua 'Integration of the internal queue'?

    In my Eloqua Sandbox environment, I managed to create several "external Test calls complete" that appear on the tab 'Reports of the integration of queue internally'. Can someone tell me what Eloqua API or services are required to recover the data of this "Internal queue" Eloqua? I guess that's the way to connect the dots of data updates occurring in Eloqua to an external system. My ultimate goal is personalized with a non-native CRM integration.

    Thank you

    Heath

    Hi Heath,

    The post following (How to recover data from activity through the API) describes how to extract data from the queue inside.

    Hope this helps and please let me know if you need more information.

    Thank you

    Fred

  • retrieve data from webcenter content to ADF

    Hi all

    I want to recover data from webcenter content to pages in the adf. How can I do?

    Well, you can use RIDC API for this.that is best suited

    see this

    http://www.techartifact.com/blogs/2013/05/How-to-connect-with-UCM-in-ADF-using-RIDC-API.html

    Oracle Fusion Middleware Flavius Búrca Blog: integration Oracle UCM 11 g RIDC WebCenter/ADF 11 g

  • get data from two columns in a column

    Hello

    I need to display the data in two columns in a column, that I would also like to insert a space between the data in two columns in the output

    can I use something like this?

    (IMPORTER_NAME +' ' + IMPORTER_ADDRESS) as a 'place '.

    Your fence.

    to concatenate in oracle using pipes:

    (IMPORTER_NAME||' '||IMPORTER_ADDRESS) as "Location"
    
  • Help me with SQL Query to retrieve data from a view

    Hello Guru,

    I need help in my sql query.
    I use SQL TeraData.
    I want an Oracle result in the following form-

    Open tickets
    Open months failure / Repair Service s/o improvement request Total general
    2009-01-2 4 4 5 15
    2009-02 1 0 2 3 6
    2009-03 4 1 2 2 9
    Grand Total 7 5 8 10 30


    I wrote the query as where - TIME_PERIOD, RQST_TYPE_DM and DEMAND_SUMMARY_FCT are the points of view and I extract the data from the views only.

    Select NVL (CA. TIME_PERIOD. PERIOD_CD, 'Total') THAT year.
    COUNT (CASE WHEN CA. RQST_TYPE_DM. RQSTTYP_DESC Like '% of Break' THEN 1 END) as BreakFix
    COUNT (CASE WHEN CA. RQST_TYPE_DM. RQSTTYP_DESC as 'N/a', 1 END) by n/a
    COUNT (CASE WHEN CA. RQST_TYPE_DM. RQSTTYP_DESC as 'Improvement' THEN 1 END) accessories
    COUNT (CASE WHEN CA. RQST_TYPE_DM. RQSTTYP_DESC Like '% Service' THEN 1 END) as ServiceRequests
    COUNT (CA. RQST_TYPE_DM. RQSTTYP_DESC) AS grand_total
    FROM CA. TIME_PERIOD, CA. RQST_TYPE_DM, CA. DEMAND_SUMMARY_FCT
    WHERE (CA. DEMAND_SUMMARY_FCT. RQSTTYP_ID = CA. RQST_TYPE_DM. RQSTTYP_ID)
    AND (CASE
    WHEN CA. DEMAND_SUMMARY_FCT. MONTH_ID = CA. TIME_PERIOD. PERIOD_ID, 1
    WHEN {fn concat ({fn concat (SUBSTR (CA. TIME_PERIOD. {(PERIOD_CD, 3, 4),'-')}, SUBSTR (CA. TIME_PERIOD. PERIOD_CD, 7, 2))} BETWEEN ' 2009-01' AND ' 2009-03' THEN 1
    WHEN CA. DEMAND_SUMMARY_FCT. RQSTTYP_ID = '1' then 1
    END) = 1
    GROUP BY ROLLUP (CA. TIME_PERIOD. PERIOD_CD)

    After executing the query, I get the following error:
    3076: syntax Error: Data Type 'Time' does not match a defined Type name.
    :( Kindly help me with this and let me know where I'm wrong... Please.

    Messages indicates something wrong with your data... It would seem that the data does not match your format mask.

    Thus, the data or the format mask.

  • Retrieve data from xml to text-column

    I have a table that has a field (data type 'text') that contains an xml file. After some trial and error, I discovered that the only way to extract the full XML of this table is to use the ms sql "for XML" clause. But my problem is, that the column containing the xml file is called something like "XML_F52E2B61 - 18A 1 - 11 d 1-B105-00805F49916B" which is an identifier of invalids by CF.

    Is there a way to access this column by id instead of its name or what is the best way to access this topic?

    The SQL I use is:

    SELECT XmlPackage
    FROM LogK3OnChange
    WHERE DealerID = IsNull(<cfqueryparam cfsqltype="cf_sql_varchar" value="#arguments.dealerid#">, DealerID)
    AND LogID = <cfqueryparam cfsqltype="cf_sql_varchar" value="#arguments.logid#">
    FOR XML RAW

    Kind regards

    Heiko

    I have it!

    If I use something like

    #myQuery ["XML_F52E2B61 - 18A 1 - 11 d 1-B105-00805F49916B"] [1] #.

    I can access the column without any problem

Maybe you are looking for

  • Last updated iPhone erased all my notes!

    The last (pushed) iPhone update erased all my NOTES.  How to recover?

  • Lost the ability to boot to OS x

    So I had OSX and a second partition of work with earn 10 of installed with Bootcamp. Both worked very well. Then, I created a third partition through disk utility. Then I tried to start to win 10 and had an error: PC needs to be repaired, File: \Wind

  • Cannot install Windows XP on Equium L20-197

    Hi all I am trying to install a new copy of Windows XP pro on my L20. I formatted the drive to NTFS using the installation CD and everything worksvery well until I enter the product key, and then the computer hangs for a few secondsand then re-boots.

  • Satellite L300D - battery is not full

    Hello. I have a Satellite L300D (that I bought in March this year) so far, I never had problems with the battery, but since yesterday it s not charging. I plug the AC and the lights are on, even the battery one orange not fully charged so that it tur

  • HP Photosmart C4280: HP Photosmart C4280-failure Solutions Center

    Solution Center does not work - hpqdirec.exe does not (flash.ocx missing in the new version of Windows)? "HP Print and Scan Doctor" to find problems and suggests to install "scanjet_vista_tablet_patch.exe", then all tests are OK. Diagnosis: No proble