help please


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting help please
# 1  
Old 08-19-2011
help please

Code:
#!/bin/bash

mysql -hlocalhost -uroot -p  << EOF

CREATE DATABASE PROJECTS;

SHOW DATABASES;

USE PROJECTS;

CREATE TABLE PROJECT1 (
empNO INTEGER UNSIGNED, projectID INTEGER UNSIGNED, projectName VARCHAR(100), budget INTEGER UNSIGNED,
PRIMARY KEY (empNO));
INSERT INTO PROJECT1 (empNO, projectID, projectName, budget) VALUES ("15", "1", "Interface Design", "10000");
SELECT * FROM PROJECT1;

the output should show a diagram with relevert info:
Code:
empNO                               projectID                                          projectName                                                budget
   15                                                    1                                                            interface design                                   10000
   17                                        2                                           e-commerce solution                 20000
   19                                        3                                           advertising                                 30000
   21                                        4                                           administrators                           40000


Last edited by Scott; 08-19-2011 at 09:25 AM.. Reason: Code tags
# 2  
Old 08-19-2011
You made 2 mistakes at least. Read about "here documents" in the section about Unix shells: http://en.wikipedia.org/wiki/Here_document

Last edited by yazu; 08-19-2011 at 08:56 AM..
This User Gave Thanks to yazu For This Post:
# 3  
Old 08-19-2011
one more mistake, don't use irrelevant thread name

The UNIX and Linux Forums - Forum Rules (read the rule # 11 )
Login or Register to Ask a Question

Previous Thread | Next Thread
Login or Register to Ask a Question