473,385 Members | 1,641 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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 1511

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Fred | last post by:
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...
5
by: Roger Leigh | last post by:
I've written a simple container template class to contain a single value. This emits a signal when the value is changed (it's used as a notifier of changes), and listeners can connect to its...
3
by: Random Person | last post by:
Does anyone know how to use VBA to relink tables between two MS Access databases? We have two databases, one with VBA code and the other with data tables. The tables are referenced by linked...
2
by: Johm | last post by:
Can i use a constant in a query ? I have a constant Public Const rate As Double = 10 Can i use it in the query ? I want to multiply the field with the constant rate, but Access does not accept...
11
by: Grasshopper | last post by:
Hi, I am automating Access reports to PDF using PDF Writer 6.0. I've created a DTS package to run the reports and schedule a job to run this DTS package. If I PC Anywhere into the server on...
1
by: Daveyk0 | last post by:
Hello there, I have a front end database that I have recently made very many changes to to allow off-line use. I keep copies of the databases on my hard drive and link to them rather than the...
5
by: Paul E Collins | last post by:
I have a class hierarchy representing data importers, each of which reads lines from a particular type of comma-separated data file and creates corresponding entries in a database. There is an...
13
by: Kantha | last post by:
Hi all, I have declared an Union as follows typedef union { struct interrupt_bits { unsigned char c_int_hs_fs_status : 1, c_setup_intflag : 1,
65
by: Arjen | last post by:
Hi, Form a performance perspective, is it wise to use the ref statement as much as possible? Thanks! Arjen
7
by: John Koleszar | last post by:
Hi all, I'm porting some code that provides compile-time assertions from one compiler to another and ran across what I believe to be compliant code that won't compile using the new compiler. Not...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.