Solved

DB2 on AS400: Create a temp table from VB

Posted on 2000-05-09
6
728 Views
Last Modified: 2010-08-05
I'm using an ActiveX DLL in VB6 and I want to create a temporary table on the AS400 DB2 database. I'm accessing the database through ADO via an ODBC data source.
Does any one have the sample code to create the table - I'm new to SQL so I would all the code - or alternatively a link to some documentation.
Thanks
FR
0
Comment
Question by:frgarson
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 3

Expert Comment

by:P_S_Price
ID: 2796029
If you have a manual on SQL to explain the syntax then you can use the CREATE TABLE SQL command. and DROP Table SQL command.

I can Give you a Link to IBM's AS/400 Infomation Centre which provides Great Info on how to do things in AS/400 and also access to the whole range of AS/400 user guides

http://publib.boulder.ibm.com/pubs/html/as400/v4r4/ic2924/info/INFOCENT.HTM

However as an observation, if the table is only relevant to a single session it may be more advantageous to create the temporary table on your workstation local Disk. AS/400 Disk space is much dearer than PC.
0
 
LVL 2

Accepted Solution

by:
xinger earned 50 total points
ID: 2860357
It depends on how temporal and inaccessible you want your table to be.  Very temporary and private tables can be created in library qtemp.  When created, they exist only as long as your current connection to the AS/400.  When you signoff or disconnect, the table is automatically deleted forever.  But be aware that qtemp tables cannot be seen nor used by anyone else including your other sessions.  It is accessible to only the session that created it.

Syntax to create a temporary table with one column is
CREATE TABLE qtemp.table1
    (columnA char(1))

0
 
LVL 3

Expert Comment

by:P_S_Price
ID: 2863820
xinger your last part of comment regarding accessibilty from other sessions is the very reason I didnt suggest qtemp.
0
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
LVL 1

Expert Comment

by:veeramani
ID: 2866326
For this question, xinger comment is very good and advisable.

Regards,

Veeramani
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6401606
This question was LOCKED with a PROPOSED ANSWER and awaits your decision today.  Once a question is LOCKED with a Proposed Answer, few new experts will step in to help on that question, since the assumption is, you've been helped.  If the Proposed Answer helped you, please accept it and award that expert.  If it did not help you, please reject it and add comments as to status and what else is needed.
 
If you wish to award multiple experts, just comment here with detail, I'll respond as soon as possible.  As it stands today, you asked the question, got help and not one expert was awarded for the contribution(s) made.  Your response is needed.  I'll monitor through month end, and if you've not returned to complete this, we'll need to decide.  Expert input is welcome (as always) to determine the outcome here if the Asker does not respond.
 
Your response in finalizing this (and ALL) your question(s) is appreciated.
 
Moondancer
Community Support Moderator @ Experts Exchange

0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6890920
ZERO reponse to my request above;  therefore finalized today by EE Moderator.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Azure Functions is a solution for easily running small pieces of code, or "functions," in the cloud. This article shows how to create one of these functions to write directly to Azure Table Storage.
This article demonstrates probably the easiest way to configure domain-wide tier isolation within Active Directory. If you do not know tier isolation read https://technet.microsoft.com/en-us/windows-server-docs/security/securing-privileged-access/s…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question