Re: Help

From: <zahgurim_at_ix.netcom.com>
Date: 1995/12/04
Message-ID: <1995Dec4.100028.7037_at_inet.d48.lilly.com>#1/1


In article <DIx9zC.5v0_at_ulysses.homer.att.com>, aka_at_ulysses.att.com (Atul Ashar) writes:

>Hi,
>
>I two questions w.r.t. oracle.
>
>1. How do I switch off transaction log for session. This is equivalent to
> "set nologging" in Ingres. This saves lots of time for DML statements.
>
>2. How do I accept username and password in Pro*c program similar to SQL Plus.
> This program will be run from different types of terminals and different
 Unix
> systems hence it should be plateform independant as much as possible.
>
>i.e. If user passes username and password while invoking then I should ask for
 it.
> If user passes username while invoking then I have to ask for password
 but
> while user is typing it, it should not be echoed on screen.
> If user does not pass either of it then ask for user with echo on screen
 on
> and ask for password with echo off.
>
> I have tried it using curses routines but I could not do it.
>
>Help will be greatly appreciated,
>
>TIA,
>
>Atul Ashar

Here's an example of what I've tried in UNIX and it seems to work...

   system("tput clear");
   printf("\nOracle Logon Information:\n ");
   printf("\nusername: ");
   fgets((char *) username.arr, sizeof username.arr, stdin);
   fflush(stdin);

   username.arr[strlen((char *) username.arr)-1] = '\0';    username.len = strlen((char *) username.arr);
   printf("password: ");
   system("stty -echo");
   fgets((char *) password.arr, sizeof password.arr, stdin);
   fflush(stdin);
   system("stty echo");

   password.arr[strlen((char *) password.arr)-1] = '\0';    password.len = strlen((char *) password.arr);

Hope this is of some use...

Ji Received on Mon Dec 04 1995 - 00:00:00 CET

Original text of this message