How to back up statement pl/sql varchar and call EXEC on that?

So this statement works:

SELECT BULK COLLECT INTO table_column_list FROM all_tab_columns WHERE table_name column_name is conv_tablename AND OWNER IN (SELECT USER FROM DUAL);.

However, I want to add conditions such as 'AND column_name <>'abc' ' at the end I tried so save this varchar type and call EXEC on that:

select_column_value_sql_stmt: = ' SELECT column_name BULK COLLECT INTO table_column_list FROM user_tab_columns WHERE table_name = "' | conv_tablename | '''' || inexclude_column;
EXECUTE IMMEDIATE select_column_value_sql_stmt;

No matter how I concatenate the conv_tablename part, I get an error. invalid identifier or function not implemented.

so is it possible to do at all?

Thanks in advance.

Welcome to the forum!

Wheneve validation to provide your Oracle version 4-digit (result of SELECT * FROM V$ VERSION).
>
So this statement works:

SELECT BULK COLLECT INTO table_column_list FROM all_tab_columns WHERE table_name column_name is conv_tablename AND OWNER IN (SELECT USER FROM DUAL);.

However, I want to add conditions such as 'AND 'abc' column_name' so at the end I tried save this varchar type and call EXEC on that:

select_column_value_sql_stmt: = ' SELECT column_name BULK COLLECT INTO table_column_list FROM user_tab_columns WHERE table_name = "' | conv_tablename | '''' || inexclude_column;
EXECUTE IMMEDIATE select_column_value_sql_stmt;

No matter how I concatenate the conv_tablename part, I get an error. invalid identifier or function not implemented.

so is it possible to do at all?
>
Yes - you can do it, but the syntax is different for BULK COLLECT when you use EXECUTE IMMEDIATE. It is after having RECEIVED the request, not in it.

See the example code at this link
http://UNIX-Oracle-11g.blogspot.com/2011/03/dynamic-SQL-Execute-immediate-bulk.html

  -- example of dynamic sql with bull collect
  v_sql_stmt := 'SELECT sal FROM emp_t';
  EXECUTE IMMEDIATE v_sql_stmt BULK COLLECT INTO vc_sal;

If you are not able to use a common set of queries for vs normal run immediately.

Tags: Database

Similar Questions

  • How to print a document all e-mail and not a 'screenshot' that I get in the option Print Preview.

    How to print a document all e-mail and not a 'screenshot' that I get in the option Print Preview. I would like to print "file" "as I can on other browsers (IE, for example). When I try to print from Firefox it catches all my info (shirts, etc.) from the left side of the page. I need only e-mail information, not information of the entire screen. Thank you!

    -Bruce

    I had the same problem at first. You open the e-mail as usual. And then in the Actions drop-down list box, you select the print option. This has worked for me and printed the actual e-mail only.

  • How can I justify the difference between varchar and varchar2 data type

    Hi all

    How can I justify the difference between the data type varchar and varchar2 on any table for space management.
    Is there any query to justify this.


    Concerning
    Girish

    Published by: boujemaa on February 2, 2011 21:23

    http://download.Oracle.com/docs/CD/B19306_01/server.102/b14220/datatype.htm#sthref3780


    The VARCHAR data type

    The VARCHAR data type is synonymous with the VARCHAR2 data type. To avoid any changes in behavior, always use the VARCHAR2 data type to store strings of variable length.

  • How I replace the toolbar firefox... and remove the toolbar that starts with the MOST VISITED and SUGGESTED SITES

    Somehow lost the toolbar that has the page back arrow and refresh and stop icons. How can I replace those and remove a toolbar that starts with the MOST VISITED and lists several SUGGESTED SITES.

    Hello kittyheckel, please see the Navigation buttons such as back, home, bookmarks and recharge are missing. You'll want to disable the bookmarks toolbar and enable the navigation toolbar.

  • I returned my iPhone5 to factory default and gave it to my granddaughter.  She wants to download games etc but the itunes store guard asking my ID and PW.  How can she save herself?  I received and email to say that PW tried to reset

    I returned my iPhone5 to factory default and gave it to my grand daughter as a Christmas gift.

    • She wants to download games etc but the itunes store guard asking my ID and PW.
    • How can she save herself?
    • I received and Apple to say that someone had tried to reset my password by e-mail.
    • It is probably her mother because she also asked me to tell him my PW and ID.
    • I currently use my PW and ID on my new 1Phone6 and do not want to share this.

    Can you please help.

    Julie Bateman

    She needs to log out of your Apple ID in the store and just connect with hers. Go to settings, iTunes and App Store and tap on the Apple ID, then select Disconnect.

  • How to store select statements in a procedure and use it as a parameter

    I need to enter below the select statements in a stored procedure with an input parameter, business_dt_num. This parameter must be the result under the statement select and placed inside the procedure...
    select max(business_dt_num)
    from invent.dp_ca 
    If a select statement fails he must get out of the execution of the procedure and is not engaged in the next select statement. How can I cancel the execution of the procedure, if a select statement fails?
    select max(business_dt_num)
    from invent.dp_ca 
    /
    Select count (1)
    of invent.dp_ca
    where BUSINESS_DT_NUM = YYYYMMDD
    and product_id! = 0 ;
    -above and below sql account must match
    Select count (1)
    invent.dp_ca d, e invent.dp_ca_proof
    where d.BUSINESS_DT_NUM = YYYYMMDD
    and d.KEY_ID = e.KEY_ID;
    /
    exec pk_proof.pr_PopulateTaggingWorkTable_CA (yyyymmdd);
    /
    SELECT count (distinct univ_key_id) of invent.dp_ca_proof
    where business_dt_num = YYYYMMDD and proof_status! = « A » ;
    -above and below sql account must match
    Select count (0) in the invent.dp_ca_work where business_dt_num = YYYYMMDD.
    Thanks,
    Steve
    
    Edited by: steve2312 on Dec 22, 2011 12:32 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
    declare
       dp_ca_count1 number;
       dp_ca_count2 number;
    begin
       select count(1) into dp_ca_count1
       from invent.dp_ca
       where BUSINESS_DT_NUM = trunc(sysdate)
       and product_id != 0;
    
       select count(1) into dp_ca_count2
       from invent.dp_ca d, invent.dp_ca_proof e
       where d.BUSINESS_DT_NUM = trunc(sysdate)
       and d.KEY_ID = e.KEY_ID;
    
       if dp_ca_count1 != dp_ca_count2 then
               raise_application_error (-20001, 'Counts do not match.');
       end if;
    end;
    /
    
  • I format the machine. How to back up the configuration of Firefox and bookmarks for re-installing later?

    I need to reinstall my operating system to windows 7. Firefox works fine. All I need is a procedure to save the configuration of Firefox and bookmarks to facilitate the configuration process when I re - install Firefox later. Thank you

    Firefox stores all your information in a folder called "account profile". If you back up to the top (on a USB key, for example), you can copy it back later after you have reinstalled your computer (including Firefox, of course) and all your settings, passwords, bookmarks, etc. will be present again. Take a look at: back up and restore the information contained in the profiles of Firefox.

  • How to get out a subset in front and behind a number that your search in a table.

    Hello

    A search gives me nothing so I apologize if it's there somewhere and I'm not.  I'm using LabVIEW 7.1 and seeks an array for a given value.  Once I found this value in the table, I want to take the 51 values with the one I found in the research at the Center. Is there an easy way to do this?  The current way I'm doing it is by using the table search and seizure then the index in the array with a length of 51 subset function.  Of course, I want to get the points of 25 data before and 25 after what I searched, and not 50 after.  What is the most effective way to do it?  I should fork by the index of my result of research into two table vi.  One being the 25 index and the index and then set the length of these two sub-tableau at 25?  Thanks for any advice regarding the case.  Sam

    Why don't you just subtract 25 from the index that your value is found and use it as an index for the subset of the table starts?  You will have to do the situation where your desired value is less than 25 points, but that should be fairly easy depending on how you want to manage.

  • How can I stop the calendar to automatically and overiding gmail so that I can't access. Can I use windows Explorer and it does not happen.

    When I use firefox to access my gmail account, the calendar turns itself on and I then can't seem to my emails. If I get the windows Explorer gmail account, it doesn't. What I can do to prevent this in firefox. He started all of this today.

    This has happened

    Each time Firefox opened

    Is today

    I have the same problem.

  • How can I get Microsoft let me alone and stop telling me that my copy of Windows is not genuine? I don't care & I'm tired of the message whenever I open my laptop!

    Remember - this is a public forum so never post private information such as numbers of mail or telephone!

    Ideas:

    • You have problems with programs
    • Error messages
    • Recent changes to your computer
    • What you have already tried to solve the problem
    There are occasional circumstances where WGA alarm because of a bug.
     
    Here are the instance only recently this issue, of which I am aware:
     
     
    If the hotfix here works on your system, you're in good shape, otherwise, I agree with the other answer: you have been caught by someone (which means that you were given or bought fake software) - and the sooner you recognize that and the best deal for everyone.
    "Brittany1234" wrote in message News: 640 a 6087-24ad-46fe-989 c-7f7dc635e5b1...

    Remember - this is a public forum so never post private information such as numbers of mail or telephone!

    Ideas:

    • You have problems with programs
    • Error messages
    • Recent changes to your computer
    • What you have already tried to solve the problem

    Bill Sanderson

  • How to get a color of the label and the UID of that color in Indesign CC 2015?

    Hello

    I found the API to set the color of the tag XML in InDesign CC 2015 as below:

    IXMLTagCommands::SetTagColor(IDataBase* db, UID tag, UID color);
    

    But I cannot yet understand where I can get the UID of different colors. Can someone help me with the file name for the same thing?

    Also, is it possible to get the XML tag color?

    Hi kapoor_aman27,

    different colors, take a look at IUIColorUtils in the SDK.

    Markus

  • How can I save cfquery text sql, not the results

    Hello

    I have the need to save a dynamically generated real sql, cfquery, not the results.

    I can see it in < cfdump var = "# < qry_name > #" > but, how can I capture the real sql

    and save it in a var for later use?

    Thank you

    Bob

    The property of the results of the tag to put this information in a variable for later use.

    I.E.

    ...
    
    
  • latitude longitude coordinates SQL Server and the plot on the map of the brochure

    My question is basically:

    How to transform the data from SQL Server and map by unfolding?

    TIP: We run 11 Coldfusion, SQL Server 2000, flyer and JQuery if that helps somehow. If I need to download a javascript library, I can easily do.

    I ambulance and fire events in a database with the xy coordinates. My goal is to ask them about the news and place them on a map of the brochure. All our ambulances and fire trucks have gps in them and they broadcast at all times their location and status. Here's my query to get the latest data from gps for each truck;

    /*

    SQL Server 2000

    David Kulpanowski

    June 4, 2015

    Lee County EMS

    */

    SELECT

    DateTimeStamp

    RTRIM (CallSign) AS [Guide]

    RTRIM (UnitStatus) AS [UnitStatus]

    Latitude

    Longitude

    CONVERT (VARCHAR (15), DateTimeStamp, 106) AS [CurrentDate]

    CONVERT (VARCHAR (10), DateTimeStamp, 108) AS [CurrentTime]

    OF FireEMSGPSDatabase

    RIGHT OUTER JOIN

    (

    SELECT

    RTrim (CallSign) AS [Ambulance]

    MAX (DateTimeStamp) AS [MostRecentTime]

    OF HISTORY_201506

    WHERE RTRIM (CallSign) AS "LCM__".

    RTRIM GROUP (CallSign)

    )

    LIKE [MostRecent] on DateTimeStamp = MostRecent.MostRecentTime

    ORDER BY RTRIM (CallSign) CSA

    ;

    Shown below is an example of this query output;

    Call DateTimeStamp Latitude UnitStatus Longitude CurrentDate CurrentTime

    2015-06-04 17:14:17.357 LCM01 QA 26.56428 - 81.87044 June 4, 2015 17:14:17

    2015-06-04 17:14:17.357 LCM01 QA 26.56428 - 81.87044 June 4, 2015 17:14:17

    2015-06-04 17:14:18.670 LCM02 QA 26.64074 - 81.86507 June 4, 2015 17:14:18

    2015-06-04 17:14:34.420 LCM03 AR 26.64157 - 81.90973 June 4, 2015 17:14:34

    2015-06-04 17:14:20.420 LCM04 TA 26.63885 - 81.94159 June 4, 2015 17:14:20

    2015-06-04 17:14:21.297 LCM05 QA 26.4377 - 82.07806 June 4, 2015 17:14:21

    Below is my Coldfusion page with the flyer plan added in and the cfquery with cfoutput;

    <! DOCTYPE html >

    < html lang = "en" >

    < head >

    < meta http-equiv = "Content-Type" content = text/html"; Charset = UTF-8 "/ >"

    < meta name = "viewport" content = "width = device-width, original scale = 1.0" >

    " < link rel ="stylesheet"href =" http://CDN.leafletjs.com/leaflet-0.7/leaflet.CSS "/>

    " < script src =" http://CDN.leafletjs.com/leaflet-0.7.3/leaflet.js "> < / script > .

    < / head >

    < body >

    < cfquery datasource = "GPSDatabase" name = "AmbulanceLocation" >

    SELECT

    DateTimeStamp

    RTRIM (CallSign) AS [Guide]

    RTRIM (UnitStatus) AS [UnitStatus]

    Latitude

    Longitude

    CONVERT (VARCHAR (15), DateTimeStamp, 106) AS [CurrentDate]

    CONVERT (VARCHAR (10), DateTimeStamp, 108) AS [CurrentTime]

    OF FireEMSGPSDatabase

    RIGHT OUTER JOIN

    (

    SELECT

    RTrim (CallSign) AS [Ambulance]

    MAX (DateTimeStamp) AS [MostRecentTime]

    OF HISTORY_201506

    WHERE RTRIM (CallSign) AS "LCM__".

    RTRIM GROUP (CallSign)

    )

    LIKE [MostRecent] on DateTimeStamp = MostRecent.MostRecentTime

    ORDER BY RTRIM (CallSign) CSA

    < / cfquery >

    < cfoutput query = "AmbulanceLocation" >

    < table >

    < b >

    < td > #DateTimeStamp # < table >

    < td > #CallSign # < table >

    < td > #UnitStatus # < table >

    < td > #Latitude # < table >

    < td > #Longitude # < table >

    < td > #CurrentDate # < table >

    < td > #CurrentTime # < table >

    < /tr >

    < /table >

    < / cfoutput >

    < div id = ' map' > < / div >

    < script >

    var L.map = map ('plan' {Center: [26.5641867068354,-81.8704100173261], fullscreenControl: true, zoom: 12});

    L.tileLayer ('http://{s}.tile.osm.org/{z}/{x}/{y}.png').addTo(map);

    < /script >

    < / body >

    < / html >

    To sum it all up - I have a SQL Server query that retrieves the last my ambulances xy coordinates. I have a Coldfusion page that has a map of the brochure and the cfquery. My question is how to plot coordinates in a flyer plan. I can't understand the middle of the book to get the results of my query in terms of the brochure.

    In addition, it is a dynamic environment. Ambulances are constantly in motion. This page must be dynamic, so that the page can be updated to show the latest data.

    You must create the map and tile layer prior to place markers and then run your loop inside of the script tag.

    I highly recommend reading through the tutorials on the site of the brochure.  They go on these things in detail.

    Quick start - leaflet guide - a JavaScript library for the mobile environment maps

  • connection between sql server and java

    someone please tell me how to connect to sql server with java

    Welcome to the forums.

    The forums are a research tool very useful - by using the search box you will see near the top right.  You will find that most of the questions that ask you, which, have already been asked on the forum, so it pays to research frist - that way you get a faster response and you can find other interesting things.

    In this case, I did a quick search using SQL Server and found these threads that will probably help:

    http://supportforums.BlackBerry.com/T5/Java-development/database-connectivity-SQL-Server-2008/m-p/60...

    http://supportforums.BlackBerry.com/T5/Java-development/SQL-Server-connection-in-BB/m-p/416391#M8239...

  • How to load data from ms sql to the by the file rules and maxl essbase

    Hi, everybody!
    Pretty Shure the kind of topic exists already on the forum, but unfortunately can't find it.

    I want to understand, how to load data from the database to ms sql for the PB of essbase application.

    (I) so I have:
    1. a request for 'society '.
    2 and its database 'Plan '.
    3. with simple outline, which contains only two dimensions:

    -The time period < 1 > (Label only)
    -Total year (~)
    -Qtr1 (+)
    Jan (+)
    Feb (+)
    Mar (+)
    -Qtr2 (+)
    APR (+)
    May (+)
    Jun (+)

    -Accounts < 1 > (Label only)
    -Lost / based (~) (Label only)
    -Revenues (+)
    L1.1 (+)
    L1.2 (+)
    -Costs (-)
    L2.1 (+)
    L2.2 (+)

    (II) also, I created a rules file called "CO_DWH" and associated with this schema
    It (Rules file) a 3 columns:
    Data of the 'period', 'account '.

    There is also the option checked "load data".

    (III) in MS SQL Server, I have a database of "hypdb" and "essadmin" with "password" login

    (IV) I executed my bat file:
    C:\Hyperion\EssLoad.bat
    There is only one line:

    EssLoad.bat-
    startMaxl.cmd EssLoad.txt
    ----------------------------------------------

    EssLoad.txt-
    login password admin on erpserver;
    Import database data Company.Plan connect in essadmin password using the server rules_file 'CO_DWH' error abort;
    disconnection;
    "exit";
    --------------------------------------------


    All plans that I copied well worked ERP system, but I don't understand, this is exactly table in the MS SQL database, data loading to essbase db?

    TOU have to do a few things
    1. on the server of Essbase, put in place a system odbc for your MySQL database connection
    2. in the State of charge, go to the file menu and select open source SQL database and in the source of data in your SQL statement. A few tips. Where it says select, don't put in the select Word and when he says to not put in of. The system adds for you. TI enter a simple SQL statement is to do this in the box so select if your SQL would be normanlly as select * from myTable just enter the code as * from myTable in the upscale neighborhood

    The ol/recover the click and fill your connection information. Should bring back the data in the State of charge. Save the State of charge and use

Maybe you are looking for