× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



First, do not limit your knowledge of SQL to that you may glean from the prompting in STRSQL. It's ok for the most basic simple stuff but even that is a crutch which never lets you see the full potential of your legs. In fact, I strongly recommend ditching STRSQL and using "Run SQL Scripts" available at https://www.ibm.com/support/docview.wss?uid=isg3T1026805
as part of "IBM i Access Client Solutions". You will lose the prompting but you will gain a ton of examples available with "insert from examples"

Buy a book on SQL. I have an outdated version of "SQL/400 Developer's Guide". I still refer to it though.

In addition to that, or as an alternative, use the Knowledge Center. Start here:
https://www.ibm.com/support/knowledgecenter/ssw_ibm_i_73/db2/rbafzintro.htm
Look under Statements for "ALTER TABLE" You will use this to make your change.

There is also an easy way to see the SQL DDL source used to create your table. If you've downloaded "IBM i Access Client Solutions" as directed above there is a feature in the main screen to "Generate SQL". Also if you search the Knowledge Center (at the link above) for "Generate SQL" you'll get some nice hits.


-----Original Message-----
From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Rishi Seth
Sent: Wednesday, February 27, 2019 8:13 AM
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxxxxxxxx>
Subject: Re: [EXTERNAL] How to change SQL table for field value

Hi,

Please see below screen shot:-
Specify CREATE TABLE Statement



Type information, press Enter.



File . . . . . . . . . . PFVEND4 Name

Library . . . . . . . SRCLIB Name, F4 for list



Nulls: 1=NULL, 2=NOT NULL, 3=NOT NULL WITH DEFAULT



Field FOR Field Type Length Scale
Null
VEND# NUMERIC 6
2
VENDNAME VENNAME CHAR 35
3
VENDADDR CHAR 50
3
VENDCAT CHAR 1
3

3

3



Botto
File CONSTRAINT . . . . . . . . . . . . . Y Y=Yes, N=No

Distributed File . . . . . . . . . . . . . N Y=Yes, N=No



F3=Exit F4=Prompt F5=Refresh F6=Insert line F10=Copy line

F11=Display more attributes F12=Cancel F14=Delete line F24=More keys


here while creating a table name using strsql in as400 there is a column called FOR Field so suppose while creating this table let's say tab1 i mentioned for field for vend# ABCDE and table is created successfully later on i want to change this for field as shown in above screen shot how to change that also how to retrieve the dds of this table like a physical file in db2/400 we can make changes in dds and do CHGPF command to avoid data loss after some DDS changes similarly i want to make changes in this for fiels for above tab1 table which is created in sql400 using create table command. any idea please?

1) How to retrieve the source created for sql table
2) How to make changes for this 'for field' which comes when we enter create table and do f4(please refer above screen shot for more clarity on
this)

Thanks


On Wed, Feb 27, 2019 at 6:34 PM Alan Shore via MIDRANGE-L < midrange-l@xxxxxxxxxxxxxxxxxx> wrote:

Hi Rishi
Not exactly too sure what you are asking Could you give examples of
what you need?

Alan Shore
E-mail : ASHORE@xxxxxxxx
Phone [O] : (631) 200-5019
Phone [C] : (631) 880-8640
'If you're going through hell, keep going.'
Winston Churchill

-----Original Message-----
From: MIDRANGE-L [mailto:midrange-l-bounces@xxxxxxxxxxxxxxxxxx] On
Behalf Of Rishi Seth
Sent: Wednesday, February 27, 2019 7:41 AM
To: Midrange Systems Technical Discussion
<midrange-l@xxxxxxxxxxxxxxxxxx>
Subject: [EXTERNAL] How to change SQL table for field value

Hi,

While creating sql table suppose once we have created for field then
after create of sql table one wants to change this for field value
then what is the process for that?

Thanks
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx To
subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com

--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx To
subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com

--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxx for any subscription related questions.

Help support midrange.com by shopping at amazon.com with our affiliate link: https://amazon.midrange.com

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.