|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
Help with SQL
Hi, can someone please help me with the following.
Say this was my code: CREATE TABLE person ( name VARCHAR2(30), dob DATE ); First question. How do I make everything entered into the name field UPPERCASE? secondly, how would I insert a date using the following code: INSERT INTO person VALUES ('mike', '1987-03-17'); This format results in an error! thanks for all your help. Adam |
|
#2
|
||||
|
||||
|
First answer: with a trigger, if your mysql version supports them, but I'd not bother about this and simply convert everything to uppercase when retrieving
Second one: check the manual for the proper date format
__________________
My blog about OpenSource Databases PDF tutorials about OSS databases, DBMonster ... Please contribute to Open Source Development, fill bug reports!!! Developer Shed eSupport Commented my.ini/my.cnf (PLEASE ADD YOUR OWN CONFIG TRICK) An introduction to database normalization Natural or Surrogate key Custom ordering for your results Correlated and uncorrelated subqueries Don't turn your outer joins into inner joins |
|
#3
|
||||
|
||||
|
Quote:
are you sure you are running mysql? mysql doesn't support VARCHAR2, so i don't think you would have been able to create that table |
|
#4
|
|||
|
|||
|
INSERT INTO person VALUES
('mike', '1987-03-17'); Quote:
|
|
#5
|
|||
|
|||
|
I am using varchar2 so maybe not mysql? what version of SQL would it be?
Also, how do i create a composit key? This results in errors: CREATE TABLE person ( name VARCHAR2(30), phone char(11) PRIMARY KEY (name, phone) ); thanks again. |
|
#6
|
||||
|
||||
|
First of all confirm if you are on mysql or another database
|
|
#7
|
|||
|
|||
|
It must not be, it's called iSQL *plus
Which forum do I post in? Is it MS SQL? thanks |
|
#8
|
||||
|
||||
|
Google would tell you that iSQL*plus is for Oracle (read more here , ask a mod to move this thread there.
Then read about oracle's to_date() |
|
#9
|
|||
|
|||
|
isql is come with oracle and it is being use in the oracle enterprise manager web environment. Most of the time dba will just turn that service off to save some resources since most dba are comfortable using just sqlplus.
![]() |
![]() |
| Viewing: Dev Shed Forums > Databases > Oracle Development > Help with SQL |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|