Thursday 8 February 2018

SAP HANA: Insert into with Select Statement


Example 1:
To insert a record for a Particular Columns in a table:

Code:
INSERT INTO "KABIL_PRACTICE"."PROC_TEST" ("ID","NAME") (SELECT 1,'KABIL' FROM DUMMY);

Example 2:
To insert a record in a table:

Code:
INSERT INTO "KABIL_PRACTICE"."PROC_TEST" (SELECT 1,'KABIL' FROM DUMMY);

INSERT INTO "KABIL_PRACTICE"."PROC_TEST" SELECT 1,'KABIL' FROM DUMMY;

Example 3:
To insert a record in a table with some Calculations:

Code:
INSERT INTO "KABIL_PRACTICE"."PROC_TEST" VALUES (1, TO_CHAR(ADD_DAYS(CURRENT_DATE,1)));

Thanks For Visiting My Blog...
Share your comments...

5 comments:

  1. it would be good if u explain with actual output with explanation...its hard to understand for the new learner...thanks in advance

    ReplyDelete
  2. HI, Thanks for posting your blog. This blog is used to me. For more information please visit.
    SAP S4 HANA Training Institutes in AMeerpet

    ReplyDelete
  3. The above post is provided with Nice info!iyour post made me inspired and encourage to people to share this type of posts. thank u. SAP HANA Online

    ReplyDelete
  4. How to get insert script offof a table for existing data in SAP hana

    ReplyDelete
  5. Thank you for your post. This is excellent information. It is amazing and wonderful to visit your site. And I would like to share some information about virtue solutions. www.virtuesolutionsonline.com

    ReplyDelete