Hi All,
Not sure what I'm doing wrong here, since I believe it mimics examples in IBM docs. Somewhat baffling because same basic syntaxes are working with MySQL.
So I think I just need someone to look over my shoulder and tell me what mistake I'm making.... that I'm blind to. (LOL!)
I have a table defined as follows :
CREATE TABLE CONTACTS (id INT NOT NULL PRIMARY KEY GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1), account varchar(50), actprimary varchar(44), phone varchar(14), email varchar(100));
Confirmed :
db2 => DESCRIBE TABLE FLMASON.CONTACTS
Data type Column
Column name schema Data type name Length Scale Nulls
------------------------------- --------- ------------------- ---------- ----- ------
ID SYSIBM INTEGER 4 0 No
ACCOUNT SYSIBM VARCHAR 50 0 Yes
ACTPRIMARY SYSIBM VARCHAR 44 0 Yes
PHONE SYSIBM VARCHAR 14 0 Yes
EMAIL SYSIBM VARCHAR 100 0 Yes
Using the following SQL a the db2 CLI interface I get the listed error. I've probably tried 100 combinations of quotes, double quotes, etc... no idea why it's complaining...
db2 => INSERT INTO CONTACTS (ACCOUNT, ACTPRIMARY, PHONE, EMAIL) VALUES ('IGA', 'Frank Mason', '1-949-243-1501', 'fmason@us.ibm.com');
DB21034E The command was processed as an SQL statement because it was not a
valid Command Line Processor command. During SQL processing it returned:
SQL0103N The numeric literal "1501'" is not valid. SQLSTATE=42604
db2 =>
So if the mistake jumps out at anyone, I'd surely appreciate the tip.
------------------------------
Frank Mason
fmason@us.ibm.com------------------------------
#Db2