|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
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
|
|||
|
|||
|
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???? |
|
#2
|
|||
|
|||
|
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.
|
|
#3
|
||||
|
||||
|
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
__________________
My blog about OpenSource Databases PDF tutorials about OSS databases, DBMonster ... Please contribute to Open Source Development, fill bug reports!!! Developer Shed eSupport Commented my.ini/my.cnf (PLEASE ADD YOUR OWN CONFIG TRICK) Understanding SQL Joins An introduction to database normalization Natural or Surrogate key Custom ordering for your results Correlated and uncorrelated subqueries |
|
#4
|
|||
|
|||
|
thanks! i'll give it a try!
|
|
#5
|
|||
|
|||
|
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! |
|
#6
|
|||
|
|||
|
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. |
|
#7
|
||||
|
||||
|
Select into outfile is for a csv file, I'm quite shure that it won't work with dBase.
You should try something else |
![]() |
| Viewing: Dev Shed Forums > Databases > Database Management > help: Oracle Forms, PL/SQL and a text file |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|