Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

PL/SQL Trigger Issue.

M.broOct 31 2018 — edited Oct 31 2018

Hi All,

I am using 11g Database. I writing the trigger in 3 different tables.

Example Table Name : Table_TRG_1   ,  Table_TRG_2 , Table_TRG_3

Trigger Name : TRG_Table_TRG_1,  TRG_Table_TRG_2, TRG_Table_TRG_3

                                

Examples : Table_TRG_1   -- Insert new records in Table_TRG_1 trigger will fire and insert into the value to Table_TRG_2. (Trigger Name TRG_Table_TRG_1)

Table_TRG_2 --- If insert the new records in this table trigger will fire based on the condition update the few other fields.  (Trigger Name : TRG_Table_TRG_2).

Table_TRG_3 --- If some field will update in Table_TRG_2 then record should be deleted in Table_TRG_2 and move it Table_TRG_3.

I am mutating error will occurred. It should be table there is no view and there is like chain process (Automation  process.)

Note : Table_TRG_2 Some time insert the new or some time update the particular field then i will raised the trigger :TRG_Table_TRG_2

thanks & Regards

M.Bro.

Message was edited by: M.bro

Comments

890764
Here are a couple of connection string used to connect to Oracle. http://www.connectionstrings.com/oracle See if this will solve your problem. I think the first one will work for you.

*[url http://www.java-forums.org/blogs/advanced-java/collection/]Java collection*
user13328581
that didnt work...
user13328581
OK i am a little progress, now the only error is connection is not open unfortunately
  DataTable emptable = new DataTable();
        string oradb = "Data Source = (DESCRIPTION ="
    + "(ADDRESS_LIST=(ADDRESS = (PROTOCOL = TCP)(HOST = olisa-VAIO)(PORT = 1521)))"
    + "(CONNECT_DATA= (SERVER = DEDICATED)(SERVICE_NAME = XE)));"
    + "User Id = finance; Password=financecc;";
        OracleConnection conn = new OracleConnection(oradb);
        conn.Open();
        string sql = "select ID, Create_date from t_mobile";
        OracleCommand cmd = new OracleCommand(sql, conn);
        cmd.CommandType = CommandType.Text;
        emptable.Load(cmd.ExecuteReader());
        GridView1.DataSource = emptable;
        GridView1.DataBind();

        conn.Close();
        conn.Dispose();
Edited by: user13328581 on Oct 5, 2011 5:59 PM
890764
Can you please provide the error log? Thanks.
user13328581
i get the following error, ORA-6413: Connection not open.
890764
Are you sure all the Parameters are OK?
To make sure of that, if you use SQL Developer, right click on your connection (assuming you have one that works), then select TNS as Connection Type, then click Connection Identifier to enable the text-field, and copy the connection string from there.

PS: Make sure there is no firewall that might block your connection, or the database accepts remote connections.
user13328581
i am using sql plus unfortunately, how do you apply such a check in sql plus
890764
I really don't know that, as I worked with it just a little, but use the same settings as you used when you set it up, or ask the one who did if it weren't you. Or there is anyone else here who knows how to do it. :)
user13328581
I use pl/sql developer at work and my connections works fine there but i am trying to use a free sql tool which is sql*plus and things arent just working and i am trying to figure out why
890764
Can you post the connection settings from you sql developer? (nothing confidential - you can mask the user/pass/host) as I need to see what type it is.
user13328581
where am I going to get that information from or what exactly do you mean?
user13328581
I finally got it working all...here is the simple solutions. First and foremorst, make sure you are using the right various of sql*plus because I noticed for visual studio 2010 express, it is only compatible with Oracle Database Express Edition 11g Release 2, don't know why but I tired oracle 10g and that didnt work. Oracle Database Express Edition 11g Release 2 can be found at the following link below.

http://www.oracle.com/technetwork/database/express-edition/downloads/index.html

the next step is to download the right drivers to establish the connection which can found at the following link below

http://www.oracle.com/technetwork/developer-tools/visual-studio/downloads/index.html and the name of the driver is ODAC 11.2 Release 3 (11.2.0.2.1) with Oracle Developer Tools for Visual Studio. That is the right driver for oracle 11g for asp.net 4.0.

Once the driver has been downloaded, it is time to write a simple program. An example is shown below
protected void Button1_Click(object sender, EventArgs e)
    {
       DataTable emptable = new DataTable();
       string oradb = "Data Source=(DESCRIPTION ="
        + "(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=olisa-VAIO)(PORT=1521)))"
        + "(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=XE)));"
        + "User Id = finance; Password=financecc;";
       OracleConnection conn = new OracleConnection(oradb);
       conn.Open();
       string sql = "select ID, Create_date from t_mobile";
       OracleCommand cmd = new OracleCommand(sql, conn);
       cmd.CommandType = CommandType.Text;
       emptable.Load(cmd.ExecuteReader());
       GridView1.DataSource = emptable;
       GridView1.DataBind();

       conn.Close();
       conn.Dispose();

    }
notice that you will need the right oracle .dll to establish the connection, this can be done by adding a reference, in the reference section click on browser and navigate to the following directory to add the oracle.dataaccess.dll. the path is %ORACLE_HOME%\odp.net\bin\<version>\Oracle.DataAccess.dll and you should be set to go. Notice, you are doing it this way because there is currently a bug with the latest driver.

Edited by: user13328581 on Nov 2, 2011 11:17 AM
1 - 12

Post Details

Added on Oct 31 2018
5 comments
182 views