Beginning SQL

Beginning SQL Beginning SQL

marjan.fesb.hr
from marjan.fesb.hr More from this publisher
20.07.2013 Views

Appendix B 422 Now you need to insert some data. You can either use the interactive screen to insert data one statement at a time, clicking Execute after each statement, or you can click the Script tab and enter all the statements at once, making sure that you put a semicolon after each. There are two records to be inserted: INSERT INTO MyTable(MyColumn) VALUES(123); INSERT INTO MyTable(MyColumn) VALUES(888); Enter the code into the Command window and click Execute. Note that you must have previously executed a CONNECT TO statement, either in the Interactive screen or in the Script screen, before you can execute SQL against the database. To see what data is in the MyTable, return to the Interactive screen and type the following SQL in the SQL entry box: SELECT * FROM MyTable Click Execute, and you should see a screen similar to what appears in Figure B-51: Figure B-51

Appendix B<br />

422<br />

Now you need to insert some data. You can either use the interactive screen to insert data one statement<br />

at a time, clicking Execute after each statement, or you can click the Script tab and enter all the statements<br />

at once, making sure that you put a semicolon after each. There are two records to be inserted:<br />

INSERT INTO MyTable(MyColumn) VALUES(123);<br />

INSERT INTO MyTable(MyColumn) VALUES(888);<br />

Enter the code into the Command window and click Execute. Note that you must have previously executed<br />

a CONNECT TO statement, either in the Interactive screen or in the Script screen, before you can<br />

execute <strong>SQL</strong> against the database.<br />

To see what data is in the MyTable, return to the Interactive screen and type the following <strong>SQL</strong> in the<br />

<strong>SQL</strong> entry box:<br />

SELECT * FROM MyTable<br />

Click Execute, and you should see a screen similar to what appears in Figure B-51:<br />

Figure B-51

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!