How to print in PL Sql using a procedure?
So how do you create a procedure to print a name in PL Sql ? Here is what I have done so far.
Create Procedure Print_Info
( X_Name IN Varchar2
) As
Begin
:X_Name:='Anabella'
DBMS_Output.Put_Line (X_Name);
End Print_Info;
thanks
user8706975 wrote:
So how do you create a procedure to print a name in PL Sql ? You cannot.
PL/SQL is a server process. It is not connected or wired to a keyboard, mouse, screen or printer.
The client process (SQL*Plus, TOAD. etc.) interfaces with the end-user - it is connected to peripheral devices like mouse, keyboard and screen.
And this is exactly what client-server is. And which is why the task to "+Print data using PL/SQL+" is missing the fundamental concept of what client server is. It is utterly and totally flawed. And should you be doing this as some kind of course, then you should seriously question what they are teaching as the concept of PL/SQL printing anything is just plain bloody wrong.
So how does DBMS_OUTPUT then works? The DBMS_OUTPUT package has a static buffer area (variable) that you can place data into using the put and put_line procedures.
A client, like SQL*Plus, can then interrogate this buffer after executing PL/SQL code, and remove and display the content in that buffer to the end-user. This is not "+printing by PL/SQL+" just as running a SQL select from a client and viewing the data (in the client) is not "+printing by SQL+".
It is very important that you grasp correctly what client-server is and the basics of how it works - as that will enable you to truly understand what PL/SQL is, what Oracle is, and how to correctly use it. It will enable you to understand how to troubleshoot performance problems, how to design systems optimally and so on. One cannot simply learn PL/SQL the language and expect to be a good Oracle developer. Understanding what client-server is and how it works in Oracle, is more important than to be an expert on a specific programming language. Knowing a programming language does not mean being able to architecture efficient and scalable solutions using that language.
Similar Messages
-
How to print text on container using oop on alv list
Hello Guru's,
pl guide me how to print text on container using alv list-display which have interactive events using oop classes/methods ...
I want to print hard coded text on coantainer , on double clicking it will call another screen.
Pl Help..
Message was edited by:
paresh sonavaneHi Paresh,
1. Go to the Layout and Create One custom container box and give name it.
2. Custom Container is the one type of tool and its used for Displaying the Reports
with the use of ABAP Objects.
3. Go to se38 and Write The Following Code.
tables ZTEAM_GD.
DATA : OBJ TYPE REF TO CL_GUI_CUSTOM_CONTAINER,
OBJ1 TYPE REF TO CL_GUI_ALV_GRID.
DATA IT_TEAM LIKE TABLE OF ZPLAYER_BAT_DET .
SELECT * FROM ZPLAYER_BAT_DET INTO TABLE IT_TEAM.
CREATE OBJECT OBJ
EXPORTING
CONTAINER_NAME = 'ALV'. -
> Give ur Container Name
CREATE OBJECT OBJ1
EXPORTING
I_PARENT = OBJ.
CALL METHOD OBJ1->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
I_STRUCTURE_NAME = 'ZPLAYER_BAT_DET'
CHANGING
IT_OUTTAB = IT_TEAM.
*CALL METHOD OBJ1->SET_DROP_DOWN_TABLE
EXPORTING
I_STRUCTURE_NAME = 'ZTEAM_GD'
CHANGING
IT_OUTTAB = IT_TEAM.
CALL SCREEN 9000.
*& Module USER_COMMAND_9000 INPUT
text
MODULE USER_COMMAND_9000 INPUT.
CASE SY-UCOMM.
WHEN 'EXT'.
LEAVE PROGRAM.
ENDCASE.
ENDMODULE. " USER_COMMAND_9000 INPU
Thanks.
Reward If Helpful. -
How to print uspto patent images using Safari and Quicktime
3/18/06
Do you want to know how to print US patent images using Safari? Read on.
When you access the "images" link of a specific patent on the www.uspto.gov/ website using Safari, the page you are viewing is only one small upper left tile of a huge patent image that is not sized to the screen. You can scroll and try to read the page but it's almost impossible. Try to print it out and you only print what's on the screen. Bummer.
The fix:
Place the cursor on the opened image (it may appear blank), hold down the CONTROL key on you keyboard and click on the image. Two instructions come up. Click on the "Save Image to the Desktop" instruction and a DImg.tiff file will be created on your desktop. Click on the .tiff file and it should open in the Preview program, then simply print out the image. Voila!!!!
Click the yellow arrow in the left margin to access page 2 of the patent and repeat the previous instructions to create another .tiff file on your destop. Do every page and you'll have the patent available to print out one page at a time.
You can then rename the files and create a folder for that specific patent so you can access it later without signing onto uspto site.
It's odd that the ever compatible Apple does not provide seamless compatibility to view and print patent images on the US Patent and Trademark Office's website. Where would they be without protecting their own intellectal property? Let's hope the next version of Quicktime includes the appropriate ITU T.6 or CCITT Group 4 (G4) compression language.
Even the "throw it out the Windows" operating system is up to speed on this issue for America's hard working inventors.
Keep on inventing.
Tommy K
imac 400 DV Mac OS X (10.3.9) Cube 450
imac 400 DV Mac OS X (10.3.9) Cube 450Another similar thread on this issue...
http://discussions.apple.com/thread.jspa?messageID=1602391 -
Can anyone help how to print stack trace messages using log4j?
Can anyone help how to print stack trace messages using log4j?
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j/'>
<appender name="STDOUT" class="org.apache.log4j.ConsoleAppender">
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d %-5p %m%n"/>
</layout>
</appender>
<appender name="DEBUG" class="org.apache.log4j.RollingFileAppender">
<param name="File" value="/usr/local/dice/d2jbin/cmdToNetJobs/app-debug.log"/>
<param name="Append" value="true"/>
<param name="MaxFileSize" value="1000KB"/>
<param name="MaxBackupIndex" value="5"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d %-5p %m%n"/>
</layout>
<filter class="org.apache.log4j.varia.LevelRangeFilter">
<param name="LevelMin" value="DEBUG" />
<param name="LevelMax" value="DEBUG" />
</filter>
</appender>
<appender name="INFO" class="org.apache.log4j.RollingFileAppender">
<param name="File" value="/usr/local/dice/d2jbin/cmdToNetJobs/app-info.log"/>
<param name="Append" value="true"/>
<param name="MaxFileSize" value="1000KB"/>
<param name="MaxBackupIndex" value="5"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d %-5p %m%n"/>
</layout>
<filter class="org.apache.log4j.varia.LevelRangeFilter">
<param name="LevelMin" value="INFO" />
<param name="LevelMax" value="INFO" />
</filter>
</appender>
<appender name="WARN" class="org.apache.log4j.RollingFileAppender">
<param name="File" value="/usr/local/dice/d2jbin/cmdToNetJobs/app-warn.log"/>
<param name="Append" value="true"/>
<param name="MaxFileSize" value="1000KB"/>
<param name="MaxBackupIndex" value="5"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d %-5p %m%n"/>
</layout>
<filter class="org.apache.log4j.varia.LevelRangeFilter">
<param name="LevelMin" value="WARN" />
<param name="LevelMax" value="WARN" />
</filter>
</appender>
<appender name="ERROR" class="org.apache.log4j.RollingFileAppender">
<param name="File" value="/usr/local/dice/d2jbin/cmdToNetJobs/app-error.log"/>
<param name="Append" value="true"/>
<param name="MaxFileSize" value="1000KB"/>
<param name="MaxBackupIndex" value="5"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d %-5p %m%n"/>
</layout>
<filter class="org.apache.log4j.varia.LevelRangeFilter">
<param name="LevelMin" value="ERROR" />
<param name="LevelMax" value="ERROR" />
</filter>
</appender>
<root>
<priority value="debug"/>
<!--<appender-ref ref="STDOUT"/>
--><appender-ref ref="DEBUG"/>
<appender-ref ref="INFO"/>
<appender-ref ref="WARN"/>
<appender-ref ref="ERROR"/>
</root>
</log4j:configuration>
I ve written like this
and to print stack trace I used
log.error(Throwable(e))
but does nt display printstacktrace how to do it -
How to work on Data Analysis using Stored procedures
How to work on Data Analysis using Stored procedures any suggestions
Carefully? Precisely? Tomorrow? Your question has no context so it means little to an outside reader. Perhaps you should start with some basic research into the data mining features of sql server:
data mining homepage -
How to print a text file using Java
How can I print a text file using Java without converting the output to an image format. Is there anyway I can send the characters in the text file as it is for a print job? I did get a listing doing this ... but that converted the text to an image format before printing....
THanks,.Hi I had to write a print api from scratch, and I did not convert the output to image. Go and read up on the following code. I know there is a Tutorial on Sun about the differant sections of the snippet.
private void printReport()
Frame tempFrame = new Frame(getName());
PrintJob printerJob = Toolkit.getDefaultToolkit().getPrintJob(tempFrame, "Liesltext", null);
Graphics g = printerJob.getGraphics();
//I wrote the method below for calculations
printBasics(g);
g.dispose();
printerJob.end();
}This alone wont print it you have to do all the calculations in the printBasics method. And as I said I wrote this from scratch and all I did was research first the tutorial and the white papers
Ciao -
How to print text rertrived by using the READ_TEXT fun module in smartform
Please tell me how to print the text which is rertrived by using the READ_TEXT function module in smartform.
I have coded all things in the program lines and in that i am retriveing the long texts.
I am getting the text lines in my internal table clearly, the thing is that I am not able to pass these lines to the text module.
its urgent. Points will be rewarded for any type of clue. whether it will work or not.loop the table into which u have retrieved the text .
in the form interface of the smartform ... in importing parameter give the that table name .
and in smartform whereever u want to print there insert the data into work area and pass to fields for dispaly .
decalre ur work area in global defintions
thnaks . -
How to print logo in printout using classical report.
Hello Friends,
By using below code i am displaying logo in output using Classical report.
What my problem is it is not displaying in print out.
Please help. or else tell me how to print logo in classical report as well as output print out.
DATA: docking TYPE REF TO cl_gui_docking_container,
picture_control_1 TYPE REF TO cl_gui_picture,
url(256) TYPE c ,
query_table LIKE w3query OCCURS 1 WITH HEADER LINE,
html_table LIKE w3html OCCURS 1,
return_code LIKE w3param-ret_code,
content_type LIKE w3param-cont_type,
content_length LIKE w3param-cont_len,
pic_data LIKE w3mime OCCURS 0,
pic_size TYPE i,
repid LIKE sy-repid.
repid = sy-repid.
START-OF-SELECTION.
CREATE OBJECT picture_control_1
EXPORTING
parent = docking.
CHECK sy-subrc = 0.
CALL METHOD picture_control_1->set_3d_border
EXPORTING
border = 5.
CALL METHOD picture_control_1->set_display_mode
EXPORTING
display_mode = cl_gui_picture=>display_mode_stretch.
CALL METHOD picture_control_1->set_position
EXPORTING
height = 100
left = 700
top = 1
width = 200.
"Position
IF url IS INITIAL.
REFRESH query_table.
query_table-name = '_OBJECT_ID'.
" Logo Name
query_table-value = 'ENJOYSAP_LOGO'.
APPEND query_table.
CALL FUNCTION 'WWW_GET_MIME_OBJECT'
TABLES
query_string = query_table
html = html_table
mime = pic_data
CHANGING
return_code = return_code
content_type = content_type
content_length = content_length
EXCEPTIONS
object_not_found = 1
parameter_not_found = 2
OTHERS = 3.
CALL FUNCTION 'DP_CREATE_URL'
EXPORTING
type = 'image'
subtype = cndp_sap_tab_unknown
size = pic_size
lifetime = cndp_lifetime_transaction
TABLES
data = pic_data
CHANGING
url = url
EXCEPTIONS
OTHERS = 1.
ENDIF.
CALL METHOD picture_control_1->load_picture_from_url
EXPORTING
url = url.
WRITE : /'Classical Report Logo'.
Regards,
Phaneendra
Edited by: phaneendra punukollu on Dec 31, 2009 11:38 AM
Code Formatted by: Alvaro Tejada Galindo on Jan 4, 2010 4:52 PMHello Nidhi,
Thanks for your sugessition.
Actual we have data from IDOCS and it is maintained in Ztables
and need to dispaly in report ( Service centre - Warranty data ).
The report is completed. So again going to Script means waste of time for us.
So Plz help me if possible in Classical report.
Regards,
Phaneendra -
How to print from the iPhone using my network printer
I have just a regualar HP networked priinter, nothing fancy for iPhone printing. I have tried Prnter Pro without sucess. I'm looking for a way to print from my iPhone using my network.
HP has an app (free) that I use to print from my iOS device to an HP printer attached to my network.
Barry -
How to insert into a table using a procedure in a trigger
I have following trigger and based on the some condition, it should inser a row in to a table using the procedure:
CREATE OR REPLACE TRIGGER RSSC.RR_SERV_ADD_ON_REQ_bu before update on RSSC.RR_SERV_ADD_ON_REQ
for each row
DECLARE
lr_appr_trans_hdr APPR_TRANS_HDR%ROWTYPE;
-- Inserting a row into APPR_TRANS_HDR table
lr_appr_trans_hdr.apth_ref_system := 'RSAO';
lr_appr_trans_hdr.apth_xref_col_name := 'RSAO_ADD_ON_REQ_NUM';
lr_appr_trans_hdr.apth_xref_id := :NEW.RSAO_ADD_ON_REQ_NUM;
lr_appr_trans_hdr.apth_trans_srce := 'I';
lr_appr_trans_hdr.apth_balance_amt := :NEW.RSAO_TOT_AMT;
lr_appr_trans_hdr.apth_is_finance_adj := 'N';
SPI_APPR_TRANS_HDR (
lr_appr_trans_hdr.apth_id
,lr_appr_trans_hdr.apth_create_dt
,lr_appr_trans_hdr.apth_create_user_id
,lr_appr_trans_hdr.apth_update_dt
,lr_appr_trans_hdr.apth_update_user_id
,lr_appr_trans_hdr.apth_ref_system
,lr_appr_trans_hdr.apth_xref_col_name
,lr_appr_trans_hdr.apth_xref_id
,lr_appr_trans_hdr.apth_trans_srce
,lr_appr_trans_hdr.apth_udc_name_cd
,lr_appr_trans_hdr.apth_udc_acct_num
,lr_appr_trans_hdr.apth_level1_apprvl_stat
,lr_appr_trans_hdr.apth_level1_apprvl_dt
,lr_appr_trans_hdr.apth_level1_apprvr_id
,lr_appr_trans_hdr.apth_level2_apprvl_stat
,lr_appr_trans_hdr.apth_level2_apprvl_dt
,lr_appr_trans_hdr.apth_level2_apprvr_id
,lr_appr_trans_hdr.apth_received_dt
,lr_appr_trans_hdr.apth_balance_amt
,lr_appr_trans_hdr.apth_cust_name
,lr_appr_trans_hdr.apth_sent_dt
,lr_appr_trans_hdr.apth_wbs_element
,lr_appr_trans_hdr.apth_gl_acct_num
,lr_appr_trans_hdr.apth_is_finance_adj );
When I use the above, it is saying wrong number of argument or type.
When I use the following instead, I am getting :NEW.APTH_ID must be declared.
SPI_APPR_TRANS_HDR('APPR_TRANS_HDR',to_char(:NEW.APTH_ID),'APTH_ID',:OLD.APTH_ID,:NEW.APTH_ID);
How can use the procedure in a trigger.
Following is the table structure:
Column Name Data Type Column Comments
APTH_ID NUMBER(16) Computed unique identified per large table standards (yyyymmddnnnnnnnn)
APTH_CREATE_DT DATE sysdate
APTH_CREATE_USER_ID VARCHAR2(65) ‘conv’
APTH_UPDATE_DT DATE sysdate
APTH_UPDATE_USER_ID VARCHAR2(65) ‘conv’
APTH_REF_SYSTEM VARCHAR2(4) ‘RSAO’
CPA_PREM_NUM NUMBER(13,0) NULL
RSR_REQ_NUM NUMBER(16) NULL
RSAO_ADD_ON_REQ_NUM NUMBER(16) rsao_add_on_req_num
APTH_TRANS_SRCE VARCHAR2(2) ‘I’
APTH_LDC_NAME_CD VARCHAR2(4) NULL
APTH_LDC_ACCT_NUM VARCHAR2(25) NULL
APTH_LEVEL1_APPROVAL_STAT VARCHAR2(1) NULL
APTH_LEVEL1_APPROVAL_DT DATE NULL.
APTH_LEVEL1_APPROVAL_ID VARCHAR2(30) NULL
APTH_LEVEL2_APPROVAL_STAT VARCHAR2(1) NULL
APTH_LEVEL2_APPROVAL_DT DATE NULL.
APTH_LEVEL2_APPROVAL_ID VARCHAR2(30) NULL
APTH_RECEIVED_DT DATE NULL
APTH_BALANCE_AMT NUMBER(11,2) RR_SERV_ADD_ON_REQ.rsao_tot_amt – amount previously extracted to sap
APTH_CUST_NAME VARCHAR2(65) NULL
APTH_SENT_DT DATE NULL
APTH_WBS_ELEMENT VARCHAR2(25) NULL
APTH_GL_ACCT_NUM VARCHAR2(15) NULL
APTH_IS_FINANC_ADJ VARCHAR2(1) ‘N’
Edited by: user652807 on Sep 3, 2008 4:51 PMIt appears you're missing the format mask in the TO_CHAR, ...
TO_CHAR(:new.apth,'YYYYMMHR24MISS')
The full code would help a bit more. -
How to Print to a paper using PL SQL
Hi All,
I have some advice generated in the database. These are well formatted and to be printed on a pre-defined background template.
Could you please tell me the best way to print them using PL/SQL code?
I tried using some other technology but the formatting of the message gets lots in this.
regards
Suhel>
I dont have to format the same.It is already formatted using some other code. I have to print As-it-is.
>
I sincerely doubt that.
As-it-is means a simple read-a-line, print-a-line. Already formatted for what font? what font-size?
What is it that controls how many lines are on a page? If the formatted data is set for 66 lines per page then you can just copy lines to the printer if the custom paper has 66 lines per page.
What happens when you print? -
How to print a pl/sql raw or BLOB to html page with htp.p command
Hi!
I have a jpeg image I retrieved from the OID and it is stored in an DBMS_LDAP.BINVAL_COLLECTION, which is supposed to be similar to a BLOB or PL/SQL raw collection. What I want to do is to print it to my portal page. I have been using htp.p to print all the other values such as name, department etc, and the only thing I can't get out to the page is the image. How do I do this? I suppose I can just declare a variable of the type BLOB, and give it the binary value I have in the BINVAL_COLLECTION, but then how do I get it to my html code? Do I have to convert it to something, or use some function. I don't know much pl/sql so detailed instructions would be very helpful. Thank you
/MarieI tried that, but I get the error "Wrong number or types of arguments" in the Read method. See my code below:
PROCEDURE read_image(p_photo DBMS_LDAP.BINVAL_COLLECTION)
AS
src_lob blob;
buffer raw(2048);
amt BINARY_INTEGER := 2048;
pos INTEGER := 1;
doctype number;
BEGIN
owa_util.mime_header( 'image/bmp', false );
owa_util.http_header_close;
-- the query
--select into src_lob from where ;
LOOP
--THIS IS WHERE I CHANGE THE BLOB FOR MY BINVAL_COLLECTION, BUT GET AN ERROR
DBMS_LOB.READ (p_photo, amt, pos, buffer);
pos := pos + amt;
htp.prn(utl_raw.cast_to_varchar2(buffer));
END LOOP;
exception when others then
NULL;
END;
Is there something wrong with this code, or else how do you mean I shold just replace the blob whith the DMBS_LDAP.BINVAL_COLLECTION
/Marie -
How to print pdf file not using the the adobe reader ?
hello,
i used the adobe sdk to open a pdf file in read and modify it serveral times and each time save it to another directory,and now i need to write a program to print the pdf file in this directory.when print the file,i want to continue my work also,so who i tell me how to solve this problem?
thanks.The SDK is only a collection of documentation and headers that show you how to interact with and automate Adobe Acrobat and to some extent Adobe Reader. You need a copy of Acrobat or Reader installed on the system in order to use any of the SDK functions. You cannot "print not using the Adobe Reader", unless you have Adobe Acrobat installed on the system instead of Reader.
-
How to print pdf files not using acrobat product?
i just want to print pdf files,but not want to use the adobe acrobat or acrobat reader,just want to write a tools print pdf files directly.
> no i just want to print it,not need to read it.can you help me?
Well, the problem is to print it you need to be able to read it. Something needs to convert it into a format the printer can understand (most printers are PostScript or PCL).
I'm not sure you entirely understand what a PDF file is. It's not a fancy text file. It's a binary format. Saying "I want to print a PDF without a PDF interpreter" is like saying "I want to run an EXE without Windows". You need software to interpret the format.
You certainly can write your own software to interpret the PDF format, convert it to a print language and output that to a printer, but as Aandi said you will need to start by reading the PDF Reference so you know how the inside of a PDF file works, and it will most likely take several years of development even for a seasoned, expert programmer. It's just not as simple as "Printer, meet PDF. PDF, meet printer." -
How do I code PL/SQL using files instead of directly against the database
Hi All,
My current project, like pretty much all I've every worked on, requires all developers of pl/sql routines to code those routines in source controlled files. We then edit the files (normally using TOAD - trying to move to SQL Developer) compile them against the DB, fix the errors, test etc.
I've been trying to do the same in SQL Developer (1.2 and 1.5EA) and it appears as though I can't get the tool to understand my .pks and .pkb files are packages - and thus when I compile them I will receive a "compiler" window containing the errors. It appears to simply run the code as a script returning me:
Warning: execution completed with warning
PACKAGE BODY XYZ Compiled.
This is not the same behavior I receive when I edit objects directly in the database (something I never do).
I hope I'm not missing something obvious.
Thanks in advance.Your latest EA fixed this, at least for subversion and cvs, hooray! and I'm quite happy with it.
But I think our posters need a quick how-to for subversion:
* the latest EA has subversion and cvs installed
* open VIEW menu->Versioning Navigator
* create your SVN repository in Versioning Navigator, that will establish all of the authentication stuff for your later work
* use VIEW menu->Files and navigate to your subversion working checkout directory.
The File navigator will become your main work zone, if you're anything like me.
for unconventional file suffixes:
* open TOOLS menu->Preferences
* click the File Types topic
* click "Add.." to add the file name extension
* it won't let you specify content type in the little "add" dialog; just click OK
* when you return to the main Preferences screen for file types, your new type will be selected, and below there is a content type drop-down under "Details for type .blahblah"
* choose SQL Script as the type for your new file type, and click OK to commit the changes
* I find "SQL Script" much easier to work with than PlSqlNode, which seems to suppress the file handling and versioning features
Good luck!
-- Andrew Wolfe
Maybe you are looking for
-
Contacts are added to just one account in Contacts app
Whatever contact I select in my Mail app to be added to Contacts (using Mail interface) they end up being in All Yahoo section though all of newly added ones belong to my Gmail. What would you recommend to do (1) to move already added to Gmail (2) to
-
Lenovo T61 Backlight Problem !
Hi, so i bought a notebook Lenovo T61 last year in september. The model is 6459CTO with a 15.4 WSXGA screen. This is how it shows on the packing list. 15.4 WSXGA- TFT So 25 days after warranty expired the notebook screen died. How **bleep**ty is that
-
Hi, Please suggest me best way to do it. Create a form with two blocks 1.Master block1 has items client,dc,sku,fromlocation,tolocation which is fetching data from RFlog table in RFWH schema 2.Second block has items client,dc,sku,location which is fet
-
DNG/raw+XMP workflow comparison
[ Note: this discussion has been branched from an existing one (link on top ^) and deals about DNG-raw+XMP -PECourtejoie ] Omke Oudeman wrote: What Disk based XMP data file you are referring to and you think Camera Raw get's involved in this while wr
-
Account Unknown on Active Directory
How can I delete Account Unknown on Active Directory? is there a tool or script for deleting 1000 Account Unknown on Active Directory?