How to convert blob data into clob using plsql
hi all,
I have requirement to convert blob column into clob .
version details
BANNER
Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - Production
PL/SQL Release 11.1.0.7.0 - Production
CORE 11.1.0.7.0 Production
TNS for 32-bit Windows: Version 11.1.0.7.0 - Production
NLSRTL Version 11.1.0.7.0 - Production
DECLARE
v_blob temp.blob_column%TYPE;------this is blob data type column contains (CSV file which is inserted from screens)
v_clob CLOB; --i want to copy blob column data into this clob
v_warning NUMBER;
BEGIN
SELECT blob_column
INTO v_blob
FROM temp
WHERE pk = 75000676;
DBMS_LOB.converttoclob (dest_lob => v_clob,
src_blob => v_blob,
amount => DBMS_LOB.lobmaxsize,
dest_offset => 1,
src_offset => 1,
blob_csid => 1, -- what is the use of this parameter
lang_context => 1,
warning => v_warning
DBMS_OUTPUT.put_line (v_warning);
EXCEPTION
WHEN OTHERS
THEN
DBMS_OUTPUT.put_line (SQLCODE);
DBMS_OUTPUT.put_line (SQLERRM);
END;I am not getting what is the use of blob_csid , lang_context parameters after going the trough the documentation .
Any help in this regard would be highly appreciated .......
Thanks
Edited by: prakash on Feb 5, 2012 11:41 PM
Post the 4 digit Oracle version.
Did you read the Doc for DBMS_LOB.CONVERTTOCLOB? - http://docs.oracle.com/cd/B28359_01/appdev.111/b28419/d_lob.htm
The function can convert data from one character set to another. If the source data uses a different character set than the target you need to provide the character set id of the source data.
The blob_csid parameter is where you would provide the value for the source character set.
If the source and target use the same character set then just pass zero. Your code is passing a one.
>
General Notes
You must specify the character set of the source data in the blob_csid parameter. You can pass a zero value for blob_csid. When you do so, the database assumes that the BLOB contains character data in the same character set as the destination CLOB.
>
Same for 'lang_context' - your code is using 1; just use 0. It is an IN OUT
>
lang_context
(IN) Language context, such as shift status, for the current conversion.
(OUT) The language context at the time when the current conversion is done.
This information is returned so you can use it for subsequent conversions without losing or misinterpreting any source data. For the very first conversion, or if do not care, use the default value of zero.
Similar Messages
-
How to convert BLOB data into string format.
Hi,
I have problem while converting blob data into string format.
for example,
Select dbms_lob.substr(c.shape.Get_wkb(),4000,1) from geotable c
will get me the first 4000 byte of BLOB .
When i using SQL as i did above,the max length is 4000, but i can get 32K using plsql as below:
declare
my_var CLOB;
BEGIN
for x in (Select X from T)
loop
my_var:=dbms_lob.substr(x.X,32767,1)
end loop
return my_var;
I comfortably convert 32k BLOB field to string.
My problem is how to convert blob to varchar having size more than 32K.
Please help me to resolve this,
Thanx in advance for the support,
NileshNilesh,
. . . .The result of get_wkb() will not be human readable (all values are encoded into some binary format).
SELECT utl_raw.cast_to_varchar2(tbl.geometry.get_wkt()) from FeatureTable tbl;
-- resulting string:
☺AW(⌂özßHAA
Å\(÷. . . .You may also want to have a look at { dbms_lob | http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_lob.htm#i1015792 } "The DBMS_LOB package provides subprograms to operate on BLOBs, CLOBs, NCLOBs, BFILEs, and temporary LOBs."
Regards,
Noel -
How to convert XMLTYPE data into CLOB without using getclobval()
Please tell me how to convert data which is stored in the table in XMLTYPE column to a CLOB.
When i use getClobVal(), i get an error. So please tell me some other option except getClobVal()CREATE OR REPLACE PACKAGE BODY CONVERT_XML_TO_HTML AS
FUNCTION GENERATE_HTML(TABLE_NAME VARCHAR2, FILE_NAME VARCHAR2, STYLESHEET_QUERY VARCHAR2, WHERE_CLAUSE VARCHAR2, ORDERBY_CLAUSE VARCHAR2) RETURN CLOB IS
lHTMLOutput XMLType;
lXSL CLOB;
lXMLData XMLType;
FILEID UTL_FILE.FILE_TYPE;
HTML_RESULT CLOB;
SQL_QUERY VARCHAR2(300);
WHERE_QUERY VARCHAR2(200);
fileDirectory VARCHAR2(100);
slashPosition NUMBER;
actual_fileName VARCHAR2(100);
XML_HTML_REF_CUR_PT XML_HTML_REF_CUR;
BEGIN
IF WHERE_CLAUSE IS NOT NULL AND ORDERBY_CLAUSE IS NOT NULL THEN
SQL_QUERY := 'SELECT * FROM ' || TABLE_NAME ||' WHERE ' || WHERE_CLAUSE || ' ORDER BY ' || ORDERBY_CLAUSE;
ELSE IF WHERE_CLAUSE IS NOT NULL AND ORDERBY_CLAUSE IS NULL THEN
SQL_QUERY := 'SELECT * FROM ' || TABLE_NAME || ' WHERE ' || WHERE_CLAUSE;
ELSE IF WHERE_CLAUSE IS NULL AND ORDERBY_CLAUSE IS NOT NULL THEN
SQL_QUERY := 'SELECT * FROM ' || TABLE_NAME || ' ORDER BY ' || ORDERBY_CLAUSE;
ELSE IF WHERE_CLAUSE IS NULL AND ORDERBY_CLAUSE IS NULL THEN
SQL_QUERY := 'SELECT * FROM ' || TABLE_NAME;
END IF;
END IF;
END IF;
END IF;
OPEN XML_HTML_REF_CUR_PT FOR SQL_QUERY;
lXMLData := GENERATE_XML(XML_HTML_REF_CUR_PT);
--lXSL := GET_STYLESHEET(STYLESHEET_QUERY);
if(lXMLData is not null) then
dbms_output.put_line('lXMLData pass');
else
dbms_output.put_line('lXMLData fail');
end if;
lHTMLOutput := lXMLData.transform(XMLType(STYLESHEET_QUERY));
--INSERT INTO TEMP_CLOB_TAB2 VALUES(CLOB(lHTMLOutput));
if(lHTMLOutput is not null) then
dbms_output.put_line('lHTMLOutput pass');
else
dbms_output.put_line('lHTMLOutput fail');
end if;
HTML_RESULT := lHTMLOutput.getclobVal();
if(HTML_RESULT is not null) then
dbms_output.put_line('HTML_RESULT pass'||HTML_RESULT);
else
dbms_output.put_line('HTML_RESULT fail');
end if;
-- If the filename has been supplied ...
IF FILE_NAME IS NOT NULL THEN
-- locate the final '/' or '\' in the pathname ...
slashPosition := INSTR(FILE_NAME, '/', -1 );
IF slashPosition = 0 THEN
slashPosition := INSTR(FILE_NAME,'\', -1 );
END IF;
-- separate the filename from the directory name ...
fileDirectory := SUBSTR(FILE_NAME, 1,slashPosition - 1 );
actual_fileName := SUBSTR(FILE_NAME, slashPosition + 1 );
END IF;
DBMS_OUTPUT.PUT_LINE(fileDirectory||' ' ||actual_fileName);
FILEID := UTL_FILE.FOPEN(fileDirectory,actual_fileName, 'W');
UTL_FILE.PUT_LINE(FILEID, '<title> hi </title>');
UTL_FILE.PUT_LINE(FILEID, HTML_RESULT);
UTL_FILE.FCLOSE (FILEID);
DBMS_OUTPUT.PUT_LINE('CLOB SIZE'||DBMS_LOB.GETLENGTH(HTML_RESULT));
RETURN HTML_RESULT;
--RETURN lHTMLOutput;
EXCEPTION
WHEN OTHERS
THEN DBMS_OUTPUT.PUT_LINE('ERROR!!!!!!!!!!!!');
END GENERATE_HTML;
FUNCTION GENERATE_XML(XML_HTML_REF_CUR_PT XML_HTML_REF_CUR) RETURN XMLType IS
qryCtx DBMS_XMLGEN.ctxHandle;
result CLOB;
result1 xmltype;
BEGIN
qryCtx := DBMS_XMLGEN.newContext(XML_HTML_REF_CUR_PT);
result := DBMS_XMLGEN.getXML(qryCtx);
--dbms_output.put_line(result);
result1 := xmltype(result);
INSERT INTO temp_clob VALUES(result);
if(result1 is not null) then
dbms_output.put_line('pass');
else
dbms_output.put_line('fail');
end if;
return result1;
DBMS_XMLGEN.closeContext(qryCtx);
END GENERATE_XML;
END CONVERT_XML_TO_HTML;
This is the code which i am using to generate the XML and subsequently to generate the HTML output out of that using a XSL stylesheet.
The error is Numeric or value error.. -
How to import csv data into Oracle using c#
Hello,
How to import csv data into Oracle using c #. Where data to be imported 3GB in size and number of rows 7512263. I've managed to import csv data into Oracle, but the time it takes about 1 hour. How to speed up the time it takes to import csv data into oracle. Thank you.
This is my code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;
using System.Threading;
using System.Text.RegularExpressions;
using System.IO;
using FileHelpers;
using System.Data.OracleClient;
namespace sqlloader
class Program
static void Main(string[] args)
int jum;
int i;
bool isFirstLine = false;
FileHelperEngine engine = new FileHelperEngine(typeof(XL_XDR));
//Connect To Database
string constr = "Data Source=(DESCRIPTION=(ADDRESS_LIST="
+ "(ADDRESS=(PROTOCOL=TCP)(HOST= pt-9a84825594af )(PORT=1521 )))"
+ "(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=o11g)));"
+ "User Id=xl;Password=rahasia;";
OracleConnection con = new OracleConnection(constr);
con.Open();
// To Read Use:
XL_XDR[] res = engine.ReadFile("DataOut.csv") as XL_XDR[];
jum = CountLinesInFile("DataOut.csv");
FileInfo f2 = new FileInfo("DataOut.csv");
long s2 = f2.Length;
int jmlRecord = jum - 1;
for (i = 0; i < jum; i++)
ShowPercentProgress("Processing...", i, jum);
Thread.Sleep(100);
if (isFirstLine == false)
isFirstLine = true;
else
string sql = "INSERT INTO XL_XDR (XDR_ID, XDR_TYPE, SESSION_START_TIME, SESSION_END_TIME, SESSION_LAST_UPDATE_TIME, " +
"SESSION_FLAG, VERSION, CONNECTION_ROW_COUNT, ERROR_CODE, METHOD, HOST_LEN, HOST, URL_LEN, URL, CONNECTION_START_TIME, " +
"CONNECTION_LAST_UPDATE_TIME, CONNECTION_FLAG, CONNECTION_ID, TOTAL_EVENT_COUNT, TUNNEL_PAIR_ID, RESPONSIVENESS_TYPE, " +
"CLIENT_PORT, PAYLOAD_TYPE, VIRTUAL_TYPE, VID_CLIENT, VID_SERVER, CLIENT_ADDR, SERVER_ADDR, CLIENT_TUNNEL_ADDR, " +
"SERVER_TUNNEL_ADDR, ERROR_CODE_2, IPID, C2S_PKTS, C2S_OCTETS, S2C_PKTS, S2C_OCTETS, NUM_SUCC_TRANS, CONNECT_TIME, " +
"TOTAL_RESP, TIMEOUTS, RETRIES, RAI, TCP_SYNS, TCP_SYN_ACKS, TCP_SYN_RESETS, TCP_SYN_FINS, EVENT_TYPE, FLAGS, TIME_STAMP, " +
"EVENT_ID, EVENT_CODE) VALUES (" +
"'" + res.XDR_ID + "', '" + res[i].XDR_TYPE + "', '" + res[i].SESSION_START_TIME + "', '" + res[i].SESSION_END_TIME + "', " +
"'" + res[i].SESSION_LAST_UPDATE_TIME + "', '" + res[i].SESSION_FLAG + "', '" + res[i].VERSION + "', '" + res[i].CONNECTION_ROW_COUNT + "', " +
"'" + res[i].ERROR_CODE + "', '" + res[i].METHOD + "', '" + res[i].HOST_LEN + "', '" + res[i].HOST + "', " +
"'" + res[i].URL_LEN + "', '" + res[i].URL + "', '" + res[i].CONNECTION_START_TIME + "', '" + res[i].CONNECTION_LAST_UPDATE_TIME + "', " +
"'" + res[i].CONNECTION_FLAG + "', '" + res[i].CONNECTION_ID + "', '" + res[i].TOTAL_EVENT_COUNT + "', '" + res[i].TUNNEL_PAIR_ID + "', " +
"'" + res[i].RESPONSIVENESS_TYPE + "', '" + res[i].CLIENT_PORT + "', '" + res[i].PAYLOAD_TYPE + "', '" + res[i].VIRTUAL_TYPE + "', " +
"'" + res[i].VID_CLIENT + "', '" + res[i].VID_SERVER + "', '" + res[i].CLIENT_ADDR + "', '" + res[i].SERVER_ADDR + "', " +
"'" + res[i].CLIENT_TUNNEL_ADDR + "', '" + res[i].SERVER_TUNNEL_ADDR + "', '" + res[i].ERROR_CODE_2 + "', '" + res[i].IPID + "', " +
"'" + res[i].C2S_PKTS + "', '" + res[i].C2S_OCTETS + "', '" + res[i].S2C_PKTS + "', '" + res[i].S2C_OCTETS + "', " +
"'" + res[i].NUM_SUCC_TRANS + "', '" + res[i].CONNECT_TIME + "', '" + res[i].TOTAL_RESP + "', '" + res[i].TIMEOUTS + "', " +
"'" + res[i].RETRIES + "', '" + res[i].RAI + "', '" + res[i].TCP_SYNS + "', '" + res[i].TCP_SYN_ACKS + "', " +
"'" + res[i].TCP_SYN_RESETS + "', '" + res[i].TCP_SYN_FINS + "', '" + res[i].EVENT_TYPE + "', '" + res[i].FLAGS + "', " +
"'" + res[i].TIME_STAMP + "', '" + res[i].EVENT_ID + "', '" + res[i].EVENT_CODE + "')";
OracleCommand command = new OracleCommand(sql, con);
command.ExecuteNonQuery();
Console.WriteLine("Successfully Inserted");
Console.WriteLine();
Console.WriteLine("Number of Row Data: " + jmlRecord.ToString());
Console.WriteLine();
Console.WriteLine("The size of {0} is {1} bytes.", f2.Name, f2.Length);
con.Close();
static void ShowPercentProgress(string message, int currElementIndex, int totalElementCount)
if (currElementIndex < 0 || currElementIndex >= totalElementCount)
throw new InvalidOperationException("currElement out of range");
int percent = (100 * (currElementIndex + 1)) / totalElementCount;
Console.Write("\r{0}{1}% complete", message, percent);
if (currElementIndex == totalElementCount - 1)
Console.WriteLine(Environment.NewLine);
static int CountLinesInFile(string f)
int count = 0;
using (StreamReader r = new StreamReader(f))
string line;
while ((line = r.ReadLine()) != null)
count++;
return count;
[DelimitedRecord(",")]
public class XL_XDR
public string XDR_ID;
public string XDR_TYPE;
public string SESSION_START_TIME;
public string SESSION_END_TIME;
public string SESSION_LAST_UPDATE_TIME;
public string SESSION_FLAG;
public string VERSION;
public string CONNECTION_ROW_COUNT;
public string ERROR_CODE;
public string METHOD;
public string HOST_LEN;
public string HOST;
public string URL_LEN;
public string URL;
public string CONNECTION_START_TIME;
public string CONNECTION_LAST_UPDATE_TIME;
public string CONNECTION_FLAG;
public string CONNECTION_ID;
public string TOTAL_EVENT_COUNT;
public string TUNNEL_PAIR_ID;
public string RESPONSIVENESS_TYPE;
public string CLIENT_PORT;
public string PAYLOAD_TYPE;
public string VIRTUAL_TYPE;
public string VID_CLIENT;
public string VID_SERVER;
public string CLIENT_ADDR;
public string SERVER_ADDR;
public string CLIENT_TUNNEL_ADDR;
public string SERVER_TUNNEL_ADDR;
public string ERROR_CODE_2;
public string IPID;
public string C2S_PKTS;
public string C2S_OCTETS;
public string S2C_PKTS;
public string S2C_OCTETS;
public string NUM_SUCC_TRANS;
public string CONNECT_TIME;
public string TOTAL_RESP;
public string TIMEOUTS;
public string RETRIES;
public string RAI;
public string TCP_SYNS;
public string TCP_SYN_ACKS;
public string TCP_SYN_RESETS;
public string TCP_SYN_FINS;
public string EVENT_TYPE;
public string FLAGS;
public string TIME_STAMP;
public string EVENT_ID;
public string EVENT_CODE;
I hope someone can give me a solution. ThanksThe fastest way is to use external tables or sql loader (sqlldr). (If you use external tables or sql loader, you don't use C# at all).
-
How to convert system Date into DD-MMM-YYYY Format
hi friends,
please help me How to convert system Date into DD-MMM-YYYY Format.
Regards
YogeshHI..
data: w_dt(11) type c,
w_month(2),
w_mon(3).
w_month = p_date+4(2). **p_date = given date**
case w_month.
when '01'.
w_mon = 'Jan'.
when '02'.
w_mon = 'Feb'.
when '03'.
w_mon = 'Mar'.
when '04'.
w_mon = 'Apr'.
when '05'.
w_mon = 'May'.
when '06'.
w_mon = 'Jun'.
when '07'.
w_mon = 'Jul'.
when '08'.
w_mon = 'Aug'.
when '09'.
w_mon = 'Sep'.
when '10'.
w_mon = 'Oct'.
when '11'.
w_mon = 'Nov'.
when '12'.
w_mon = 'Dec'.
endcase.
Now...
concatenate p_date6(2) '-' w_mon '-' p_date0(4) into w_dt.
write w_dt. -
How to write the data into EEPROM using Labview?
How to write the data into EEPROM using Labview?
You would need some sort of EEPROM programmer. Typically might
communicate with it via serial. I don't know how you would do this in
LV. You would need to have the command protocol for the programming
device to start with.
Doug De Clue
gpibssx wrote in message news:<[email protected]>...
> How to write the data into EEPROM using Labview? -
How to load blob data into table
hi
i have a table with
ID NUMBER No - 1
PARENT_ID NUMBER No - -
DOCUMENT BLOB Yes - -
NAME VARCHAR2(40) Yes - -
MIMETYPE VARCHAR2(40) Yes - -
COMMENTS VARCHAR2(400) Yes - -
TIMESTAMP_CREATED TIMESTAMP(6) Yes - -
CREATED_BY VARCHAR2(40) Yes - -
TIMESTAMP_MODIFIED TIMESTAMP(6) Yes - -
MODIFIED_BY CHAR(40) Yes - -
IS_GROUP CHAR(1) No - -
FILE_NAME VARCHAR2(4000) Yes - -
as columns. i want to insert blob data into the empty table.i have some fields in the form through which i insert data by hard coding in a process.when i upload a document in the filebrowse type field the mime type is not updating though i have written code in the source value. i removed the database links of the form with the table and that is why i am hard coding to the table thru a process. could u suggest a query where i can insert the blolb data.
i use the process
begin
select max(ID) into aaa from "PSA_KNOWLEDGE_TREE";
insert into PSA_KNOWLEDGE_TREE values(aaa+1,1,null,:p126_NEW_GROUP,null,:p126_COMMENTS,:P126_TIMESTAMP_CREATED,:P126_CREATED_BY,null,null,'Y',null);could u please type the query according to my table and process requirements. i have tried many queries and i have failed to load the blob data. the imetype is not being updated.
thnx for ur reply -
How to convert julian Date into Calendar Date
Hi,
I want convert julian Date to calendar Date (mm/dd/yyyy or mm/dd/yy format) in java.
Can any one help me how to convert julian date to calendar Date.
Thanks,
Krishore.import java.util.*;
import java.text.*;
public class jdate {
Calendar date;
public jdate(int j)
date = Calendar.getInstance();
date.set(Calendar.DAY_OF_YEAR, j);
public String toString()
SimpleDateFormat formatter = new SimpleDateFormat("MM/dd/yyyy");
return (formatter.format( date.getTime() ));
public static void main(String args[])
if(args.length == 1)
int j = Integer.parseInt(args[0]);
jdate julian = new jdate(j);
System.out.println("Julian date(" + j + ") = " + julian.toString());
} -
How to convert XML data into binary data (opaque data)
Hi,
I am trying to develop a process that delivers files after reading data from a database.
However, it is required not to deliver the data immediately. We want to perform some checks before the files get written.
So the way we want to design this is,
1. Read data from database (or any other input). The data is in XML format (this is a requirement, as in general, we have xml data)
2. This data is written, opaquely, to a JMS queue that can store binary data, along with what is the filename of the file that would be written (filename is passed using JMS Headers)
3. When required, another process reads the JMS queue's binary data, and dumps into a file
The reason I want to use opaque data while inserting in the JMS queue is, that enables me to develop a single process in Step 3 that can write any file, irrespective of the format.
My questions are
1. How to convert the xml data to opaque data. In BPEL I may use a embedded java, but how about ESB. Any other way....?
2. how to pass filename to the jms queue, when payload is opaque. Can I use a header attribute...custom attributes?
3. Which jms message type is better for this kind of requirement - SYS.AQ$_JMS_BYTES_MESSAGE or SYS.AQ$_JMS_STREAM_MESSAGEAna,
We are doing the same thing--using one variable with the schema as the source of the .xsl and assigning the resulting html to another variable--the content body of the email, in our case. I just posted how we did it here: Re: Using XSLT to generate the email HTML body
Let me know if this helps. -
How to convert excel data into OTF and FAX
Hi All,
We have a requirement where in we have a smartform output (OTF data) converted into PDF, and an excel sheet, both being sent as email attachments.
Now, we need to send the content of both the attachments as FAX.
Since smartform output was OTF convertible, FAX was being sent using 'CONVERT_OTF_AND_FAX' FM.
Can you let me know, if there is a possible way for manipulating the data that is converted to EXCEL, as OTF, and then FAX it?
Or else, please suggest me an alternative way to FAX normal data (other than using 'CONVERT_OTF_AND_FAX').
Thanks in advance,
RAVIHi All,
We have a requirement where in we have a smartform output (OTF data) converted into PDF, and an excel sheet, both being sent as email attachments.
Now, we need to send the content of both the attachments as FAX.
Since smartform output was OTF convertible, FAX was being sent using 'CONVERT_OTF_AND_FAX' FM.
Can you let me know, if there is a possible way for manipulating the data that is converted to EXCEL, as OTF, and then FAX it?
Or else, please suggest me an alternative way to FAX normal data (other than using 'CONVERT_OTF_AND_FAX').
Thanks in advance,
RAVI -
How to convert PDF file into binary using APIs of Adobe Workflow server?
I m using the Adobe Workflow Server 6.2. I want to write a web services to convert PDF file into binary and embed this binary data with XML.
I want to use the APIs (or libraries) of Adobe Workflow server but dont know abt the APIs or Libraries that can convert the PDF file into binary format.
I will be very thankful to u,if u can help me as i m n this prblm frm the last one week.I tried alot but could nt find the solution.
waiting for a better response.check objectlibrary.pdf
Dim o As New EPSDK.BinaryData
o.LoadFromFile(sfilename)
write o.Value to xml -
How to convert row data into columns without using pivot table?
Hello guys
I have a report that has several columns about sales call type and call counts
It looks like this:
Calls Type Call Counts
Missed 200
Handled 3000000
Rejected 40000
Dropped 50000
Now I wanna create a report that look like this:
Missed call counts Handled Call counts Rejected Counts Drop counts Other Columns
200 300000000 40000 50000 Data
So that I can perform other calculations on the difference and comparison of handled calls counts vs other call counts..
I know pivot table view can make the report look like in such way, but they cant do further calculations on that..
So I need to create new solid columns that capture call counts based on call types..
How would I be able to do that on Answers? I don't have access to the RPD, so is it possible to do it sololy on answers? Or should I just ask ETL support on this?
Any pointers will be deeply appreciated!
Thank youThanks MMA
I followed your guidance and I was able to create a few new columns of call missed count, call handled counts and call abandoned counts.. Then I create new columns of ave missed counts, ave handled counts and so forth..
Then I went to the pivot view, I realized there is a small problem.. Basically the report still includes the column "call types" which has 3 different types of call "miss, abandon and handled". When I exclude this column in my report, the rest of the measures will return wrong values. When I include this column in the report, it shows duplicate values by 3 rows. It looks like this:
Queue name Call types Call handled Call missed Call abondoned
A Miss 8 10 15
A Handled 8 10 15
A Abandoned 8 10 15
in pivot table view, if I move call type to column area, the resulted measures will become 8X3, 10X3 and 15X3
So is there a way to eliminate duplicate rows or let the system know not to mulitply by 3?
Or is this as far as presentation service can go in terms of this? Or should I advice to provide better data from the back end?
Please let me know, thanks -
How to convert raw data into pdf ?
Hi everyone,
I have a requirement where I have to print the document present in application server.
I used below code to do this
* Open the file in binary mode
OPEN DATASET gv_filepath FOR INPUT IN TEXT MODE ENCODING DEFAULT IGNORING CONVERSION ERRORS.
DO.
TRY.
* Since the file is opened in Binary mode, the entire contents of the
* file is read in one go!
READ DATASET gv_filepath INTO gv_filedata.
IF sy-subrc <> 0.
EXIT.
ENDIF.
CATCH cx_sy_conversion_codepage.
ENDTRY.
APPEND gv_filedata TO gt_file_table.
CLEAR gv_filedata.
ENDDO.
CLOSE DATASET gv_filepath.
DESCRIBE TABLE gt_file_table LINES lv_lines.
lv_pages = lv_lines.
lv_dest = 'LP01'.
lv_spoolname = 'LOCW'.
CALL FUNCTION 'RSPO_SX_OUTPUT_TEXTDATA'
EXPORTING
* NAME = lv_spoolname
DEST = lv_dest
ROWS = lv_lines
STARTROW = 1
PAGES = 99
RQTITLE = 'Print Spool'
RQCOPIES = 1
RQOWNER = sy-uname
IMMEDIATELY = ' '
IMPORTING
RQID = lv_spoolid
TABLES
TEXT_DATA = gt_file_table
EXCEPTIONS
NAME_MISSING = 1
NAME_TWICE = 2
NOT_FOUND = 3
ILLEGAL_LAYOUT = 4
INTERNAL_ERROR = 5
SIZE_MISMATCH = 6
OTHERS = 7.
IF SY-SUBRC <> 0.
* Implement suitable error handling here
ENDIF.
Passed the spool id generated to below FM but it is not converting into pdf
CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
EXPORTING
SRC_SPOOLID = lv_spoolid
NO_DIALOG = ' '
DST_DEVICE = 'LOCW'
PDF_DESTINATION = 'X'
* NO_BACKGROUND =
* GET_SIZE_FROM_FORMAT =
* USE_CASCADING = ' '
* IMPORTING
* PDF_BYTECOUNT = lv_bytecount
* PDF_SPOOLID = lv_pdf1
* LIST_PAGECOUNT =
* BTC_JOBNAME =
* BTC_JOBCOUNT =
* BIN_FILE = lv_pdf
TABLES
PDF = lt_pdf
EXCEPTIONS
ERR_NO_ABAP_SPOOLJOB = 1
ERR_NO_SPOOLJOB = 2
ERR_NO_PERMISSION = 3
ERR_CONV_NOT_POSSIBLE = 4
ERR_BAD_DESTDEVICE = 5
USER_CANCELLED = 6
ERR_SPOOLERROR = 7
ERR_TEMSEERROR = 8
ERR_BTCJOB_OPEN_FAILED = 9
ERR_BTCJOB_SUBMIT_FAILED = 10
ERR_BTCJOB_CLOSE_FAILED = 11
OTHERS = 12
IF SY-SUBRC <> 0.
* Implement suitable error handling here
ENDIF.
When I go to SP01 and check the spool generated it is in raw document type.
How can I convert this raw document to pdf type ??
Please help me to resolve this.
Regards,
KrishnaOk, since I can't edit the post anymore, here the new version of code, without the use of SCMS_XSTRING_TO_BINARY for intermediate table. Reasons: effectively doubles the memory use and I don't want to check if the kernel is cutting off the hexdecimal nulls when the last spool line is written, or to relay of that behaviour.
Matthew Billingham, and other mods: it would be really nice if you could hide the old version please (this post here). The number of google results for that FM is scary and I really don't want to contribute to promoting its use...
REPORT zjbtst2.
PARAMETERS: p_file TYPE string
LOWER CASE
DEFAULT '/usr/sap/....'
OBLIGATORY.
PARAMETERS: p_dest TYPE rspopname
DEFAULT 'LP01'
OBLIGATORY .
PERFORM main USING p_file p_dest.
*& Form main
FORM main
USING
i_file TYPE string
i_dest TYPE rspopname.
DATA: lo_handle TYPE REF TO cl_rspo_spool_handle .
DATA: l_spoolid TYPE rspoid.
DATA: l_content TYPE xstring .
DATA: l_message_text TYPE string .
PERFORM get_file USING i_file CHANGING l_content .
PERFORM new_spool USING i_dest CHANGING lo_handle l_spoolid.
PERFORM write_spool USING lo_handle l_spoolid l_content .
l_message_text = |Spool { l_spoolid } created| .
MESSAGE l_message_text TYPE 'I' .
ENDFORM . "main
*& Form get_file
FORM get_file
USING i_file TYPE string
CHANGING c_content TYPE xstring.
DATA: l_message_text TYPE string .
CLEAR c_content .
OPEN DATASET i_file FOR INPUT IN BINARY MODE
MESSAGE l_message_text.
IF sy-subrc NE 0 .
MESSAGE l_message_text TYPE 'E' .
ELSE.
READ DATASET i_file INTO c_content .
CLOSE DATASET i_file.
ENDIF .
ENDFORM . "get_file
*& Form new_spool
FORM new_spool
USING
i_destination TYPE rspopname
CHANGING
co_handle TYPE REF TO cl_rspo_spool_handle
c_spoolid TYPE rspoid .
cl_rspo_spool_handle=>open(
EXPORTING
dest = i_destination
name = 'Test'
layout = 'G_RAW'
doctype = 'BIN'
IMPORTING
ref = co_handle
spoolid = c_spoolid
EXCEPTIONS
device_missing = 1
name_twice = 2
no_such_device = 3
operation_failed = 4
OTHERS = 5
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM . "new_spool
*& Form WRITE_SPOOL
FORM write_spool
USING
io_handle TYPE REF TO cl_rspo_spool_handle
i_spoolid TYPE rspoid
i_content TYPE xstring .
DATA: l_buffer(128) TYPE x ."Hmm, 128 does work, 4096 doesn't...
DATA: l_buffer_length TYPE i .
DATA: l_full_buffers_count TYPE i .
DATA: l_part_buffer_length TYPE i .
DATA: l_offset TYPE i .
DATA: l_length TYPE i .
l_buffer_length = xstrlen( l_buffer ) .
l_full_buffers_count = xstrlen( i_content ) DIV l_buffer_length .
l_part_buffer_length = xstrlen( i_content ) MOD l_buffer_length .
DO l_full_buffers_count + 1 TIMES .
IF sy-index LE l_full_buffers_count .
l_length = l_buffer_length .
ELSEIF l_part_buffer_length GT 0 .
l_length = l_part_buffer_length .
ELSE.
EXIT .
ENDIF .
l_buffer = i_content+l_offset(l_length) .
ADD l_length TO l_offset .
io_handle->write_binary(
EXPORTING
data = l_buffer
length = l_length
EXCEPTIONS
not_open = 1
operation_failed = 2
OTHERS = 3
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDDO .
io_handle->close(
EXPORTING
final = 'X'
EXCEPTIONS
operation_failed = 1
already_closed = 2
OTHERS = 3
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM . "write_spool -
How to convert labview data into opc tag
Hi all,
Can any one please tell me how i can convert the labview data global into a OPC tag? I have some data globals reading and writing data to the globals. Now i wanted to use a PLC device to send its outputs to the field.
The PLC device will supports the OPC tags so i wanted t create OPC recognised tags in my labview. Is it possible. I saw that labview also having OPC functinalities. Please any one guide me in doing this.
I will be very thankful to them
Ramme..As I said, I believe you can do this for globals as well by opening its front panel (double click the global) and using a DS connection for the control that represents that specific global.
As for other alternatives:
NI sells the DSC module which comes with an OPC server and with better tags.
You can use a common protocol like Modbus to interact with the PLC.
You can use the custom protocol used by the PLC.
The last two would require that you would change your program structure, so you would only want to use them under certain conditions.
I believe the practical limit for OPC tags with DS is a few hundred tags, but I never used it myself so I didn't run into it. You can try searching the forums to find out more.
Try to take over the world! -
How to convert exponential data into number for the downloaded excelsheet
Hi
I have downloaded one field data i.e. having char of 50, into excel sheet and it is displaying as exponential in the excel sheet.
The data numbers should display as text only i.e 1236547896321 and not exponential
Is anyone can tell how we can do this
Thanks
PallaviHello Pallvai,
The problem of exponential is with the excel. Excel converts the large numbet into exponential.
To avoid this you can make the number into text then excel won't convert it into exponential.
For that you can do a simple trick. Just prefix a single quote ( ' ) in the field.
eg:
field = 1236547896321.
then,
constants c_quote type c value '''. "<-- single quote
concatenate c_quote field into field.
" This will make the EXCEL to consider this field as text not number and hence it will not be considered
" as exponential.
Hope this solves your problem.
Regards,
Sachinkumar Mehta
Maybe you are looking for
-
File Adapter: Target directory does not exist
Hi All, Using RFC to File Scenario. While processing in File adapter, i get following error for the target directory. Delivering the message to the application using connection File_http://sap.com/xi/XI/System failed, due to: com.sap.engine.interface
-
G5 shuts down when Portable external drive connected to Fire wire port
Hi, I hope somebody can help me. I have a 100G lacie portable external HD that I use to back up my files regularly. It worked until today, I plug it in, I was able to save some files, and then the computer shut down. I restarted it and it did the sam
-
Hi friends, I need to display two pushbuttons and two parameters on the selection screen, when I click one push button I have to display one parameter and hide the another parameter,same with the second pushbutton.Please give me some sample code. sat
-
Assign file creating problem in BAPI LSMW
Hello Experts! Iu2019m trying to upload PO (Header/Item data) though BAPI Method. Iu2019ve one file having Header and Item data. At Assign Files Step when I try to assign file to PO Item Data. System gives me a message (File 'C:\MySAP\ABAP Programing
-
Please increase the call log history !! Its really important
Increasing the call log would add a great benifit to the iphone, You can add this feature as an option, and it can be used if needed. Thank you