469,923 Members | 1,745 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,923 developers. It's quick & easy.

using a constant field

Hi Planet!

I have created a table (see test script below)

I have an Id field that will contains numerical values.
For reason behond my control This field has to have a
constant hard coded letter V in front of it.

V4789
V0023
ect...

Is there a way know to man kind to do this and
avoid storing 100 000 letter V for nothing...
And maybe keep a INT type rather than it becoming
VARCHAR or CHAR.

thanks for your help.
CREATE DATABASE JK_PROD;
USE JK_PROD;

CREATE TABLE VOUCHERS (
Id INT(8),
Marketing_Code VARCHAR(15),
Date_Created DATETIME,
Date_Used DATETIME,
Account_Nb VARCHAR(10) NOT NULL,

PRIMARY KEY(Id)
);

CREATE UNIQUE INDEX IDX_VOUCHERS ON VOUCHERS (Id);
INSERT INTO VOUCHERS VALUES
('','mrk code 1','2004-01-01','2004-01-02','AC01');
INSERT INTO VOUCHERS VALUES
('','mrk code 2','2004-01-01','2004-01-02','AC02');
INSERT INTO VOUCHERS VALUES
('','mrk code 3','2004-01-01','2004-01-02','AC03');
Jul 19 '05 #1
0 1399

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Fred | last post: by
5 posts views Thread by Roger Leigh | last post: by
3 posts views Thread by Random Person | last post: by
2 posts views Thread by Johm | last post: by
1 post views Thread by Daveyk0 | last post: by
5 posts views Thread by Paul E Collins | last post: by
13 posts views Thread by Kantha | last post: by
65 posts views Thread by Arjen | last post: by
7 posts views Thread by John Koleszar | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.