RE: slightly OT: visual c++ and null values

2001-10-19 Thread Shari Dishop

Maria,
  They need to use indicator variables.  This is documented in the Pro*C 
documentation.  The application that I wrote is two years old but is still 
operational against a 8.1.x database.  I tried to find a small snippet of code 
to include but since I haven't worked on the application in about two years 
couldn't find anything quickly.  

The gist of it is though that you define short integer variables in addition to 
your variable to hold your column value.  The column is then referenced in the 
select/update statement as a concatenation of the two variables.  
:column_name:indicatorthen if the indicator is 0 the column variable has 
undefined value (NULL).  For inserts/updates the user sets the indicator to -1 
and Pro*C interpretes the value as a NULL.

I admit that my version of Visual C++ is old 5.0 and my version of Pro*C is 
8.0.5 but this does work against a 8.1.x database (on Compaq) but I haven't seen 
anything to indicate that they were getting away from indicator variables.

Shari Dishop
SAP ABAP Development - Project Systems Team
Northrop Grumman Information Technology
Baltimore, MD



hello!

our developers here are requesting that I put defaults (' ' for
chars/varchars, 0 for numbers, etc) in place instead of nulls in all
columns that would supposedly allow null values...
they are using visual c++ and they say that they cannot make visual c++
retreive null values...
i am very hesitant in implementing this...
i have no knowledge whatsoever of visual c++ and don't know if this is
true...

i'd like to know if anyone had encountered this same problem before?
or maybe someone can tell me if there is any truth to what our
developers are saying...


oracle817 on solaris7

thanks =)

--
Maria Aurora VT de la Vega (OCP)
Database Specialist
Philippine Stock Exchange, Inc.

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Shari Dishop
  INET: [EMAIL PROTECTED]

Fat City Network Services-- (858) 538-5051  FAX: (858) 538-5051
San Diego, California-- Public Internet access / Mailing Lists

To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).



Re: Slightly OT: Capturing a failed status of an ftp process

2001-04-04 Thread Shari Dishop

OK.  Here goes.

This is the relevant portion of the ftp script.  The SAP ABAP program executes a 
system call to execute this script.  It passes in things like the userid, remote 
host name, remote and local file names, password, get or put command, etc.  This 
is the piece of the script that we modified to add the status command.

ftp - n $openhost endofdata /tmp/ftpout
user $userid
$putcmds
status
bye
endofdata
cat /tmp/ftpout
exit 0

The output of the status command and any errors generated from the ftp command 
itself are passed back to the calling SAP program by doing the cat command.  SAP 
returns the output in an internal table format.  One table record for each line 
of the file.

Here is the relevant SAP ABAP code that is parsing the returned data.  It's 
doing some other things for our environment so I just pulled the lines that are 
looking at the returned information.

loop at tabl.
  temp_line = tabl-line.
  translate temp_line to upper case.
  if sy-tabix = 1.   "Connected status should be the first line
if temp_line cs 'CONNECTED TO'.
  "This is a substring command meaning  contains
  connect_sw = '1'.
elseif temp_line cs 'NOT CONNECTED'.
  noconnect_sw = '1'.
*else"Must be other mesages in first line.  May be error
endif.
  endif.
endloop.

if connect_sw = 0.
  if noconnect_sw = 1.
write: / 'The file transfer appears to have been interupted. ',
 'Please check the completeness of your data.'.
skip 2.
  endif.
endif.

The key is looking for the CONNECTED TO or NOT CONNECTED message as the first 
line returned.

Hope this helps.

Shari Dishop
SAP ABAP - Project Systems Team  (Former DBA/Designer/Developer)
Logicon - A Northrop Grumman Company
Baltimore, MD



RE:

Would it be possible for you to send me a copy of how you are using the status
command?  I have tried, but I am obviously doing it wrong, as I am not getting 
what
I expect.

Terry

Shari Dishop wrote:

 Terry,
   I worked on what I think is a similar process.  We are running SAP and need 
to
 be able to ftp files on and off of our unix SAP servers.  Someone in the past
 wrote an SAP ABAP program that does all of the set up then calls a unix shell
 script to perform the ftp.  If the ftp command truely failed to connect we had
 no problem getting back a failed error message to the SAP program.  But where 
we
 ran into some problems was when the transfer command would start but get
 interrupted for some unknown reason and never fully complete the transfer.  
This
 was noticed by accident one day when someone was checking a report run off of
 one of the data transfers and there were only a few hundred records in the 
table
 to be processed instead of a few hundred thousand.

   I was then asked to come up with a solution that would look for an 
unexpected
 termination of the ftp connection.  After lots of searching and getting one of
 our local unix gurus involved (I have worked directly on a unix platform), we
 implemented the following.  It is not the best but it does seem to be working.

   We added a step to the ftp script.  This step is a status command that is
 executed directly after the get or put command.  This returns information 
about
 the ftp connection itself.  It also returns a message if it is no longer
 connected.  This output was passed back to the SAP program and parsed.  If I 
had
 a message indicating that the remote host was still connected, I assumed that
 the get or put executed completely.  If on the other hand I received the 
message
 indicating that the remote system was no longer connected I generated an error
 message from the program so that the user could check the data.

 Shari Dishop
 SAP ABAP - Project Systems Team
 Logicon - A Northrop Grumman Company
 Baltimore, MD

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Shari Dishop
  INET: [EMAIL PROTECTED]

Fat City Network Services-- (858) 538-5051  FAX: (858) 538-5051
San Diego, California-- Public Internet access / Mailing Lists

To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).



RE: Slightly OT: Capturing a failed status of an ftp process

2001-04-03 Thread Shari Dishop

Terry,
  I worked on what I think is a similar process.  We are running SAP and need to 
be able to ftp files on and off of our unix SAP servers.  Someone in the past 
wrote an SAP ABAP program that does all of the set up then calls a unix shell 
script to perform the ftp.  If the ftp command truely failed to connect we had 
no problem getting back a failed error message to the SAP program.  But where we 
ran into some problems was when the transfer command would start but get 
interrupted for some unknown reason and never fully complete the transfer.  This 
was noticed by accident one day when someone was checking a report run off of 
one of the data transfers and there were only a few hundred records in the table 
to be processed instead of a few hundred thousand.

  I was then asked to come up with a solution that would look for an unexpected 
termination of the ftp connection.  After lots of searching and getting one of 
our local unix gurus involved (I have worked directly on a unix platform), we 
implemented the following.  It is not the best but it does seem to be working.

  We added a step to the ftp script.  This step is a status command that is 
executed directly after the get or put command.  This returns information about 
the ftp connection itself.  It also returns a message if it is no longer 
connected.  This output was passed back to the SAP program and parsed.  If I had 
a message indicating that the remote host was still connected, I assumed that 
the get or put executed completely.  If on the other hand I received the message 
indicating that the remote system was no longer connected I generated an error 
message from the program so that the user could check the data.


Shari Dishop
SAP ABAP - Project Systems Team
Logicon - A Northrop Grumman Company
Baltimore, MD


RE:

I think I've seen an answer to this, but I never needed it before.  If
anyone can help, I would greatly appreciate it.

We are trying to ftp files from one server to another.  (Archive logs
for Oracle).  We want to be able to capture the status when the ftp
fails, so that we can notify the DBAs to check the process out.  This is
all being done within a shell script that compress the log file first,
then calls another script to do the actual ftp.  But when the child
script executes, it returns a successful status to the parent script.  I
don't know any way to tell the script that is doing the ftp to send the
message, because any non-ftp command within that script fails.  (Of
course, that could just be because I don't know how to do what I want to
do).

If anybody has invented this wheel before, or has any tips on where to
look for more info on how to do what I need to do, please let me know.

TIA,

Terry

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Terry Ball
  INET: [EMAIL PROTECTED]

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Shari Dishop
  INET: [EMAIL PROTECTED]

Fat City Network Services-- (858) 538-5051  FAX: (858) 538-5051
San Diego, California-- Public Internet access / Mailing Lists

To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).



RE: Slightly OT: Capturing a failed status of an ftp process

2001-04-03 Thread Shari Dishop


-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Shari Dishop
  INET: [EMAIL PROTECTED]

Fat City Network Services-- (858) 538-5051  FAX: (858) 538-5051
San Diego, California-- Public Internet access / Mailing Lists

To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).