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 9014541
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T03:32:01+00:00 2026-06-16T03:32:01+00:00

I have a table called TBL_CAS. In that, FLD_ID as auto increment column and

  • 0

I have a table called TBL_CAS. In that, FLD_ID as auto increment column and another column is called FLD_CAS_CODE. Now I need to add CAS- as a prefix to FLD_ID and Insert into FLD_CAS_CODE. I need to do this in trigger. I was tried with the below code, But the data in not inserting, What is the problem ?

CREATE OR REPLACE TRIGGER TBL_CAS_TRG
BEFORE  INSERT ON TBL_CAS
FOR EACH ROW
BEGIN
:NEW.FLD_CAS_CODE := TO_CHAR ('CAS')||'-'||:NEW.FLD_ID;
END;

I mean `”cas-“+”fld_id”=”cas-fld_id”‘

  • 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-16T03:32:03+00:00Added an answer on June 16, 2026 at 3:32 am

    which part isn’t working exactly? as your trigger seem to work just fine.

    SQL> create table TBL_CAS( FLD_ID number, FLD_CAS_CODE varchar2(20));
    
    Table created.
    
    SQL> CREATE OR REPLACE TRIGGER TBL_CAS_TRG
      2  BEFORE  INSERT ON TBL_CAS
      3  FOR EACH ROW
      4  BEGIN
      5  :NEW.FLD_CAS_CODE := TO_CHAR ('CAS')||'-'||:NEW.FLD_ID;
      6  END;
      7  /
    
    Trigger created.
    
    SQL> insert into TBL_CAS (fld_id) values (1001);
    
    1 row created.
    
    SQL> select * From TBL_CAS;
    
        FLD_ID FLD_CAS_CODE
    ---------- --------------------
          1001 CAS-1001
    
    SQL>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using mysql database. In that I have table called tbl_user I need to
I have table called Buttons. Buttons table i have column button_number . Table contain
I have a table called 'MyTable' that looks like: ID | Item | Type
I have a table called tbl_jobs that stores the meta data of some background
I have a table called tbl_rtdata. I was dropped the all partitions in that
I have created a pretty messy table that I need to clean up. This
I have table called Table A and I have created a trigger that handles
i have 1 table called tbl_Run and only 1 column called wo .the question
I have an SQL table called tbl, im trying to add the columns A,
I i have a SQL Server database table called tbl_faults . In that table

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.