Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9239817
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T08:04:36+00:00 2026-06-18T08:04:36+00:00

Table a: PROTOCOL VARCHAR2(20) Table b: YEAR NUMBER(4) MONTH VARCHAR2(20) PROTOCOL VARCHAR2(20) DATE1 DATE

  • 0

Table a:

PROTOCOL      VARCHAR2(20)

Table b:

YEAR          NUMBER(4)
MONTH         VARCHAR2(20)
PROTOCOL      VARCHAR2(20)
DATE1         DATE

My procedure code:

CREATE PROCEDURE his
    @Year NUMBER(4),
    @Month VARCHAR2(20)
AS
BEGIN
    SET NOCOUNT ON;

    BEGIN TRANSACTION trninsert
        DECLARE @@date DATE
        SET @@date = sysdate;
        INSERT INTO b (Year, month, date1, protocol)
        (select @Year, @Month, @@date,* from a)
    COMMIT TRANSACTION trninsert
    END TRY
    BEGIN CATCH
        ROLLBACK TRANSACTION trninsert
    END CATCH
END

I am using plsql developer and it is showing errors in procedure.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T08:04:37+00:00Added an answer on June 18, 2026 at 8:04 am

    you’ve written this a mysql type syntax.

    oracle would be:

    CREATE PROCEDURE his(p_year  b.year%type,
                         p_month b.month%type)
    AS
    BEGIN
      INSERT INTO b (Year, month, date1, protocol)
      select p_year, p_month, sysdate, a.protocol
        from a;
      commit;
    END;
    

    though its bad form to commit in the procedure.

    eg:

    SQL> CREATE PROCEDURE his(p_year  b.year%type,
      2                       p_month b.month%type)
      3  AS
      4  BEGIN
      5    INSERT INTO b (Year, month, date1, protocol)
      6    select p_year, p_month, sysdate, a.protocol
      7      from a;
      8    commit;
      9  END;
     10  /
    
    Procedure created.
    
    SQL> insert into a values('prot a');
    
    1 row created.
    
    SQL> exec his(2012, 10)
    
    PL/SQL procedure successfully completed.
    
    SQL> select * from b;
    
          YEAR MONTH                PROTOCOL             DATE1
    ---------- -------------------- -------------------- ---------
          2012 10                   prot a               06-FEB-13
    
    SQL>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Table structure id (p) | date | id2 (fk) | id3 (fk) where (p)
Table: items Create Table: CREATE TABLE `items` ( `ite_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
table is CREATE TABLE `news` ( `id` bigint(20) NOT NULL auto_increment, `title` varchar(255) default
I have table stucture: table { `id` int(11) NOT NULL AUTO_INCREMENT, `content_type`, `protocol`, `content_id`,
I am working on a code in C#.NET to create a web service that
I have a table with a 'call open date' column (actual_log_date) which I convert,
I'm using sqlite with python. I'm implementing the POP3 protocol. I have a table
From Signed Types on Encoding - Protocol Buffers - Google Code : ZigZag encoding
I wish to create an abstraction which represents a database table, but which can
I am running the following queries against a database: CREATE TEMPORARY TABLE med_error_third_party_tmp SELECT

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.