Home » Developer & Programmer » Forms » Sqlloader from unix box (Forms10g)
Sqlloader from unix box [message #329730] Thu, 26 June 2008 06:19 Go to next message
sri_81_in
Messages: 12
Registered: June 2008
Junior Member
Hi,

I am not able to run sqlloader from unix box. In windows it is working fine. I have created a batch file which is internally calling the sqlloader. I am using host(/oracle/or92/ldr.bat)

The batch file exists in the above mentioned path

The batch file is like this:
ORACLE_HOME=/export/home/Ora9i
export ORACLE_HOME
ORACLE_SID=sert
export ORACLE_SID
PATH=/export/home/Ora9i/bin
cd /export/home/Ora9i/bin
sqlldr userid=as/ew@sert control=INS.CTL data=abc.dat

This batch file is working fine. But from forms it is not working. Kindly help me.
Re: Sqlloader from unix box [message #329745 is a reply to message #329730] Thu, 26 June 2008 07:20 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Quote:
from forms it is not working

What does it mean? Any error message? If so, which one?
Re: Sqlloader from unix box [message #329906 is a reply to message #329745] Fri, 27 June 2008 00:56 Go to previous messageGo to next message
sri_81_in
Messages: 12
Registered: June 2008
Junior Member
Hi,

No error message. In the when button pressed trigger I have given like this.Upon clicking the button there is no impact. Meaning no error message.

if get_application_property(OPERATING_SYSTEM) IN ('MSWINDOWS','MSWINDOWS32','WIN32COMMON') THEN
msqlldr := 'c:\ldr.bat';
host('c:\ldr.bat');
ELSIF
get_application_property(OPERATING_SYSTEM) IN ('UNIX') THEN
HOST('/oracle/stk/mds/loader.sh');
end if;
Re: Sqlloader from unix box [message #329918 is a reply to message #329906] Fri, 27 June 2008 01:20 Go to previous messageGo to next message
Frank
Messages: 7901
Registered: March 2000
Senior Member
Did you check if this condition is actually true?
get_application_property(OPERATING_SYSTEM) IN ('UNIX')

You need to learn how to debug your code. Check which parts are executed and which parts are not. Then find out what happens (e.g. is there a shell getting opened? etc)

"No impact, meaning no error message" is NOT a developer's way of telling others what happens.
Re: Sqlloader from unix box [message #329920 is a reply to message #329906] Fri, 27 June 2008 01:22 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
If nothing happened, it means that none of conditions was met (i.e. IF and ELSIF returned FALSE and code had just terminated without executing any statement).

Perhaps you'd want to check what GET_APPLICATION_PROPERTY function returns; just include
message(get_application_property(OPERATING_SYSTEM));
at the beginning of a trigger.
Re: Sqlloader from unix box [message #329926 is a reply to message #329918] Fri, 27 June 2008 01:33 Go to previous messageGo to next message
sri_81_in
Messages: 12
Registered: June 2008
Junior Member
Hi,

I am getting "UNIX" as the OS. I didn't paste the code. After that message statement, the only thing that needs to be executed is the HOST command.

The program ends after that. GET_APPLICATION_PROPERTY(OS) is returning UNIX only.
Re: Sqlloader from unix box [message #329928 is a reply to message #329920] Fri, 27 June 2008 01:39 Go to previous messageGo to next message
sri_81_in
Messages: 12
Registered: June 2008
Junior Member
Hi,
Please find the actual coding

declare
msqlldr varchar2(300) ;
begin

IF get_application_property(OPERATING_SYSTEM) IN ('MSWINDOWS','MSWINDOWS32','WIN32COMMON') THEN
msqlldr := 'c:\ldr.bat';
host('c:\ldr.bat');
ELSIF
get_application_property(OPERATING_SYSTEM) IN ('UNIX') THEN
message('Unix OS');
host('ls>tempabcd.txt');
HOST('/exe/home/Ora/bin/loader.sh');
--This HOST command is not getting executed.
ELSE
message('Incorrect Operating System');
END IF;

exception

when others then
message(sqlerrm);
message(dbms_error_text);
end;

Re: Sqlloader from unix box [message #329946 is a reply to message #329928] Fri, 27 June 2008 02:15 Go to previous messageGo to next message
Frank
Messages: 7901
Registered: March 2000
Senior Member
Does the ls-command get executed properly?
How do you know? Do you see a terminal screen?
What's the full access list on loader.sh? Is it executable?
Why not redirect the output from the second host-command to a file?
Re: Sqlloader from unix box [message #330815 is a reply to message #329946] Tue, 01 July 2008 07:03 Go to previous messageGo to next message
sri_81_in
Messages: 12
Registered: June 2008
Junior Member
Hi,

Sorry for the late response.

When invoking sqlloader from forms, I am getting the following message.

SQL*Loader: Release 9.2.0.1.0 - Production on Fri Jun 27 04:15:50 2008


Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.


SQL*Loader-128: unable to begin a session

ORA-12705: invalid or unknown NLS parameter value specified

NLS_LANG is specified in the ldr file. Then also this error message is shown. What can be the problem.

Re: Sqlloader from unix box [message #330818 is a reply to message #330815] Tue, 01 July 2008 07:15 Go to previous message
Frank
Messages: 7901
Registered: March 2000
Senior Member
- can you use the ctl and data-file combination from a plain unix session?
- if so, compare the settings in your unix-session to the settings in the session created from the Forms' host-command
Previous Topic: How to convert fmx file to exe file......
Next Topic: VB Style Input Feeding.
Goto Forum:
  


Current Time: Mon Feb 03 08:05:35 CST 2025