473,320 Members | 1,841 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,320 software developers and data experts.

inserted values required with the given format

Here is a table structure :

Column Type Type
name schema name Length Scale Nulls

EMPNO SYSIBM INTEGER 4 0 Yes

ENAME SYSIBM CHARACTER 20 0 Yes

CNTY_VISITED SYSIBM CHARACTER 100 0 Yes

Now goes the prob.....

I want to insert a row in the table such that the data in the table shud look as :

EMPNO ENAME CNTY_VISITED
1001 JACK 'IND','JPN'

I guess you understood the req. It should not be IND,JPN.. It should be ' IND ' , ' JPN '
in the table.
Aug 1 '07 #1
2 1354
r035198x
13,262 8TB
Here is a table structure :

Column Type Type
name schema name Length Scale Nulls

EMPNO SYSIBM INTEGER 4 0 Yes

ENAME SYSIBM CHARACTER 20 0 Yes

CNTY_VISITED SYSIBM CHARACTER 100 0 Yes

Now goes the prob.....

I want to insert a row in the table such that the data in the table shud look as :

EMPNO ENAME CNTY_VISITED
1001 JACK 'IND','JPN'

I guess you understood the req. It should not be IND,JPN.. It should be ' IND ' , ' JPN '
in the table.
The basic structure of an insert statement is
Expand|Select|Wrap|Line Numbers
  1. insert into schema.tableName(col1, col2) values (val1, val2)
Edit: and if you want to concatenate two strings s1 and s2, you can use the concat function as explained here.
Aug 1 '07 #2
create table EMP_VISITS(EMPNO INT,
ENAME CHAR(20),
CNTY_VISITED CHAR(100));

insert into EMP_VISITS
values (1001, 'JACK', '''IND'',''JPN''');

Not that each single quote within the string needs to be doubled. i.e.two single quote characters.
Aug 1 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Miran Kopmajer | last post by:
I have a problem with blank line inserted. Please help! This is how my SQL report looks like ACCEPT vf CHAR PROMPT "Vrsta fakture: " ACCEPT fk CHAR PROMPT...
0
by: pathisunil | last post by:
Dear All I have an xmldocument which is as formed below. It is a bit of loopy in nature. can anyone kindly let me know how can i write a xslt which would take a parameter which is an...
3
by: Brian Foree | last post by:
I am developing an ASP.NET application that uses Access 2000 as its backend, and have just started getting the following error on 2 ASP.NET pages that had been working until late last week (and I...
5
by: Graham | last post by:
I have created a custom MembershipProvider called "LassieMembershipProvider" that derives from "MembershipProvider". This providor is located in a Businesslogic layer dll called...
3
by: Steve Weixel | last post by:
I'm having problems getting dates to format the way that I need them to. The problem is that I'm used to the VB6 way of doing things, with which the statement Format(37866, "dd MMM yyyy") would...
20
by: MLH | last post by:
120 MyString = "How many copies of each letter do you need?" 150 MyVariant = InputBox(MyString, "How Many?", "3") If MyVariant = "2" Then MsgBox "MyVariant equals the string '2'" If...
11
by: serge | last post by:
When i debug a trigger is it possible to add a WATCH on the INSERTED or DELETED? I think not, at least I couldn't figure out a way to do so. Does someone have a suggestion on how I can see the...
8
by: ibiza | last post by:
Hi SQL fans, I realized that I often encounter the same situation in a relation database context, where I really don't know what to do. Here is an example, where I have 2 tables as follow: ...
14
by: cody | last post by:
I got a similar idea a couple of months ago, but now this one will require no change to the clr, is relatively easy to implement and would be a great addition to C# 3.0 :) so here we go.. To...
9
Catalyst159
by: Catalyst159 | last post by:
I have a form which is used to calculate residential Floor Area Ratio (FAR). The form is structured into seven parts as follows: Part A: Maximum FAR and Floor Area: Part B: Gross Floor Area of...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.