About pl/sql remove

hi,
I have a table product_group_t include two columns product_group_index and product_group.Now I add the procedure in order to remove the product_group from product_group_t.I don't know how to do.And I am not clear to use procedure or function.product_group_index is the trigger so delete product_group won't effect it.
Thanks for your help!
jing

You have to use "alter table xxx drop column" command. To run this from pl/sql code you must use dynamic sql:
execute immediate 'alter table .....';

Similar Messages

  • [ask] about oracle sql injection and escalation

    Hello,i'm student , i'm studying oracle,now i want to research about oracle sql injection,i had read some tuttorial such as *'Hacking Oracle From Web,Advanced SQL Injection In Oracle Databases,Oracle Hacker HandBook ...'* but when i try to demo on localserver (11.0.1.6) but not run,and this is my demo
    -- first,i created table users
    create table users (name nvarchar2(50),pass nvarchar2(50))
    -- then i created procedure with system user
    create or replace procedure system.adduser(u nvarchar2,p nvarchar2)
    as
    begin
      insert into users values(u,p);
    end;
    -- grant execute privilege to oc user
    grant execute on adduser to oc
    -- login with user oc and create a procedure
    create or replace procedure sqli
    as
    begin
      execute immediate 'grant dba to oc';
    end;
    -- and then,i run system's procedure
    declare
    begin
      system.adduser('admin','admin'' ; execute immediate  ''declare begin sqli() end;');
    end;
    i hope oracle master help me to i can understand and improving my knowledge
    Thanks

    The best forum for this is probably Forum Home » Java » SQLJ/JDBC
    Presumably you are refering to oracle.sql.TIMESTAMP. While this is intended to (and does) correspond to java.sql.Timestamp it can't be a subclass because it needs to be a subclass of oracle.sql.Datum.

  • Meaning about PL/SQL

    HI All,
    I have some question about PL/SQL Collection like Associative Arrarys is like
    Single Dimension
    Unbounded
    Homogeneous
    Can I know the meaning for above terms I may think about Unbounded and Bounded it's like
    Associative Arrays have much space at runtime where
    Arrays are bounded like CHAR data type I will have limited space correct me if I am wrong. Give some example for between understand.

    1007945 wrote:
    HI All,
    I have some question about PL/SQL Collection like Associative Arrarys is like
    Single Dimension
    Unbounded
    Homogeneous
    Can I know the meaning for above terms I may think about Unbounded and Bounded it's like
    Associative Arrays have much space at runtime where
    Arrays are bounded like CHAR data type I will have limited space correct me if I am wrong. Give some example for between understand.
    An associative array is a name-value pair. And is of very little use in 99% of general PL/SQL programming.
    Such arrays are one dimensional. You reference the array with a single index value - unlike a 2D (standard non-associative) array where each cell in the array is referenced by an index pair (x,y) for example.
    Associative arrays are also homogeneous - it only supports native scalar types (e.g. string, number, date).
    And associative arrays are unbounded. You do not place a limit with the definition of the type, on the number of cells it can hold (unlike a VArray type definition for example).
    Associative arrays are largely useless in the PL/SQL environment. It is a specialised form of an array. And within PL/SQL and database context, dealing with name-value pairs in a non-scalable program language structure (as oppose to a SQL based table structure) raises all kinds of questions.
    Which is also why the majority of PL/SQL  code and samples and examples using associative arrays are wrong.

  • About Oracle SQL Certification Details

    Hi All,
    I want to Details About Oracle SQL Certification. How many Type and what are there.
    Thanks & Regards

    You will get better answers in the [Oracle Certification Forum|http://forums.oracle.com/forums/forum.jspa?forumID=459]
    Thanks,
    Karthick.

  • Difference about the SQL Statement

    Hi,
    I have a doubt, It in one of my application i wrote a select query like this
    sql> select * from quartz;
    but my DBA told me not to use the *(star), instead he told me to use the column names. when i asked him, he said there will be performance issues.
    Now my question is can u explain me the difference.
    Thanks in advance,
    Siva

    Did the DBA explain what performance issue he was concerned about? Obviously, Oracle has an extra step to resolve the * to the appropriate column list, but this is likely to be an imperceptibly small portion of the time required to execute the query.
    In an actual application, you would normally want to explicitly list column names so that your code isn't affected when new columns are added to the tables.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • Question about PL/SQL Function in report

    Hi all. I have a (basic) question about using a PL/SQL function in a report. In my report page I have an item (PL/SQL function) that has the following syntax:
    return username from t1
    where username like 'Le%'
    I reference this item in an email process. Ideally this function would return all usernames that begin with 'Le' in the drafted email; however, its not looping so I'm only getting a return on the first name.
    I have a few books on PL/SQL but I'm not exactly sure where to start - I imagine there is a loop process I need to integrate into the function but, like I said, I'm not sure.
    I would have posted this to the PL/SQL forum but also wanted some feedback on whether or not using this method is the best way forward. Essentially I have a table with usernames and just want to send email messages based on some simple logic.
    Thanks!
    Len

    Hi Sergio,
    First, it's an honor to have you reply to my post. Thanks!
    To be more specific,
    T1 is a table containing the results from a user security scan. Username is a column in this table containing user names. What I have done is create a page in HTML DB with the following elements:
    1. An 'Item' containing the PL/SQL function that is hidden. The purpose of this Item is to generate information from T1 that meets the simple logic parameters - in this case, the user names that begin with "Le". I have called this Item P145_TT
    2. A 'Process' containing references to HTMLDB_MAIL. The 'Process' looks similar to this:
    HTMLDB_MAIL.SEND(
    P_TO => '[email protected]',
    P_FROM => 'Anon Email Account',
    P_BODY => 'Note: This message was automatically generated. Do not attempt to reply to this email.
    These are the users that begin with Le: '||:P145_TT||' ',
    P_SUBJ => 'Summary');
    3. A 'Button' to submit the process and (hopefully) send the message containing all users that adhere to the logic in the function.
    4. If I use 'return username from t1...' I will get a username generated, but like I said previously, it only gives me the first and does not loop.

  • About PL/SQL usage!!!

    Where do I use PL/SQL procedures for example? Do I put the calls to them in java methods?

    There is no simple answer to such a simple question.
    When I analyze your question I think that you are struggeling with an application architecture matter. Basically, the first answer that springs to mind would be:
    - You should use PL/SQL when you have to implement functionality that is databound.
    In other words: when your process is about manipulating data rather than doing complex arithmetic, you should use PL/SQL.
    When it comes to the question on how to integrate the PL/SQL code with the other components that make up your information system, than the question is raised what type of information system you are building and what the infrastructure is on which it will be running.....
    In all cases, please realise that PL/SQL code is running in the database tier of your application infrastructure!!!
    Hope this helps...
    Message was edited by:
    Toine

  • Mp3tubetoolbar search won't go away; how do I get rid of it beyond about:config, regedit, remove programs?

    I keep getting mp3tubetoolbar search as the main search engine. I uninstalled yahoo toolbar, reset keyword.url in about:config, removed any mention of mp3tube in regedit. Still getting the same hijacked search engine.

    Hi nervoussturgeon,
    You should take a look at the Knowledge Base article [[How to set the home page]]. Just out of curiosity, what website is it? Your homepage might have been changed by a particular site. Sites like MSN, Yahoo, etc have been know to ask to become your homepage.
    There are steps in that article to reset your homepage preferences to default. I would try that first to clear out any strangeness. If that works, you can try setting your homepage again to your personal preference.
    If that doesn't work you should look at the article [http://kb.mozillazine.org/Preferences_not_saved Preferences not saved].
    Finally, your issue may be because you've been hit with some [https://support.mozilla.org/en-US/kb/Is%20my%20Firefox%20problem%20a%20result%20of%20malware?s=malware&r=0&e=sph&as=s#w_how-do-i-get-rid-of-malware Malware].
    Hopefully this helps!

  • A problem about Ms Sql 7 - Oracle 8.1.5 ?

    hi
    I used OMWB to migrate MS sql 7 to Oracle 8.1.5, both of our env are on chinese character set,it worked well. Thank OMWB work team. The whole process of migration did't meet any problem. But I met a problem about character set,I don't see right content on CLOB column,all data in CLOB columns are like the following something :
    0F5C3A53A44E1A904575BE8FBF4F776302303052FD56388D01303100380006529F943052B065164E
    I maped text datatype of SQL to CLOB datatype,I can see the right data directly in SQL by select command,but I can't see the right data in SQL*PLUS.
    How can I do? Migration workbanch don't support the multi-bit char set such as chinese?
    null

    I already knew the solution of the problem,but I met another problem.
    I checked my sql 7 database again, I found large columns are ntext datatype. I changed the ntext to text and migrated data again. In SQL*PLUS ,I found the data of clob columns change to '????.?-?'. I know this is caused by NLS_LANG, my NLS_LANG=simplified chinese_china.zhs16gbk. How do i set my nls_lang to get the right data?
    null

  • How to use about:config to REMOVE Delta Search from my new tab

    I am desperate to remove Delta Search from my new tab page. What do I do after I open about:config? I have done at least a dozen resets, have removed DS via add/remove, am running a virus scan at present...this is TERRIBLE, and there HAS to be a way to get rid of it. When I do a reset, the new tab page is what I WANT...my previously saved pages. However, when I CLOSE FF and reopen, the new page is, once again, Delta. Can you hear me SCREAM? Can you see my TEARS? I am really fed up. Thanks for getting back to me with a solution that WORKS. jo

    Why should we have to do this? I ticked the box that said I didn't want to install it. You, Delta Search, are a bunch of troublesome low lifes.

  • Another MySQL question about averages. Remove outliers.

    I have a number of observations that I can get from a MySQL database.
    Let's assume the values I have are, ordered ascending:
    3, 5, 5, 6, 6, 6, 8, 9, 15.
    Just calculating the AVG results in 63/9 = 7.00
    If I want to repeat that but leave out both the minimum and the maximum values, in this case both the 3 and the 15, giving the following list:
    5, 5, 6, 6, 6, 8, 9
    then the average is only 45/7 =  6.43 to gain more statistical accuracy, how do I need to modify my query?
    Currently the query is like this:
    $query_Recordset1 = 'SELECT COUNT(Graphics_card) AS Obs, Graphics_card, AVG(MPE_Off/MPE_On) AS Gain , AVG(MPE_On) AS Speed FROM `Personal_data` WHERE MPE_On >0 GROUP BY Graphics_card HAVING COUNT(Graphics_card) > 4 ORDER BY Speed ASC, Obs DESC, Gain DESC LIMIT 0, 20' ;
    In this query the minimum number of observations is 5 for each distinct 'Graphics_card'. In the future I may change that to another figure and that is easy, just change the bold 4 to another figure but then, I may want to recalculate the adjusted average by leaving out the two bottom observations and the two top observations, so the range in the calculation would look like this:
    5, 6, 6, 6, 8
    and then the adjusted average is only 31/5 = 6.20
    How do I need to adjust my query to achieve that?
    Or, to put it another way, how can I first exclude the top X and bottom X observations from the query and only then calculate the AVG?
    Here is the page I want to apply it to: http://ppbm5.com/MPE%20Charts.php

    I solved it for the first part like this:
    SELECT COUNT(Graphics_card) AS Obs, Graphics_card, (SUM(MPE_On) - MAX(MPE_On))/(COUNT(Graphics_card)-1) AS Speed, (SUM(MPE_Off/MPE_On) - MIN(MPE_Off/MPE_On))/(COUNT(Graphics_card)-1) AS Gain FROM `Personal_data` WHERE MPE_On >0 GROUP BY Graphics_card HAVING COUNT(Graphics_card) > 5 ORDER BY Speed ASC LIMIT 0, 20
    This effectively removes the most significant outlier (MAX for Speed and MIN for Gain) and calculates the average based on the number of observations minus 1 for each category. In the same way I could remove the outlier at the other side of the spectrum, MIN for Speed and MAX for Gain, but then reduce the number of observations by 2 instead of 1.
    SELECT COUNT(Graphics_card) AS Obs, Graphics_card, (SUM(MPE_On) - MAX(MPE_On) - MIN(MPE_On))/(COUNT(Graphics_card)-2) AS Speed, (SUM(MPE_Off/MPE_On) - MIN(MPE_Off/MPE_On) - MAX(MPE_Off/MPE_On))/(COUNT(Graphics_card)-2) AS Gain FROM `Personal_data` WHERE MPE_On >0 GROUP BY Graphics_card HAVING COUNT(Graphics_card) > 5 ORDER BY Speed ASC LIMIT 0, 20
    I struggled with the Group function to use the suggestions in the link you gave me and of course the different functionality between MySQL and Oracle SQL.
    I look forward to having a MEDIAN function in MySQL.

  • About embedded SQL in J2ME

    Hi There...
    I am working with the Database project in J2ME.So that i have used java.sql.
    But after build the project J2ME wireless toolkit shows the error that package java.sql.* does not exist.
    Following is the code...
    import java.sql.*;
    public class ModelMIDlet
    private Connection Database;
    private Statement DataRequest;
    public ModelMIDlet()
    String url="jdbc:odbc:CustomerInformation";
    String uid="umesh";
    Stirng password="umeshD";
    try
    }catch(ClassNotFoundException er)
    System.err.println("Unable to load the JDBC/ODBC bridge" +er);
    System.exit(1);
    catch(SQLException er)
    System.err.println("Cannot connect to the database" +er);
    if(Database!=null)
    try
    Database.close();
    }catch(Exception e){}
    System.exit(2);
    try
    {}catch(SQLException er)
    System.err.println("SQL error" +er);
    if(Database!=null)
    try
    Database.close();
    catch(Exception ex){}
    System.exit(3);
    if(Database!=null)
    try
    Database.close();
    catch(SQLException er){}
    public static void main(String args[])
    final ModelMIDlet sql1=new ModelMIDlet();
    System.exit(0);
    error:package java.sql does not exist
    So please give me a guidence.
    also give info about database handling.

    You can't use any JDBC driver to communicate your J2ME application with the Apache or any database on the server side. What maximum you can do is :
    1. Create a Web Service and use it over GPRS to get connencted to your Apache.
    Or,
    2. Create JSP and call it by creating HttpConnection from the J2ME client over GPRS and start talking to your Tomcat.
    Shan!!!

  • Help! problem about jstl sql with "LIKE?" in query

    Hi All,
    I have a problem about getting data by using "LIKE" in my sql statment.
    here is my case:
    <sql:query var="tmp">
    SELECT ...... FROM ...
    WHERE a LIKE ?
    <sql:param value="%${param.a}%"/>
    </sql:query>
    Once I used "LIKE" keyword, the query failed to use this critica.
    and couldn't find any match cases
    thx or help
    Micheal

    besides, i found that:
    this works:
    "AND a.block LIKE '%' + 'a' + '%'"
    but these don't work:
    "AND a.block LIKE '%' + 'a' + '' + '%'"
    or
    "AND a.block LIKE '' + '%' + 'cp' + '%'"
    or
    "AND a.block LIKE '%' + 'cp' + '%' + ''"
    it seems '' is the casue of error... so strange, anyone has idea?
    micheal

  • Experience about resource consumption about migration SQL- server to MaxDB

    Hi,
    Has somebody experience about migration MS SQL server (running under MS Windows) to MaxDB (Linux). Right now DB size is 2TB and SAP system is used about 1000 SAP users. I need information how cpu- and memory- consumption will change. Otherwise which requirements have to make for target database especially SAPS and hardware design. 
    Mit freundlichen Grüssen
    Andreas Sartor

    Check
    https://www.sdn.sap.com/irj/sdn/maxdb
    --> "Ensuring a Successful Database Migration to SAP MaxDB"
    I would book that service.
    The people doing that have lots of experience in diagnosing possible problems before the migration and will give you a lot of useful tips.
    Markus

  • Get message about SD Card Removed

    I continually receive a message about my SD card being removed. When looking in phone storage the SD card info shows as unavailable. The card is good and can be read in windows without any trouble, but the phone keeps throwing that message alert at times. To stop it i remove the SD card and battery then it goes away for a day or two. Running version 2.3.4 of Android. Any ideas on what can be done to resolve this?

        brett22 - SD cards can be tricky, but they should never do a disappearing act from your phone, where it says it is unavailable. The direct cause could honestly be anything. My recommendation would be since your pc/laptop can read your card properly, I would first backup your SD card's content in your pc's hard drive. Next, I would place the card back in your phone in order to erase the card. This can be performed by going to Settings>SD & Phone Storage>Erase SD Card (You may need to unmount the card if the SD card was instantly mounted, in order to erase its contents.)
    From there, I would connect it back to your computer in order to copy your content back to your SD card. Once you complete the transfer, place it back in your phone, and see how it performs now.
    You shouldn't have to, but if it does not mount automatically, simply go back to SD & Phone Storage to mount the card.
    Please keep us posted with regards to this issue, and if this successfully resolved your issue. Thank you brett22, we look forward to working with you.
    NicandroN_VZW
    Follow us on Twitter @vzwsupport

Maybe you are looking for