Home » Developer & Programmer » Forms » exp [merged 2 old threads by JD]
exp [merged 2 old threads by JD] [message #668284] Fri, 16 February 2018 06:39 Go to next message
shahzad-ul-hasan
Messages: 596
Registered: August 2002
Senior Member
declare
  Fil varchar2(150);
begin
  fil:='D:\accounts\';
 Host('Exp accsch/abc file='||fil||'Acc'||sysdate||'.dmp');
exit_form;
end;
The above code is working properly. but i have reinstall the oracle XE. the following line i received.
Quote:


Export done in WE8MSWIN1252 character set into and AL16UTF16 NCHAR character set
Export done in AR8MSWIN1256 character set into and WE8MSWIN1252 (Possibly convertsion set)

how i can fix this error.
Quote:

Host('Exp accsch/abc file='||fil||'Acc'||sysdate||'.dmp statistics=none'); ---to solve problem.
i want to not use statistics. have this any operation on dmp file. ??????
and without (statistics) this dmp is ok for import.??? advised.





[Updated on: Thu, 16 May 2019 08:18] by Moderator

Report message to a moderator

Re: exp [message #668285 is a reply to message #668284] Fri, 16 February 2018 06:42 Go to previous messageGo to next message
John Watson
Messages: 8644
Registered: January 2010
Location: Global Village
Senior Member
Quote:
The above code is working properly.
Really?
orclx> declare
  2    Fil varchar2(150);
  3  begin
  4    fil:='D:\accounts\';
  5   Host('Exp accsch/abc file='||fil||'Acc'||sysdate||'.dmp');
  6  exit_form;
  7  end;
  8  /
 Host('Exp accsch/abc file='||fil||'Acc'||sysdate||'.dmp');
 *
ERROR at line 5:
ORA-06550: line 5, column 2:
PLS-00201: identifier 'HOST' must be declared
ORA-06550: line 5, column 2:
PL/SQL: Statement ignored
ORA-06550: line 6, column 1:
PLS-00201: identifier 'EXIT_FORM' must be declared
ORA-06550: line 6, column 1:
PL/SQL: Statement ignored


orclx>
Re: exp [message #668286 is a reply to message #668284] Fri, 16 February 2018 06:44 Go to previous messageGo to next message
Michel Cadot
Messages: 68055
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

No feedback no help.

Re: exp [message #668287 is a reply to message #668286] Fri, 16 February 2018 06:52 Go to previous messageGo to next message
Littlefoot
Messages: 21692
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
John, this is to be executed from Forms; HOST and EXIT_FORM are Forms built-ins.
Re: exp [message #668288 is a reply to message #668287] Fri, 16 February 2018 06:53 Go to previous messageGo to next message
John Watson
Messages: 8644
Registered: January 2010
Location: Global Village
Senior Member
Ah! Sussed.
Re: exp [message #675951 is a reply to message #668288] Wed, 01 May 2019 13:17 Go to previous messageGo to next message
M HANIF
Messages: 20
Registered: April 2019
Junior Member
Assalam-o-Alaikum!
Dear experts...!
I want to backup my database using host exp command.
I have many database users with different tables etc.
I want to backup the data of current_user (active user) dynamically...!!
can any one help me...
I wrote the command as
host ('exp abc/xyz @xe file=d:\backup\backup.dmp');
this abc user should be dynamic and should be replaced with the user which is currently active...
& the name of backup should be in the name of currently active user...!!
Re: exp [message #675966 is a reply to message #675951] Thu, 02 May 2019 06:59 Go to previous messageGo to next message
cookiemonster
Messages: 13894
Registered: September 2008
Location: Rainy Manchester
Senior Member
Use || to add variables to a string
host ('exp '||user||'/'||password||' @xe file=d:\backup\'||filename);

Though you'll have to make the user re-enter the password into a form item so you can get the value.
Re: exp [message #675972 is a reply to message #675966] Thu, 02 May 2019 10:55 Go to previous messageGo to next message
M HANIF
Messages: 20
Registered: April 2019
Junior Member
Dear brother from where can I get the active user?
I am facing problem.....

I am using the complete statement as

declare
un varchar2 (20);
begin
select user into un from dual;
host ('exp' ||un||'/ xyz @XE file=d:\'||un||'.dmp');
end;


But I am unable to get any result....!!
Please help me..
Re: exp [message #675975 is a reply to message #675972] Thu, 02 May 2019 11:09 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
M HANIF wrote on Thu, 02 May 2019 08:55
Dear brother from where can I get the active user?
I am facing problem.....

I am using the complete statement as

declare
un varchar2 (20);
begin
select user into un from dual;
host ('exp' ||un||'/ xyz @XE file=d:\'||un||'.dmp');
end;


But I am unable to get any result....!!
Please help me..

consider to have a single string variable that will contain the whole command line.
display the content of this string as opposed to passing it to the "host" command.
COPY the content of this string then PASTE it on actual command line & show us the results.
Re: exp [message #675977 is a reply to message #675975] Fri, 03 May 2019 01:14 Go to previous messageGo to next message
M HANIF
Messages: 20
Registered: April 2019
Junior Member
SQL> declare
2 un varchar2 (20);
3 begin
4 select user into un from dual;
5 host ('exp' ||un||'/xyz @XE file=d:\'||un||'.dmp');
6 end;
7 /
host ('exp' ||un||'/xyz @XE file=d:\'||un||'.dmp');
*
ERROR at line 5:
ORA-06550: line 5, column 1:
PLS-00201: identifier 'HOST' must be declared
ORA-06550: line 5, column 1:
PL/SQL: Statement ignored


This is error & Help needed...
Re: exp [message #675978 is a reply to message #675977] Fri, 03 May 2019 02:15 Go to previous messageGo to next message
Michel Cadot
Messages: 68055
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

"host" is a Forms internal procedure, you can't use it in SQL*Plus.

Please read How to use [code] tags and make your code easier to read.

Re: exp [message #675979 is a reply to message #675978] Fri, 03 May 2019 03:22 Go to previous messageGo to next message
cookiemonster
Messages: 13894
Registered: September 2008
Location: Rainy Manchester
Senior Member
As Michel says host is a forms built-in that takes a string and runs it on the command line.
You need to take the string you are passing as the parameter to host and run that manually.

Also you don't need to select user from dual, you can just use user directly.
Re: exp [message #675984 is a reply to message #675978] Fri, 03 May 2019 08:07 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
Michel Cadot wrote on Fri, 03 May 2019 00:15

"host" is a Forms internal procedure, you can't use it in SQL*Plus.

Please read How to use [code] tags and make your code easier to read.

HOST is valid SQL*Plus command.
HOST is NOT a valid PL/SQL command which results from starting code with "DECLARE"

[oracle@localhost ~]$ sqlplus scott/tiger

SQL*Plus: Release 12.2.0.1.0 Production on Fri May 3 09:02:31 2019

Copyright (c) 1982, 2016, Oracle. All rights reserved.

Last Successful login time: Fri Apr 19 2019 23:32:44 -04:00

Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

SQL> host 'echo 123'
/bin/bash: echo 123: command not found

Re: exp [message #675995 is a reply to message #675978] Fri, 03 May 2019 13:28 Go to previous messageGo to next message
M HANIF
Messages: 20
Registered: April 2019
Junior Member
Michel Cadot wrote on Fri, 03 May 2019 02:15

"host" is a Forms internal procedure, you can't use it in SQL*Plus.

Please read How to use [code] tags and make your code easier to read.


Thanks for your reply....!!
I have 4 database users and and i want the backup of active user on an oracle form with button.
I have trigger when button pressed.....!!!
I want that the backup should be of active user only...
For this purpose I am searching & asking for help....!!
hope you got my question....
Re: exp [message #675996 is a reply to message #675984] Fri, 03 May 2019 13:29 Go to previous messageGo to next message
M HANIF
Messages: 20
Registered: April 2019
Junior Member
BlackSwan wrote on Fri, 03 May 2019 08:07
Michel Cadot wrote on Fri, 03 May 2019 00:15

"host" is a Forms internal procedure, you can't use it in SQL*Plus.

Please read How to use [code] tags and make your code easier to read.

HOST is valid SQL*Plus command.
HOST is NOT a valid PL/SQL command which results from starting code with "DECLARE"

[oracle@localhost ~]$ sqlplus scott/tiger

SQL*Plus: Release 12.2.0.1.0 Production on Fri May 3 09:02:31 2019

Copyright (c) 1982, 2016, Oracle. All rights reserved.

Last Successful login time: Fri Apr 19 2019 23:32:44 -04:00

Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

SQL> host 'echo 123'
/bin/bash: echo 123: command not found




Thanks for your reply....!!
I have 4 database users and and i want the backup of active user on an oracle form with button.
I have trigger when button pressed.....!!!
I want that the backup should be of active user only...
For this purpose I am searching & asking for help....!!
hope you got my question....
Re: exp [message #675997 is a reply to message #675979] Fri, 03 May 2019 13:30 Go to previous messageGo to next message
M HANIF
Messages: 20
Registered: April 2019
Junior Member
cookiemonster wrote on Fri, 03 May 2019 03:22
As Michel says host is a forms built-in that takes a string and runs it on the command line.
You need to take the string you are passing as the parameter to host and run that manually.

Also you don't need to select user from dual, you can just use user directly.

Thanks for your reply....!!
I have 4 database users and and i want the backup of active user on an oracle form with button.
I have trigger when button pressed.....!!!
I want that the backup should be of active user only...
For this purpose I am searching & asking for help....!!
hope you got my question....
Re: exp [message #675998 is a reply to message #675997] Fri, 03 May 2019 14:45 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
M HANIF wrote on Fri, 03 May 2019 11:30
cookiemonster wrote on Fri, 03 May 2019 03:22
As Michel says host is a forms built-in that takes a string and runs it on the command line.
You need to take the string you are passing as the parameter to host and run that manually.

Also you don't need to select user from dual, you can just use user directly.
Thanks for your reply....!!
I have 4 database users and and i want the backup of active user on an oracle form with button.
I have trigger when button pressed.....!!!
I want that the backup should be of active user only...
For this purpose I am searching & asking for help....!!
hope you got my question....
The solution is not necessarily as simple & it appears you think it should be.
Is FORMS software running on the DB Server itself?
In order for the exp command to succeed, the USER password is required so how will be acquired & placed on the command line?
What security risk occurs by exposing the USER password to other folks?

You need to answer all 3 question before any specific solution is proposed or offered.
Re: exp [message #676005 is a reply to message #675998] Mon, 06 May 2019 03:34 Go to previous messageGo to next message
M HANIF
Messages: 20
Registered: April 2019
Junior Member
BlackSwan wrote on Fri, 03 May 2019 14:45
M HANIF wrote on Fri, 03 May 2019 11:30
cookiemonster wrote on Fri, 03 May 2019 03:22
As Michel says host is a forms built-in that takes a string and runs it on the command line.
You need to take the string you are passing as the parameter to host and run that manually.

Also you don't need to select user from dual, you can just use user directly.
Thanks for your reply....!!
I have 4 database users and and i want the backup of active user on an oracle form with button.
I have trigger when button pressed.....!!!
I want that the backup should be of active user only...
For this purpose I am searching & asking for help....!!
hope you got my question....
The solution is not necessarily as simple & it appears you think it should be.
Is FORMS software running on the DB Server itself?
In order for the exp command to succeed, the USER password is required so how will be acquired & placed on the command line?
What security risk occurs by exposing the USER password to other folks?

You need to answer all 3 question before any specific solution is proposed or offered.

1. Yes forms software is running on the same DB Server....
2. Password is static for and same for all users... it will be hard coded....
3. There is no security risk....my password is xyz for all my users....
Re: exp [message #676009 is a reply to message #676005] Mon, 06 May 2019 12:09 Go to previous messageGo to next message
Michel Cadot
Messages: 68055
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Quote:
2. Password is static for and same for all users... it will be hard coded....
3. There is no security risk....my password is xyz for all my users....

/forum/fa/449/0/


[Updated on: Mon, 06 May 2019 12:10]

Report message to a moderator

Re: exp [message #676013 is a reply to message #676005] Tue, 07 May 2019 03:06 Go to previous messageGo to next message
cookiemonster
Messages: 13894
Registered: September 2008
Location: Rainy Manchester
Senior Member
M HANIF wrote on Mon, 06 May 2019 09:34

3. There is no security risk....my password is xyz for all my users....
That is a security risk.

If you're going to live with it then all you need to do is debug your host command in the way we already described and fix it appropriately.
Re: exp [message #676014 is a reply to message #676013] Tue, 07 May 2019 03:59 Go to previous messageGo to next message
M HANIF
Messages: 20
Registered: April 2019
Junior Member
cookiemonster wrote on Tue, 07 May 2019 03:06
M HANIF wrote on Mon, 06 May 2019 09:34

3. There is no security risk....my password is xyz for all my users....
That is a security risk.

If you're going to live with it then all you need to do is debug your host command in the way we already described and fix it appropriately.
If you please send me the complete process......
I'll be very thankful to you.....
I am searching from many days.......& I will not go further till this problem is not solved....!!!
I have to do a lot but will not proceed next till that....!!
Kindly help if you can....!!!
Re: exp [message #676017 is a reply to message #676013] Tue, 07 May 2019 04:01 Go to previous messageGo to next message
M HANIF
Messages: 20
Registered: April 2019
Junior Member
cookiemonster wrote on Tue, 07 May 2019 03:06
M HANIF wrote on Mon, 06 May 2019 09:34

3. There is no security risk....my password is xyz for all my users....
That is a security risk.

If you're going to live with it then all you need to do is debug your host command in the way we already described and fix it appropriately.

If you are unable to describe the procedure here....
you can please email me...
My email Id is mhphool786@yahoo.com

Really Thanks
Re: exp [message #676018 is a reply to message #676014] Tue, 07 May 2019 04:04 Go to previous messageGo to next message
cookiemonster
Messages: 13894
Registered: September 2008
Location: Rainy Manchester
Senior Member
You need to learn how to debug your own code.

Assign the string of text you are going to pass to host to a variable.
Display the variable on screen (assign it to a datablock item then you can easily copy it).

Copy the text and run it directly on the DB server.
See what error you get.
Fix the exp command so that it works.
Fix the forms code so that it makes a string that works.

If you can't work out what's wrong with it paste the command you are trying to run here along with the error message you get on the server.
Re: exp [message #676019 is a reply to message #675951] Tue, 07 May 2019 08:19 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
M HANIF wrote on Wed, 01 May 2019 11:17
Assalam-o-Alaikum!
Dear experts...!
I want to backup my database using host exp command.
I have many database users with different tables etc.
I want to backup the data of current_user (active user) dynamically...!!
can any one help me...
I wrote the command as
host ('exp abc/xyz @xe file=d:\backup\backup.dmp');

When you "host" out of Forms to get back to OS command level, what is OS user & what environment exists for this new process?
Is %ORACLE_HOME% & %ORACLE_SID% defined & correct?
Re: exp [message #676139 is a reply to message #676005] Wed, 15 May 2019 12:25 Go to previous messageGo to next message
joy_division
Messages: 4961
Registered: February 2005
Location: East Coast USA
Senior Member
M HANIF wrote on Mon, 06 May 2019 04:34


1. Yes forms software is running on the same DB Server....
Somehow I doubt this.
What version of forms are you running? What you are saying is that it is either not multi tier or you have the Weblogic server on the same server as the database server. If it's the former, you would most likely not have export commond on your PC and if it is the latter, I never heard of a situation where the DB and Forms Server are n the same server.
exp [split] [message #676144 is a reply to message #668284] Thu, 16 May 2019 03:58 Go to previous messageGo to next message
M HANIF
Messages: 20
Registered: April 2019
Junior Member
amdabd wrote on Fri, 28 March 2008 20:56
hi,
create your backup folder [i.e: 'c:\backup'],
on a PushButton [ WHEN-BUTTON-PRESSED] insert the following code
declare
  alrt         number;
  v_directory  varchar2(200) := 'c:\backup';
-------
  path          varchar2(100):='back_up'||to_char(sysdate,'dd-mm-yyyy-hh-mi-ss');
v_exp varchar2(200) := 'exp scott/tiger@orcl file = '
                       ||v_directory||'\'||path
                       ||'.dmp owner=scott grants=yes';  --for specify user use owner=user
-------
begin 
	host(v_exp);
if form_success then
	
set_alert_property('msg',alert_message_text,'Form success');
alrt:=show_alert('msg');
else
    message('there are errors ');
end if; 
end;
------
enjoy it
---------------------------------
Quote:
Executing imp command through a form
I'm sorry
however I still enjoy it

Dear Brother.....!!!
Nice to see your post about export of data as backup.....

I have many database users & they have different passwords....!!
I want to backup the data of active user only....
I expect the database to select the username & Password itself.....(I dont want to enter it statically)
Can you please help me....!!!
I have tried by using
get_application_property(username);
get_application_property(password);
get_application_property(connect_string);

but unable to put these values in string on host command.
If you or anybody know....please help me...
Thanks
Re: Executing imp command through a form [message #676145 is a reply to message #676144] Thu, 16 May 2019 04:47 Go to previous messageGo to next message
cookiemonster
Messages: 13894
Registered: September 2008
Location: Rainy Manchester
Senior Member
does get_application_property(password) actually return anything?
What exactly did you try in the host call?
Re: Executing imp command through a form [message #676595 is a reply to message #676145] Fri, 21 June 2019 01:41 Go to previous message
M HANIF
Messages: 20
Registered: April 2019
Junior Member
cookiemonster wrote on Thu, 16 May 2019 04:47
does get_application_property(password) actually return anything?
What exactly did you try in the host call?

Really Thanks & best regards to all of you.
From your kind reply & guidline. I ultimately became able to create backup with when button pressed trigger!!!
I'm really glad & happy to see the result.
Nice work.
Thanks to all of you once again!


[EDITED by LF: removed huge bold formatting and superfluous commas and dots]

[Updated on: Fri, 21 June 2019 06:12] by Moderator

Report message to a moderator

Previous Topic: How make imp button
Next Topic: Webutil File selection Dialogue
Goto Forum:
  


Current Time: Wed Dec 08 12:35:33 CST 2021