From: Jeff on
I am writing a program and need to know the correct syntax inside Cobol
for SUBSTR.

Insert into catable
(member, namekey, namekey6, namekey10, name)
Select substr(name, 1, 2), name, 1, 6)
From Member
Where members not = "0000000000"
Order by Members
EXEC-END.

Is this Correct?

From: Jeff on
I meant END-EXEC.

From: Frederico Fonseca on
On 9 Jun 2005 10:10:56 -0700, "Jeff" <jmoore207(a)hotmail.com> wrote:

>I am writing a program and need to know the correct syntax inside Cobol
>for SUBSTR.
>
>Insert into catable
> (member, namekey, namekey6, namekey10, name)
> Select substr(name, 1, 2), name, 1, 6)
> From Member
> Where members not = "0000000000"
> Order by Members
>EXEC-END.
>
>Is this Correct?
Which COBOL vendor/version, which Pre-compiler, which OS and which
Database.

Syntax will vary depending on all of the above.



Frederico Fonseca
ema il: frederico_fonseca at syssoft-int.com
From: Jeff on
Sorry I guess I should have included all of that, Oracle 9.1
Pro*Cobol Micro-Focus Cobol on an HP9000.

From: Frederico Fonseca on
On 9 Jun 2005 10:10:56 -0700, "Jeff" <jmoore207(a)hotmail.com> wrote:

>I am writing a program and need to know the correct syntax inside Cobol
>for SUBSTR.
>
>Insert into catable
> (member, namekey, namekey6, namekey10, name)
> Select substr(name, 1, 2), name, 1, 6)
> From Member
> Where members not = "0000000000"
> Order by Members
>EXEC-END.
>
>Is this Correct?

There is not specific way of doing it with Oracle on ESQL.

so the following is correct


exec sql
insert into my_tbl (name)
select substr(name, 1, 2) from my_other_tbl
end-exec.

Note that you may have an extra ")" on your previous code.


Frederico Fonseca
ema il: frederico_fonseca at syssoft-int.com
 |  Next  |  Last
Pages: 1 2 3
Prev: MS COBOL 5.0
Next: Visual Cobol