SPArrayAccess example display string as binary code,Why!!
Hi!
Anyone knows?
I just run this oracle example SPArrayAccess to display a db VARRAY using java
callerable statement, everything works except the the program tries to print the varray
values (string) , but display the binary code for the string not the string itself.
What went wrong for this oracle example?
David
1 error has occurred
Invalid query, no select statement foundWhat if you try
DECLARE
p_vc_arr2 htmldb_application_global.vc_arr2;
p_string VARCHAR2 (2000);
BEGIN
SELECT ename
BULK COLLECT INTO p_vc_arr2
FROM emp
WHERE deptno = :p84_select_deptno;
return 'select ''' || HTMLDB_UTIL.table_to_string (p_vc_arr2, ':') || ''' str from dual';
END;??
Similar Messages
-
Displaying image from binary code
I am converting a image file(jpg) into a binary file and sending it. In the receiving side i get the binary file and want to display the image in the applet or store the image in a file. while trying to do this i am not able to read the image from the buffer. Below here i have given my code.
File f= new File("image.jpg");
FileInputStream fis = new FileInputStream(f);
byte [] buffer = new byte[(int)f.length()];
fis.read(buffer,0,buffer.length);
fis.close();
File f1 = new File("input.txt");
int length = buffer.length;
PrintWriter pw;
pw = new PrintWriter(new BufferedWriter(new FileWriter(f1)));
for(int i=0;i<length;i++)
pw.println(Integer.toBinaryString(buffer));
pw.flush();
pw.close();
converting back to image i get error
File f1 = new File("inp.txt");
FileInputStream fis = new FileInputStream(f1);
buffer = new byte[(int)f1.length()];
fis.read(buffer,0,buffer.length);
Toolkit tk = Toolkit.getDefaultToolkit();
img = tk.createImage(buffer);
Reply me as early as possible.thanks.You have two glaring problems here.
Firstly, you are writing via writers, which are intended for text and are probably corrupting your data. You want to be using a FileOutputStream.
Secondly, when reading in you are not checking the number of bytes read and may well not be fully populating your array. You want to change your reading code to something like this,
buffer = new byte[(int)f1.length()];
int read = 0;
while (f1.available() > 0)
read += fis.read(buffer, read, buffer.length - read);
} -
Display image from binary code in web service(Sharepoint portal)
Hi All,
We have converted a BAPI into web service.We are able to access it and fetch the data in sharepoint portal. The content which gets published in the sharepoint needs one image also to get displayed.The problem is we have the binary format but we are not able to decode that and display that as image in sharepoint portal.
We are using VS2003 to make the portal component and then deploy it in sharepoint portal.We are stuck how to decode the binary format and display the image.
Any Help will be appreicated.
Regards
SachinHi All,
We have converted a BAPI into web service.We are able to access it and fetch the data in sharepoint portal. The content which gets published in the sharepoint needs one image also to get displayed.The problem is we have the binary format but we are not able to decode that and display that as image in sharepoint portal.
We are using VS2003 to make the portal component and then deploy it in sharepoint portal.We are stuck how to decode the binary format and display the image.
Any Help will be appreicated.
Regards
Sachin -
How to display the binary code received from a DAQ Card
Hi everybody,
My LabVIEW application receives data from a NI-6036E DAQ Card. Is there a possibility to see the binary code sent by the card? Because all what I found show only the analog value.
Thanks for your helpAssuming that you are using DAQmx, simply select the polymorphic selector of the DAQmx Read and do a Analog>Unscaled and then pick the type of integer array you want. If you are using the DAQ Assistant, I don't think you can select unscaled for that so you could convert the assistant to a VI and modify that (right click on it and select Open Front Panel). If you are not using DAQmx, please provide the name of the function you are using.
Message Edited by Dennis Knutson on 01-08-2007 08:31 AM
Attachments:
Select binary format.PNG 4 KB -
Hi,
can any anyone give me a solution for this.It is pretty old /famous error
http://dimantdatabasesolutions.blogspot.co.il/2008/08/string-or-binary-data-would-be.html
Best Regards,Uri Dimant SQL Server MVP,
http://sqlblog.com/blogs/uri_dimant/
MS SQL optimization: MS SQL Development and Optimization
MS SQL Consulting:
Large scale of database and data cleansing
Remote DBA Services:
Improves MS SQL Database Performance
SQL Server Integration Services:
Business Intelligence -
I am facing a strange SQL exception:-
The code flow is like this:
.Net 4.0 --> Entity Framework --> SQL 2008 ( StoredProc --> Function {Exception})
In the SQL Table-Valued Function, I am selecting a column (nvarchar(50)) from an existing table and (after some filtration using inner joins and where clauses) inserting the values in a Table Type Object having a column (nvarchar(50))
This flow was working fine in SQL 2008 but now all of sudden the Insert into @TableType is throwing "string or binary data would be truncated" exception.
Insert Into @ObjTableType
Select * From dbo.Table
The max length of data in the source column is 24 but even then the insert statement into nvarchar temp column is failing.
Moreover, the same issue started coming up few weeks back and I was unable to find the root cause, but back then it started working properly after few hours
(issue reported at 10 AM EST and was automatically resolved post 8 PM EST). No refresh activity was performed on the database.
This time however the issue is still coming up (even after 2 days) but is not coming up in every scenario. The data set, for which the error is thrown, is valid and every value in the function is fetched from existing tables.
Due to its sporadic nature, I am unable to recreate it now :( , but still unable to determine why it started coming up or how can i prevent such things to happen again.
It is difficult to even explain the weirdness of this bug but any help or guidance in finding the root cause will be very helpful.
I also Tried by using nvarchar(max) in the table type object but it didn't work.
Here is a code similar to the function which I am using:
BEGIN
TRAN
DECLARE @PID
int = 483
DECLARE @retExcludables
TABLE
PID
int NOT
NULL,
ENumber
nvarchar(50)
NOT NULL,
CNumber
nvarchar(50)
NOT NULL,
AId
uniqueidentifier NOT
NULL
declare @PSCount int;
select @PSCount =
count('x')
from tblProjSur ps
where ps.PID
= @PID;
if (@PSCount = 0)
begin
return;
end;
declare @ExcludableTempValue table (
PID
int,
ENumber
nvarchar(max),
CNumber
nvarchar(max),
AId
uniqueidentifier,
SIds
int,
SCSymb
nvarchar(10),
SurCSymb
nvarchar(10)
with SurCSymbs as (
select ps.PID,
ps.SIds,
csl.CSymb
from tblProjSur ps
right
outer join tblProjSurCSymb pscs
on pscs.tblProjSurId
= ps.tblProjSurId
inner join CSymbLookup csl
on csl.CSymbId
= pscs.CSymbId
where ps.PID
= @PID
AssignedValues
as (
select psr.PID,
psr.ENumber,
psr.CNumber,
psmd.MetaDataValue
as ClaimSymbol,
psau.UserId
as AId,
psus.SIds
from PSRow psr
inner join PSMetadata psmd
on psmd.PSRowId
= psr.SampleRowId
inner join MetaDataLookup mdl
on mdl.MetaDataId
= psmd.MetaDataId
inner join PSAUser psau
on psau.PSRowId
= psr.SampleRowId
inner
join PSUserSur psus
on psus.SampleAssignedUserId
= psau.ProjectSampleUserId
where psr.PID
= @PID
and mdl.MetaDataCommonName
= 'CorrectValue'
and psus.SIds
in (select
distinct SIds from SurCSymbs)
FullDetails
as (
select asurv.PID,
Convert(NVarchar(50),asurv.ENumber)
as ENumber,
Convert(NVarchar(50),asurv.CNumber)
as CNumber,
asurv.AId,
asurv.SIds,
asurv.CSymb
as SCSymb,
scs.CSymb
as SurCSymb
from AssignedValues asurv
left outer
join SurCSymbs scs
on scs.PID
= asurv.PID
and scs.SIds
= asurv.SIds
and scs.CSymb
= asurv.CSymb
--Error is thrown at this statement
insert into @ExcludableTempValue
select *
from FullDetails;
with SurHavingSym as (
select distinct est.PID,
est.ENumber,
est.CNumber,
est.AId
from @ExcludableTempValue est
where est.SurCSymb
is not
null
delete @ExcludableTempValue
from @ExcludableTempValue est
inner join SurHavingSym shs
on shs.PID
= est.PID
and shs.ENumber
= est.ENumber
and shs.CNumber
= est.CNumber
and shs.AId
= est.AId;
insert @retExcludables(PID, ENumber, CNumber, AId)
select distinct est.PID,
Convert(nvarchar(50),est.ENumber)
ENumber,
Convert(nvarchar(50),est.CNumber)
CNumber,
est.AId
from @ExcludableTempValue est
RETURN
ROLLBACK
TRAN
I have tried by converting the columns and also validated the input data set for any white spaces or special characters.
For the same input data, it was working fine till yesterday but suddenly it started throwing the exception.Remember, the CTE isn't executing the SQL exactly in the order you read it as a human (don't get too picky about that statement, it's at least partly true enough to say it's partly true), nor are the line numbers or error messages easy to read: a mismatch
in any of the joins along the way leading up to your insert could be the cause too. I would suggest posting the table definition/DDL for:
- PSMetadata, in particular PSRowID, but just post it all
- tblProjectSur, in particularcolumns CSymbID and TblProjSurSurID
- cSymbLookup, in particular column CSymbID
- PSRow, in particular columns SampleRowID, PID,
- PSAuser and PSUserSur, in particualr all the USERID and RowID columns
- SurCSymbs, in particular colum SIDs
Also, a diagnostic query along these lines, repeat for each of your tables, each of the columns used in joins leading up to your insert:
Select count(asurv.sid) as count all
, count(case when asurv.sid between 0 and 9999999999 then 1 else null end) as ctIsaNumber
from SurvCsymb
The sporadic nature would imply that the optimizer usually chooses one path to the data, but sometimes others, and the fact that it occurs during the insert could be irrelevant, any of the preceding joins could be the cause, not the data targeted to be inserted. -
"String or binary data would be truncated" and field specifications
Hi all,
i have "String or binary data would be truncated" error when i try to execute an insert statment.
can i find witch field is affected by this error? (for return it to the user)
thank's allAs far as I am aware, there's no way to determine which column's length has been exceeded.
You should add code into your stored procedure to check the lengths of variables before inserting their values into your tables, raising an error if necessary - see the example below.
Again I stress that it would be better to modify the client application's code to either warn the user or to limit the number of characters they can enter into a field.
Chris
Code Snippet
--This batch will fail with the SQL Server error message
DECLARE @MyTable TABLE (MyID INT IDENTITY(1, 1), MyValue VARCHAR(10))
DECLARE @MyParameter VARCHAR(100)
--Create a string of 52 chars in length
SET @MyParameter = REPLICATE('Z', 52)
INSERT INTO @MyTable(MyValue)
VALUES (@MyParameter)
GO
--This batch will fail with a custom error message
DECLARE @MyTable TABLE (MyID INT IDENTITY(1, 1), MyValue VARCHAR(10))
DECLARE @MyParameter VARCHAR(100)
--Create a string of 52 chars in length
SET @MyParameter = REPLICATE('Z', 52)
IF LEN(@MyParameter) > 10
BEGIN
RAISERROR('You attempted to insert too many characters into MyTable.MyValue.', 16, 1)
RETURN
END
ELSE
BEGIN
INSERT INTO @MyTable(MyValue)
VALUES (@MyParameter)
END
GO -
Using definition in orcale binary code license agreement
using definition in oracle binary code license agreement for java se platform products:
G. COMMERCIAL FEATURES NOTICE. For purpose of complying with Supplemental Term Section C.(v)(b) and D.(v)(b), your license agreement shall include the following notice, where the notice is displayed in a manner that anyone using the Software will see the notice:
Use of the Commercial Features for any commercial or production purpose requires a separate license from Oracle. “Commercial Features” means those features identified Table 1-1 (Commercial Features In Java SE Product Editions) of the Software documentation accessible at http://www.oracle.com/technetwork/java/javase/documentation/index.html
anyone using the Software : What kind of using is meant? (For example installing?)hello,
thanks for your comment. please can you help me to find the correct forum.
perhaps as oracle employee you can put it there? -
How can I preserve display string (convert DOB to Age) upon excel export?
I am using the following code to convert DOB to age within Display String (Format Field/Common tab):
if
//months
(datediff('yyyy',{CDCLIENT.DOB},currentdate)-(if datepart('y',currentdate)>datepart('y',{CDCLIENT.DOB}) then 0 else 1))<2 then
totext(datediff('mm',{CDCLIENT.DOB},currentdate),0,'') & ' months'
else
//years
totext((datediff('yyyy',{CDCLIENT.DOB},currentdate)-(if datepart('y',currentdate)>datepart('y',{CDCLIENT.DOB}) then 0 else 1)),0,'') //& ' years'
When I export to excel/csv/ttx.. it doesn't export the display string (Age), but reverts back to the DOB. How do I preserve this upon export?Hi Dominic,
The 'display string' formatted values are not exported to Excel Data Only.
Create a 'formula field' as a workaround.
-Abhilash -
How to display string with XML content in 4.6?
Hi,
I`d like to know how to display string with XML content in it for 4.6.
4.6 has not method parse_string.
And example like this is not helpful:
DATA: lo_mxml TYPE REF TO cl_xml_document.
CREATE OBJECT lo_mxml.
CALL METHOD lo_mxml->parse_string
EXPORTING
stream = gv_xml_string.
CALL METHOD lo_mxml->display.
Thank you.Hi,
May be you can use fm SAP_CONVERT_TO_XML_FORMAT. But it have some issues with memory usage, the program consumed tons of memory during convert.
a® -
JEditorPane doesn�t display HTML special char. codes
My application is using JEditorPane to display text/html.
The problem comes when I try to display HTML special character codes such as
> JEditorPane ignores those codes and displays nothing.
Do I have to convert all those strings representing special characters?
How could I solve it?
Thanks in advance,
BrunoHere's my solution - I replace the HTMLEditorKit if it's not the first pass through. I found that the EditorKit is an instance of HTMLEditorKit for every pass except the first (which doesn't have a problem).
EditorKit ek = displayJEditorPane.getEditorKit();
if( ek instanceof HTMLEditorKit ) {
// Needs to be replaced
HTMLEditorKit htmlEditorKit = new HTMLEditorKit();
displayJEditorPane.setEditorKit( htmlEditorKit );
// Display the HTML document
displayJEditorPane.setPage( resultURL );I'll spread my Duke Dollars around to everyone who offered a suggestion later today if I don't hear of a better solution.
Thanks. -
Getting rid of leading zero using display string.
I have a formula:
If {BillHeader.SalesTax} < 0 then
formula = Replace(CStr (-1 * {BillHeader.SalesTax}), "$", "") + "CR"
else
formula = Replace(CStr ({BillHeader.SalesTax}), "$", "")
end if
I need to change this formula so it won't show a leading zero.
ex:
0.00 to .00
0.47CR to .47CR
etc..
I don't have much experience with VB or crystal code. Since this is in the display string I can't use the number formatting. Any ideas? Thanks for the help!Here is one solution:
1. Comment out the display string code.
2. From the menu, choose "Crystal Syntax".
3. Copy and paste this formula.
If currentfieldvalue < 0 then
if split(Replace(CStr (-1 * currentfieldvalue), "$", "") + "CR",'.')[1] = '0' then
'.' & split(Replace(CStr (-1 * currentfieldvalue), "$", "") + "CR",'.')[2]
else
Replace(CStr (-1 * currentfieldvalue), "$", "") + "CR"
else
if split(Replace(CStr (currentfieldvalue), "$", ""),'.')[1] = '0' then
'.' & split(Replace(CStr (currentfieldvalue), "$", ""),'.')[2]
else
Replace(CStr (currentfieldvalue), "$", "")
PS: In your first formula, you are using sales tax but in the second post, you are using amount due, not sure which one it is, but if the formula is on a display string the above should work. -
Web Reference inside Script Task causes Binary code for script not found error
I am attempting to access a SOAP web API (sales force) from a SSIS package. To do this I created a script task.
Inside the script task I went to Add Service Reference. Then I click advanced to make it a web reference. Then I point it to the WSDL file and give it a name SFEnterprise. It successfully finds and adds the Web Reference to the script task.
I leave scriptMain.cs alone and I have no warnrings and no errors. Now in the solution explorer I right-click the script task and hit BUILD. I see the message from Output that BUILD succeeded.
I close the VSTA script editor and now I am back on the control flow window. However I have a red X on the script task with the following message. "The Binary code for the script is not found. Please open the script in the designer by clicking EditScript
button and make sure it builds successfully"
But it does build successfully! And I have not even added any custom code except for the web reference using the WSDL file.
I am using SSIS 2012 and Visual Studio 2012. I have been reading about this binary code error message on Google searches and suggestions about delay validation and turning off pre-compile do not apply to SSIS 2012.
Is SSIS not capable of doing this?I was wanting to use the 2.0 coding style of accessing the soap service which is supported by adding the web reference vs. adding a service reference. But using a service reference instead of web reference actually allows the script task to compile. This
is really odd behavior. I wonder why one works and not the other.
Changing my C# code over to service reference coding style to access the SOAP service was still returning an error. When I added a break point I found the error message "Could not find default endpoint element that references contract in the ServiceModel
client configuration section"when calling new SoapClient();
I found this page http://www.sqlis.com/sqlis/post/Where-is-my-appconfig-for-SSIS.aspx and after I copied the System.ServiceModel app settings from the script task app.config to the DTSDebugHost.exe.config it was able to successfully login to the endpoint
during package debug mode.
This means I will have to edit the SQL Server DTS config files on the prod SSIS server to get the package to actually run in the job agent.
So for now I am good I think just plugging away at coding what the script task is actually supposed to do now that is can actually login. -
Synch Error: String or binary data would be truncated.
I kicked off an inital synch for WebTools 2007 (may also be an issue in 596) and I had 1 synch error for SBOPartner:
String or binary data would be truncated.
The statement has been terminated.
at netpoint.api.data.DataFunctions.Execute(String SQL, IDataParameter[] parameters, String connectionstring)
at netpoint.api.NPBase.MarkSynched(String SynchID)
at NetPoint.SynchSBO.SBOObjects.SBOPartner.SBOToNetPoint(SBOQueueObject qData)
at NetPoint.SynchSBO.SynchObjectBase.Synch()
I traced the sql log and found the problem was related to addresses. The synchid only allows 50 characters but my synchid was 51 characters (COMINF, Communication Infrastructure Corporation, S). Anyway, to fix I modified the table to allow 100 characters and reran the synch. I know an upgrade will set it back to 50 but at least it's working now.
I tried to post this to support as a bug but I couldn't figure out how (as usual) or the authorization stuff changed so I figured I would post it here so hopefully the devs will see this and update the code.
SteveThanks Shawn ... My version of Netpoint is 2007.0.620.0 and the synch manager is 2007.0.620.35247. I'm not sure what patch level this means I am on though.
Steve -
Purchased gift cards about a year ago. Misplaced two of them, but Found them yesterday. i tried to use one today. Invalid. If the money is tagged to the card code why is it invalid? Now have to take photos of both sides and find receipt? Finding the receipt might take as long as .finding the cards. If I paid hard earned money for the card from a computer company why would that card not be in their data base waiting to be activated? I guess I am out $20 to Apple for not activating immediately! My account was hacked once so I won't put a credit card in and live with gift cards. Now I am getting hit for $20, two gift cards for ten each. I now question who and how people are making money?? Is my only solution, buy card, redeem code instantly, purchase item?
Hi Oxfordataloss,
Thanks for posting. I'm really sorry you've had such problems with BT, it's certainly not the kind of service we would hope to provide. I'll take your comments on board and if you don't receive the final bill as expected please drop me an email with the account details and a link to this thread for reference.
Cheers
David
BTCare Community Mod
If we have asked you to email us with your details, please make sure you are logged in to the forum, otherwise you will not be able to see our ‘Contact Us’ link within our profiles.
We are sorry but we are unable to deal with service/account queries via the private message(PM) function so please don't PM your account info, we need to deal with this via our email account :-)
Maybe you are looking for
-
Cannot view SharePoint Online documents through CRM Online Outlook Connector - iframe error
We are integrating CRM 2013 Online with SharePoint 2013 Online. We have installed the CRM List Component solution. We have also modified the SharePoint master page to permit display of SharePoint content in iframes. We can view SharePoint documents w
-
Anybody know how I can link "page x" in a Pages document A to an exact copy of another "page x" in Pages document B, in such a way that when I'm working on "page x" in document A, those changes automatically occur on "page x" in document B? [i.e. - l
-
Multicolumn filtering in dashboards
Dear Expert's, I am stuck with a problem while designing my dasboard. I have data in the following format. Year - Quarter - Customer - Division - KF1 - KF2 2005 - Q1 - SAP - Consulting - 10 - 20 2005 - Q2 - IDE - Food - 20 - 10 2005 - Q2 - SAP - Jets
-
Password Manager 4.10 forced to foregound
I use Windows 7 Pro and a ThinkPad X230 One of the products i install is Thinkvantage Password manager 4.10. When I start Lotus Notes as a user the welcome and password prompt will appear. Behind that screen a TV Password Manager screen is displayed
-
2602 AP PoE comes up only after console cable is disconneted
HI... We have been struggling with PoE issues for sometime until we accidently came across what seems to be the problem. The equipment we are using are, Cisco WLC 5508 (w/HA WLC) ver 7.4.100.0 Cisco AP 2602 Cisco 4507 w/Poe module, 3560 24 port Poe,