Database Management
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesDatabase Management

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old May 15th, 2003, 09:44 AM
alram1031 alram1031 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 13 alram1031 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
help: Oracle Forms, PL/SQL and a text file

please help!!

i'm working on a project right now using Oracle Forms 6.0 and Oracle 9i.

after i create a record and save the data in the table, how can i generate/create a text file of that particular record? i need this text file in order to run it in another computer and somehow upload the data in the text file to another database.

i will also need to create the text file for multiple records.

can someone help me please????

Reply With Quote
  #2  
Old May 15th, 2003, 10:56 AM
hedge hedge is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Apr 2002
Posts: 692 hedge User rank is Sergeant (500 - 2000 Reputation Level)hedge User rank is Sergeant (500 - 2000 Reputation Level)hedge User rank is Sergeant (500 - 2000 Reputation Level)hedge User rank is Sergeant (500 - 2000 Reputation Level)hedge User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 4 Days 20 h 2 sec
Reputation Power: 19
You may want to look at the utl_file supplied Oracle package. I don't know if you can use it from within Oracle Forms though.

Reply With Quote
  #3  
Old May 15th, 2003, 11:18 AM
pabloj's Avatar
pabloj pabloj is online now
Modding: Oracle MsSQL Firebird
Dev Shed God 5th Plane (7000 - 7499 posts)
 
Join Date: Jun 2001
Location: Outside US
Posts: 7,409 pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 2 Months 2 Weeks 9 h 38 m 53 sec
Reputation Power: 255
Oracle supports "SELECT INTO OUTFILE ...", you can use this to export.
If the other database is Oracle 9i you can use EXTERNAL TABLES to load data from a file.
Another way could be (on Oracle) to use a dblink to the other database and update target tables directly.
Hope this helps

Reply With Quote
  #4  
Old May 15th, 2003, 07:29 PM
alram1031 alram1031 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 13 alram1031 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
thanks! i'll give it a try!

Reply With Quote
  #5  
Old May 22nd, 2003, 05:23 AM
alram1031 alram1031 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 13 alram1031 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
my code.. help pls?

this is what i have to do:
- save the information that was entered in Oracle Forms (this is finished)
- when a button is pressed, update the REQUEST_SENT flag and create the text file (of that same form which was just saved)


This is what i have done so far:


/*WHEN-BUTTON-PRESSED trigger*/

DECLARE

CURSOR cuProcess IS
SELECT *
FROM SIR
WHERE SIR_TRANS_NO = :SIR.SIR_TRANS_NO and SIR_COMPANY = :SIR.SIR_COMPANY;

rProcess cuProcess%ROWTYPE;
cOut VARCHAR2(2000);

N_FILE VARCHAR2(2000);

BEGIN

UPDATE SIR
SET SIR_REQUEST_SENT = 'Y'
WHERE SIR_TRANS_NO = :SIR.SIR_TRANS_NO AND SIR_COMPANY = :SIR.SIR_COMPANY;
COMMIT;

OPEN cuProcess;
FETCH cuProcess INTO rProcess;

WHILE cuProcess%FOUND LOOP
FETCH cuProcess INTO rProcess;

cOut := rProcess.SIR_TRANS_NO || ';'
|| rProcess.SIR_COMPANY || ';'
|| rProcess.SIR_PROJECT || ';'
|| rProcess.SIR_APPL || ';'
|| rProcess.SIR_BUS_FUN || ';'
|| rProcess.SIR_REPORTED_BY || ';'
|| rProcess.SIR_HANDLED_BY || ';'
|| rProcess.SIR_PHASE || ';'
|| rProcess.SIR_TYPE || ';'
|| rProcess.SIR_CAUSE || ';'
|| rProcess.SIR_CLASSIFICATION || ';'
|| rProcess.SIR_DESCRIPTION || ';'
|| rProcess.SIR_REASON || ';'
|| rProcess.SIR_REMARKS || ';'
|| rProcess.SIR_STATUS || ';'
|| rProcess.SIR_REQUEST_DATE || ';'
|| rProcess.SIR_RECEIVED_DATE || ';'
|| rProcess.SIR_START_DATE || ';'
|| rProcess.SIR_CLOSE_DATE || ';'
|| rProcess.SIR_TARGET_DATE || ';'
|| rProcess.SIR_ESTIMATED_MANHRS || ';'
|| rProcess.SIR_ACTUAL_MANHRS || ';'
|| rProcess.SIR_BILLABLE_MANHRS || ';'
||rProcess.SIR_ATTACHMENT || ';'
|| rProcess.SIR_REQUEST_SENT;
END LOOP BeginLoop;

CLOSE cuProcess;

CREATE_TEXT('filename', cOut);

EXCEPTION
WHEN OTHERS THEN
IF cuProcess%ISOPEN THEN
CLOSE cuProcess;
END IF;

END;


then i have a simple procedure that creates the text file:

/*CREATE_TEXT */

PROCEDURE CREATE_TEXT (pfilename IN VARCHAR2, selected IN VARCHAR2) IS

N_FILE text_io.file_type;

BEGIN
N_FILE := TEXT_IO.FOPEN(pfilename||'.TXT', 'W');
TEXT_IO.PUT_LINE(N_FILE, selected);
TEXT_IO.FCLOSE(N_FILE);

END;


my question:
is there another way that i can first update SIR_REQUEST_SENT and then use a cursor to SELECT * and then write to the text file?
also, after the text file is created, how can i load it using sqlloader?

i appreciate any help! thanks again!

Reply With Quote
  #6  
Old May 28th, 2003, 03:31 PM
RhuP RhuP is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Location: Great White North
Posts: 2 RhuP User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
pabloj,

I am interested in learning more about the 'SELECT INTO OUTFILE' command.

I am running an SQL statement that connects to an Oracle database and would like to export the output into a dBase file.

Can this be done??

Thanks for any input.

Reply With Quote
  #7  
Old May 29th, 2003, 03:42 AM
pabloj's Avatar
pabloj pabloj is online now
Modding: Oracle MsSQL Firebird
Dev Shed God 5th Plane (7000 - 7499 posts)
 
Join Date: Jun 2001
Location: Outside US
Posts: 7,409 pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 2 Months 2 Weeks 9 h 38 m 53 sec
Reputation Power: 255
Select into outfile is for a csv file, I'm quite shure that it won't work with dBase.
You should try something else

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesDatabase Management > help: Oracle Forms, PL/SQL and a text file


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway