SQL Loader from Forms 10
Hello!
How can i call to SQL Loader from my application developed by Forms 10?
My application is doing something similar.
Given that the iAS server can read from the data source (where the flat file for the sqlldr to load), all you need is to write a shell script that is invoked from within the forms application (using the host command). The shell script (I use Perl) will do invoking the sqlldr and also other checks, etc
hope this helps
Similar Messages
-
Calling SQL*Loader from Forms
Hi,
I was wondering if anyone has called SQL*Loader from Forms?
What I am wanting to do is use Oracle Forms as the interface where you can specify a file that you can import into the database and it will use a set control file. Push the import button and SQL*Loader does the rest.
Is using Java code to call SQL*Loader from Forms a viable option, or is there an easier way to achieve the desired outcome.
Any ideas or guidance will be much appreciated.
Thanks,
Scott.Scott,
In forms, there's a HOST built-in command which is supposed to execute any o/s commands.
What you have to do is :
1. Bult up the string exacltly in the fashion which you will run in o/s
2. Call the HOST Built-in and pass in the string
Here's a example :
Declare
lOsCmd Varchar2(1000) := Null;
Begin
lOsCmd := 'sqlldr user-id=userid/passwd@connectStr '
|| ' control=c:\temp\abc.ctl log=c:\temp\abc.log '
|| ' bad = c:\temp\abc.log';
Host (lOsCmd, No_Screen);
End;
-- Shailender Mehta -- -
How can we run SQL*Loader from forms. I guess HOST command will run the OS comman on the clinet. How do I invoke the Loader script on the server from the forms clinet?
-Ravi.Look..the oracle server is in UnixWare 7 and the client PC
is on Windows XP Pro, but before install the Oracle Client Software into the client pc the builtin HOST doesn't work
then I install the Software in Windows XP pc and now I'm
working loading the txt file into the server on Unix,
Try to install the Oracle Client Software into the Citrix
client, I think it work. -
Calling SQL Loader from Forms 4.5 using HOST command in Win2000
One of my forms calls SQL Loader 7.3 using HOST command to load a csv file onto the database(Oracle 7.3) under Windows 2000 platform.
Only after sql loader finishes its operation the control should come to my form i.e. synchronous execution.
As of now its running asynchronously.
Is there any way to make it synchronous. If Not any other work arounds?
Environment Details
Forms [32 Bit] Version 4.5.10.6.0 (Production)
Windows 2000 Operating System
Oracle7 Release 7.3.2.3.2Forms6i running on W2000, Rdbms 8.1.7
in Forms I added a button TEST,
Trigger when-button-pressed : host('test.bat') ;
in directory .......\frm I added file test.bat :
REM ===============
cd /d C:\........\ldr
pause
sqlldr parfile=test.par
pause
type test.log
pause
exit
REM ================
now, pressing TEST button opens DOS window, telling me what's going on, running sqlldr, finally going back to forms
Are you using NO_PROMPT or NO_SCREEN option of HOST command ?
Had a look at Forms 4.5 manuals, there is no mentioning of (a)synchronously operation in connection with HOST command. -
hi,
can any one tell me how to call sql loader from forms 9i
thanks
vikram.Hi,
How to execute SQLLDR from web forms in IAS.
You need to set the ORACLE_HOME to the one which has sqlldr.
You can create a DOS BAT file like this for Windows and call this
using the HOST built-in.
If you are using this on web then the HOST will execute in the
Application Server machine. So, files should be in that machine.
REM=======For Windows===============
REM filename Mysqlldr.BAT
REM my file to execute sqlldr
set ORACLE_HOME=D:\oracle\iSuites
set PATH=D:\oracle\iSuites\bin;%PATH%
sqlldr scott/tiger@l817 D:\Mycontrol.ctl DATA=mydata.dat LOG=mylog.log BAD=mybad.log
REM======================
Similarily, you can create a Shell script for UNIX system.
Source: Metalink
~KBK -
Calling Sql*Loader from oracle Form builder
How do i call sql* loader from my forms to import the external data in different formats into my existing database?
Specify the flexibility of sql* loader to import external data from .txt files or .xls files.
Would be thankful if certain examples are given along with the answer.Hi,
1. First you have to create seperate ctl (Control files) which maps to different file formats
2. Using Oracle Forms,
2a) You can use the 'HOST' command to execute the command line ie. In this case executing
SQL*Loader script
2b) You also have the feature in ORACLE forms to read text files and load the data into
ORACLE db.
This can be achieved by using TEXT_IO package which comes with ORACLE Forms.
Hope this helps
Ta
Shailender -
Invokin SQL*Loader from a stored procedure
I try to invoke SQL*LOADER from within a database package by using external C procedure (the procedure calls the system() C function) but the loader generates the following error in its log file :
SQL*Loader -523: error -2 writing to file (STDERR)
and no data is uploaded.
I have tried to use system() from within database procedures to execute OS commands and it works. Does anyone know what is the problem with using system() to execute "sqlldr <parameters>"? Is there some other way to call the loader from within a stored PL/SQL procedure?
Thank you very much for your help.
Aneta Valova
nullHi
What is your task and why you are trying to invoke SQL*Loader from strorage procedure or package? Maybe the redirecting of stderr will resolve your problem but thik is it the best way to do your job.
I am not sure, that invoking other executables from Oracle instance is good idea.
Regards
null -
How to connect to SQL Server from Forms 10g?
Hello all,
How do we connect to SQL Server database from Forms 10g?
In Oracle Metalink site they have suggested using Transparent Gateway for SQL Server as a solution.
But is there a way we can connect directly to SQL Server from Forms using an ODBC connection
without installing anything on the database server?
Pls help!
Regards,
SamHello all,
I was able to connect to SQL Server from Oracle using Generic Connectivity (HSODBC).
Transparent gateway was not required.
Followed metalink note 109730.1
So, after I created a dblink to SQL Server, I created a synonym for the dblinked SQL Server table.
When I used the synonym as the table source in Oracle Forms, I got the following error while querying.
"ORA-02070 - ROWID is not supported in this context."
This is because Forms has an invisible ROWID field and when data is fetched from SQL Server table
no Rowid is fetched since SQL Server table doesn't have one.
Is there a way to overcome this issue or do we have populate the block manually using a SQL query ?
Pls suggest.
Regards,
Sam -
Getting windows error during running the sql scripts from form 6i
I made a little form application. The purpose of this application is to generate explain plan for a particular SQL. Some sql scripts run internally in order to populate the result on forms screen after pressing the forms button but I am getting windows error during running the sql scripts from form 6i.
I am using forms 6i with patch 17 with Oracle 10G database on windows 2000 professional on same computer.
This application runs fine with 8i.
Please inform me where the problem is and how to overcome it.
Zafri.I am using Text_IO in my form's when button press trigger , inorder to create the
text file, then in the same when button press triger
I am calling RMAN via host command in order to run the script which was created by text_IO.
Below you find some of the code. I will appreciate if you solve the problem.
when button press trigger:
Declare
in_file3 Text_IO.File_Type;
linebuf3 VARCHAR2(1800);
output11 varchar2(1000);
BEGIN
output11:='C:\EXPLAIN_PLUS\misc\rm_file.bat ';
Host(output11,no_screen);
:sql.execution_plan:= 'Working........................';
synchronize;
in_file3 := Text_IO.Fopen('c:\explain_plus\misc\create_table.txt', 'w');
Text_IO.Put_Line(in_file3, linebuf3);
Text_IO.put_line(in_file3,' ');
Text_IO.put_line(in_file3,' run { sql "create table PLAN_TABLE (statement_id,...object_name varchar2(30),object_instance numeric,object_type varchar2(30),optimizer varchar2(255),search_columns number,id .....partition_start varchar2(255),partition_stop varchar2(255),partition_id numeric,other long,distribution varchar2(30)) "; } ');
Text_IO.put_line(in_file3,' ');
Text_IO.put_line(in_file3,' ');
Text_IO.FCLOSE(in_file3)
Declare
un VARCHAR2(80);
pw VARCHAR2(80);
cn VARCHAR2(80);
output VARCHAR2(1000);
output2 VARCHAR2(1000);
dummy varchar2(40);
in_file Text_IO.File_Type;
linebuf VARCHAR2(1800);
BEGIN
Get_Connect_Info(un,pw,cn);
/* for Plan_table Begg. Second INNER BLOCK */
declare
dummy2 varchar2(40);
begin
select table_name into dummy2 from all_tables where table_name='PLAN_TABLE';
if dummy2 = 'PLAN_TABLE' then
output2:='rman target/ nocatalog @C:\EXPLAIN_PLUS\MISC\TRUNC2.txt ' ;
Host(output2,no_screen);
end if;
exception
when no_data_found then
output2:='rman target/ nocatalog @C:\EXPLAIN_PLUS\misc\create_table.txt ';
Host(output2,no_screen);
end; -- -
Calling oracle SQL Loader from java program
Hi,
I want to insert data into oracle tables from a text files containing fixed length fields. I am using SQLLoader to achieve this. The requirement is to call the SQLLoader within the java program.
Does anyone know how to call SQL Loader from java program?
Thanks,
VarshaSimply "exec" the sqlldr program with the parameters you need to pass to it.
Runtime.exec (........)
Try to pass all parameters needed including the username and password, and use the option "silent" to avoid output, and the option "log" to have a log file of the modifications that sqlldr has done to the database. -
Launch the SQL*Loader From Stored Procedure???
Is it possible to aaunch the SQL*Loader from a stored procedure? Please help!
Try the documentation on external procedures
-
Calling Sql-loader from PL/SQL
What is the command(s) to call Sql-Loader from inside a PL/SQL procedure?
Regards,
Ahmad.I don't think it is possible ...
-
Calling SQL*Loader from OCCI
Hi All,
I need to access SQL*Loader from C++.
I know there is an interface for OCI to access SQL*Loader.
I also know there is a gnu project of a c++ wrapper to the OCI-SQL*Loader interface (odpd).
According to the OCCI documentation it is just a C++ facade of OCI (with some goodies like thread managing , etc.).
I want to know the following:
1. How can I operate OCI from OCCI?
2. Are there are source samples of operating OCI from OCCI or even better operating OCI SQL*Loader interface from OCCI?
3. Are there are any known (/unknown :-) ) problems with either OCCI access to OCI or OCI interface itself to the SQL*Loader?
Thanks,
ArikHi,
If you have a OCCI application and you want to interoperate with OCI, you can retrieve the underlying OCI handles from OCCI objects and write OCI code.
e.g :-
//with Environment env, Connection conn OCCI objects
OCIEnv *ocienv = env->getOCIEnv();
OCISvcCtx *ocisvc = conn->getOCISvcCtx();
//use OCI calls
OCIError *errhp;
OCIHandleAlloc (ocienv, &errhp, OCI_HTYPE_ERROR,...);
OCIHandleAlloc (ocienv, &dpctx, OCI_HTYPE_DIRPATH_CTX,..);
err = OCIDirPathLoadStream(...);
OCCI does not have a direct path API at present.
Thanks. -
Calling SQL LOADER From Java Program
Hi
I need to invoke sql loader from inside a Java Class.
Any Pointers in this regards will be really appreciated.
Thanks
VishalYou can create two different files which has sqlldr command defined....
1. loader.sh
2. loader.bat
and in the depending on the OS execute one...
String command = "";
if(System.getProperty("os.name").equals("Windows 2000")){
//if os is windows 2000 then execute bat file
command = <<bat file path>>
}else{
command = <<shell path>>
Runtime rt = Runtime.getRuntime();
Process p = rt.exec(command);
int i = p.exitValue();
-
Hello, how is it possible to execute a sql file from forms without using sqlplus, because we have only the forms runtime on our pc.
We can't use forms_ddl because we have a very big sql script for creating a package.
Please help,
GJStrange, whenever I have installed forms I got sqlplus too without asking for it. If it is not installed, wouldn't your best bet be to install it ?
Maybe you are looking for
-
Can i use more than one email address for one account
I created one user account. I would like to create and use three separate email address for this one account, which will all show under one profile. Is that possible, and if so, is it free to do so? Thank you.
-
How do i enlarge print Size on HP Photosmart All in one
Print comes out small when i print
-
When taking a picture to add to a contact the phone waits too long
When you go to take a picture to add to a contact in the contacts app itself and you have flash turned on the camera will flash but the phone doesnt save the pic untill after the flash is gone so if its dark you will just get a black screen.
-
Mighty Mouse (wireless) will only scroll up & not down
Has anyone come across an issue like this, I think it is hardware, but thought I would ask around first? I tried using our 2nd wireless mighty mouse that is paired with the iMac and that worked correctly (scroll both up and down) when paired with my
-
Reinstall 10.7 prior to sale, not available from apple store
Hi all I am going to sell my macbook air and replace with a new one. I want to wipe the hard drive - which I have managed to do I want to reinstall Mac OS X Lion I follow the instruction to get to the "download from the app store" I sign in with no