View previous topic :: View next topic
|
Author |
Message |
MS_Developer
New User
Joined: 14 Oct 2016 Posts: 1 Location: germany
|
|
|
|
Hi any body's
I'm a developer in Microsoft World, exactly MS-SQL-Server ;-)
My question ist:
How can I export W-Daten into an SQL-Server in one step and also from SQL-Server back into W-Daten?
What ist :W-Daten ? Is it an array or is it a string variable ??
How can I read this values out from :W-Daten? maybe with a Loop constructor ? in Visual Basich is it a For i=0 to x .... Next
for your information, I'm not COBOL expert only Expert in Microsoft World, exactly MS-SQL-Server ;-)
Her are a COBOL snippet :
Code: |
01 W-DATEN.
05 FILLER PIC X(1024) OCCURS 500 TIMES.
EXEC SQL
insert into Tabelle (GROOOOSSSE_SPALTE)
values (:W-DATEN)
END-EXEC |
This sql statement not works :-(
Code'd
brgds
Frank |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
This has nothing to do with Mainframes, I suspect.
Your biiiiiggg column can contain 500k of data?
I'm not sure what you mean by "read out". If you wanted to put that 500k in the "host variable" somewhere else, you could just MOVE W-Daten TO somewhere-else (assuming you define it).
If you want to do something else with it, psychic day was Wednesday this week. Which also applies to your "doesn't work" SQL statement.
At a wild guess I'd say you've forgotten to press the power button on the little box containing your server, but that is a completely wild guess and almost certainly wrong. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Quote: |
What ist :W-Daten ? Is it an array or is it a string variable ?? |
Be aware that COBOL dates back to 1959 and hence there is no such thing as a "string" in COBOL like in Java or Perl or C or ... And as your code snippet has it defined, W-Daten is an alphanumeric group level variable of 524,288 bytes. It contains an array but it is not an array. |
|
Back to top |
|
|
RahulG31
Active User
Joined: 20 Dec 2014 Posts: 446 Location: USA
|
|
|
|
Quote: |
This sql statement not works :-(
|
What is the Sqlcode? If you could find that then, I think, your problem will be solved.
. |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3051 Location: NYC,USA
|
|
|
|
Welcome!!
DATEN (German- lang) -- > Data (English- Lang)
1. You cannot be able to do this because DB2 wants one ROW at a time, so you would need to have some kind of loop where WS-DATEN is moved to another variable of 1024 size and then use that <another variable> in the same insert query and perform this until 500 times or WS-DATEN=SPACES
2. Look for MULTI INSERT where you can provide # of rows that you are inserting.
So next time, provide us the error messages along with the SQL and there is something called "BB Codes" which you can use representing the data. |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
Also an option to consider :
If you could export the data to dataset , LOAD utility could be considered as well. |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
Which COBOL are you using? |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Rohit, you didn't translate the biiiiiiiiiiggg_column. Seems to me the column is, well, big, and 1024 doesn't cut big. |
|
Back to top |
|
|
|