#SAPGYAN : Create table using sap mii and inserting data into tables

Hi friends,

Today we will learn about how to create new table using sap mii and perform all the operations on the Tables. So let's start :

After opening sap mii workbench create a new sql query. select relevant database in that you want to create tables. after selecting the database you need to select the mode of the query that we want to perform on the database so for creating table we need to select "command" mode from the drop-down list. after selecting mode from the drop-down list go to the fixed query details section from tamplate category and we need to write the create table statement in the fixed query section . the statement should be look like this :
 "create table TBL_NAME( column_name1 dataType primary key, column_name2 dataType.....)";

After writing the statement when executing the statement it will show "command query successful" on panel. that mean we have successfully created table using sap mii.

After creating the table into the database if we want to modify our table using sql query then we can also perform that scenario also just need to use to Alter table statement on database. and the query should be look like this:

For Adding a new column into Table:

"Alter table TBL_NAME add column column_name dataType".

as we have perform create and modify action on table as same we can perform delete column action on table .


After creating table in database now let's talk about the inserting data into the tables.

same as creating table when we want to insert data into the table using query then we can insert data using insert statement.

for inserting single row using sql query we have to write insert statement:
"insert into TBL_NAME (column_name1,column_name2) values(value1,value2)"

this statement help us to insert a row in the table using sql query.

if we want to insert more then one row using one insert statement we can also do that using same command and query should be like this:

"insert into TBL_NAME values(value1,value2,value3),(value1,value2,value3),(value1,value2,value3)"

So that is all for crating and modifying the tables and playing with data into the table.

Thanks for reading this blog.
I will update some other interesting things we can do using sap mii.

if you have any query about this blog and related to the sql statement please comment in the comment section i will try to reply soon to you question.

Thanks,
Ankit Gupta  

Comments

  1. "insert into TBL_NAME values(value1,value2,value3),(value1,value2,value3),(value1,value2,value3)"
    For the above command how to pass the values from param.1
    I have tried and it throws error
    "
    values ([param.1],[param.2] ,[param.3])"

    ReplyDelete

Post a Comment

Popular Posts