How to store unicode into MS SQL 2000 via CMPs
Hi,
Our application uses EJB 2.0 and running on Weblogic 10.3 against MS SQL Server 2000 via i-net MERLIA driver.
Merlia driver supports unicode in two modes:
1. every string is handled as unicode - this causes performance issues unless all varchars are not converted to nvarchar (we want to convert only few of them)
2. driver needs to be explicitly instruct to store String as NString in order to store unicode.
Does anybody know how to configure entity descriptors to define some data fields as nvarchar/varchar resp. NString/String.
I do not have any problem to store unicode characters into DB via direct JDBC insert/update.
Thank you for your help.
Regards,
Milan
BLOB
http://www.microsoft.com/technet/prodtechnol/sql/2000/reskit/part3/c1161.mspx?mfr=true
Similar Messages
-
Please tell how to store jpeg images in SQL Server using NI Database Connectivity Toolset.
http://www.w3schools.com/sql/sql_datatypes.asp
You setup a field as BLOB and store the binary of the picture there. Depending on the database it can be called differently as you can see in the link, in SQL server there's even a Image datatype.
/Y
LabVIEW 8.2 - 2014
"Only dead fish swim downstream" - "My life for Kudos!" - "Dumb people repeat old mistakes - smart ones create new ones."
G# - Free award winning reference based OOP for LV -
How to store 999999999.00000000 in sql server through ssis package?
I have a field with 999999999.00000000 value of datatype double ?
How to store it in ms sql server 2005 db through ssis package ?
give me details if I have to use derived columns and what to write over there.
please write in details as I am new to SSIS.
Thanks in Advance.The value is coming from informix db .
Can u please suggest hw to write it in my package :
I have taken a OLE DB Source and wrote the follwing command :
" select CASE WHEN T1.t_maxs IS NULL THEN 0.00 ELSE T1.t_maxs END as max_inv
from ttiitm001010 T1 ".
Please give details, as i am new ... -
How to store pdf into blob, index it and search it?
I am trying to store pdf into a column, index the column and search it.
I store pdf file into blob column with either the following code or with an interface in apex
declare
Dest_loc BLOB;
Src_loc BFILE := BFILENAME('DIR_TESTCASE', 'intermedia.pdf');
BEGIN
INSERT INTO pdffiles(id, description)
VALUES(1, 'InterMedia Concepts')
RETURN text INTO Dest_loc;
DBMS_LOB.FILEOPEN(Src_loc, DBMS_LOB.LOB_READONLY);
DBMS_LOB.LOADFROMFILE(Dest_loc, Src_loc, dbms_lob.getlength(Src_loc));
DBMS_LOB.FILECLOSE(Src_loc);
COMMIT;
END;
then i need to create an index
begin
ctx_ddl.create_preference('pdf
lexer', 'BASICLEXER');
ctx_ddl.set_attribute('pdf_lexer', 'printjoins', '_-');
end;
create index PDFFILES_TEXT on PDFFILES(TEXT) indextype is ctxsys.context
parameters ('lexer pdf_lexer');
sqlplus says index created but windows gives an error and closes ctxhx.exe
and of cource when I tried to make a search like
select id, description
from pdffiles
where contains(text,'Oracle') > 0;
it doesn't return any results.
My database is 10g XE, I also tried it on Oracle 10.2.0.3 EEIt is possible to store pdf and doc files in a blob column, create a text index, and search them, and display them. However, you cannot expect to just select doc and pdf data directly from a blob column and expect to be able to read it, due to all of the special formatting characters. You need to use ctx_doc.snippet or ctx_doc.markup or some such thing to format it and make it readable. Please see the demonstration below. You can search the online documentation for complete syntax, additional information, and examples.
SCOTT@orcl_11g> CREATE TABLE my_files
2 (id NUMBER,
3 doc BLOB)
4 /
Table created.
SCOTT@orcl_11g> CREATE OR REPLACE DIRECTORY DIR_TESTCASE AS 'c:\oracle11g'
2 /
Directory created.
SCOTT@orcl_11g> declare
2 Dest_loc BLOB;
3 Src_loc BFILE;
4 BEGIN
5 INSERT INTO my_files (id, doc) VALUES (1, EMPTY_BLOB())
6 RETURNING doc INTO Dest_loc;
7 Src_loc := BFILENAME ('DIR_TESTCASE', 'banana.pdf');
8 DBMS_LOB.FILEOPEN (Src_loc, DBMS_LOB.LOB_READONLY);
9 DBMS_LOB.LOADFROMFILE (Dest_loc, Src_loc, dbms_lob.getlength (Src_loc));
10 DBMS_LOB.FILECLOSE (Src_loc);
11 INSERT INTO my_files (id, doc) VALUES (2, EMPTY_BLOB())
12 RETURNING doc INTO Dest_loc;
13 Src_loc := BFILENAME ('DIR_TESTCASE', 'test1.doc');
14 DBMS_LOB.FILEOPEN (Src_loc, DBMS_LOB.LOB_READONLY);
15 DBMS_LOB.LOADFROMFILE (Dest_loc, Src_loc, dbms_lob.getlength (Src_loc));
16 DBMS_LOB.FILECLOSE (Src_loc);
17 END;
18 /
PL/SQL procedure successfully completed.
SCOTT@orcl_11g> INSERT INTO my_files (id, doc)
2 VALUES (3, UTL_RAW.CAST_TO_RAW ('blob data for id 3'))
3 /
1 row created.
SCOTT@orcl_11g> COMMIT
2 /
Commit complete.
SCOTT@orcl_11g> SELECT id, DBMS_LOB.GETLENGTH (doc) FROM my_files
2 /
ID DBMS_LOB.GETLENGTH(DOC)
1 222824
2 19968
3 18
SCOTT@orcl_11g> CREATE INDEX my_files_idx ON my_files(doc)
2 INDEXTYPE IS CTXSYS.CONTEXT
3 /
Index created.
SCOTT@orcl_11g> SELECT COUNT (*) FROM dr$my_files_idx$i
2 /
COUNT(*)
308
SCOTT@orcl_11g> COLUMN first_45 FORMAT A45
SCOTT@orcl_11g> SELECT id,
2 UTL_RAW.CAST_TO_VARCHAR2 (DBMS_LOB.SUBSTR (doc, 18, 1)) AS first_45
3 FROM my_files
4 /
ID FIRST_45
1 %PDF-1.5
%âãÏÓ
1
2 ÐÏࡱá
3 blob data for id 3
SCOTT@orcl_11g> EXEC CTX_DOC.SET_KEY_TYPE ('ROWID')
PL/SQL procedure successfully completed.
SCOTT@orcl_11g> COLUMN keywords_in_context FORMAT A45 WORD_WRAPPED
SCOTT@orcl_11g> SELECT id,
2 CTX_DOC.SNIPPET
3 ('MY_FILES_IDX',
4 ROWID,
5 'contents OR (fruit of the month) OR data',
6 '<<',
7 '>>')
8 AS keywords_in_context
9 FROM my_files
10 WHERE CONTAINS (doc, 'contents OR (fruit of the month) OR data') > 0
11 /
ID KEYWORDS_IN_CONTEXT
1 <<Fruit of the Month>>
Banana
Bananas are the most popular
2 This is the original <<contents>> of
test1.doc.
3 blob <<data>> for id 3
SCOTT@orcl_11g> -
How to store data into database by reading sql statements from text file
how to write java program for storing data into database by reading sql statements from text file
Step 1: Create a property file to add various queries.
Step 2: Read the properties file using ResourceBundle
Step 3: Use the jdbc to execute the query read from the property file.
So in future if you need to change query no need do any modifications in java program. But depends on how you use the property file. -
How to store/display images with SQL Server 2000
Hi everybody, I'm totally new to ColdFusion, and creating a
sample project, where a user would enter in a person's info and
upload a picture of that person. I trying to get my app to save
that image to SQL Server database and then to display that pic.
Currently, it "seems" that I'm able to save to SQL server (my table
saves user info but all values in my photo column says
<binary>-I don't know if that is correct), but I can't seem
to get image and display it on my cf page. I have pasted portions
of my code below.
I've been hammering away at this but no luck, so Any comments
are very well appreciated, example code would be great!
Thank you so much,
noijet
# 1.) I have a 'User Info Entry' page that submits to page
#2:
<cfform...>
<input name="fileToUpload" id="fileToUpload" type="file"
size="64"/>
</cfform>
# 2.) This page does the actual saving, this doesn't output
any errors but am I saving the image to SQL server correctly? I
have no idea really how to save images to database, so please
advise or possibly provide example code. Afterwards, it goes to
page #3 to display confirmation page that data has been saved.
<cfif isDefined("Form.fileToUpload") and Form.fileToUpload
neq "">
<cfset uploadPath =
GetDirectoryFromPath(GetBaseTemplatePath()) & "uploads\">
<cfif not DirectoryExists(uploadPath)>
<cfdirectory action="create" directory="#uploadPath#">
</cfif>
<cffile action="upload" fileField="fileToUpload"
destination="#uploadPath#" nameConflict="overwrite">
<cfset imagefile= "uploads\\" & cffile.serverFile
& "'">
</cfif>
<cfquery name="qInsertPerson" dataSource="HRP">
Execute insertPerson
N'#Trim(FORM.sLastname)#',N'#Trim(FORM.sFirstname)#',N'#Trim(FORM.sMiddle)#',N'#Trim(FORM .sAlias)#',
'#imagefile#'
</cfquery>
<cflocation url = "savePersonResult.cfm" addToken =
"No">
#3.) This confirmation page displays last user entered and a
picture of the user. The user info retrieved from SQL server is
displaying correctly but the picture is not displaying(just a small
red 'x' box). The image calls another getPersonPhoto.cfm file to
display image.
<cfquery name="lastPerson" datasource="HRP">
Exec getLastRow
</cfquery>
<cfoutput query="lastPerson">
#firstName# #middle# #lastName# was added to our Persons
list. That Person has been given id: #id# <br>
Thank you for your assistance and cooperation.
<img src="getPersonPhoto.cfm?id=71" border="0" width="128"
height="180">
</cfoutput>
#4.) This is .cfm file that only displays image of person
<cfsetting enablecfoutputonly="Yes">
<cfsetting showdebugoutput="No">
<cfquery name="getBlob" datasource="HRP">
SELECT TOP 1 photo FROM Persons WHERE id = 71
</cfquery>
<cfheader name="content-disposition"
value="Inline;filename=ExamplePerson.jpg">
<cfcontent type="image/jpeg; charset=iso-8859-1">
<cfoutput>#tostring(tobinary(getBlob.photo))#</cfoutput>
Note: In my ColdFusion admin, I checked "Enable ... BLOB's"
and set Blob Buffer to 20000Regarding doing the actual saving, here are some other things
to consider:
* a max on the image's file size
* check if it really is an image
* don't use nameconflict="overwrite". consider
nameconflict="MAKEUNIQUE"
* delete uploaded image on file system after insert into db
Also, on the cfm page that returns an image, try putting the
cfcontent tag and the cfoutput tag on one line.
<cfheader name="Content-Type" value="image/jpeg">
<cfcontent
type="image/jpeg"><cfoutput>#getBlob.photo#</cfoutput>
Good luck! -
How to store data into a file from a host VI developed for Compact RIO
Hi,
I am new to the CompactRIo.I have developed a VI which runs on the FPGA(CompactRIO) which continuously monitors tha data from a system and i have developed a host VI to read the data and i am successfully getting the data into my computer and i want that data to store into a file.When i use the write to spreadsheet VI for writing into a file.The data is not written into file can anybody tell me why this is happening?Hi,
The last one you said is working when i conected through it is working, whatever files i have used earlier are there.Thanks for that but i have few queries please answer me so that i acn proceed in my project.
1.As you said to connect to ftp://xx.xx.xx.xx i have seen some extra files along with my files waht are they? waether my data files are stored in flash memory of RT controller?if so, how to clear those files?
2.Suppose i want to clean up the flash memory of RT contrller i.e suppose i have deployed some file earlier , now i want to cleanup those i dumped into the memory how to do that?
3.How to disable the Application running on the RT controller when it powers on? i.e. when i switch on the power it should be connected but nothing hould be running on.
4.I mean at the end of the experiment when i stopped the host VI by pressing stop button weather application running on the RT controller will stop and weather FPGA VI runnibg on that also stop if not how to stop?
5.Suppose next time when i connect to ftp://xx.xx.xx.xx i dont want to keep earlier files there how to delete them?Because my doubt is if i am using the file name which is same as the prevoius one there is aproblem of appending the new data to the old file.?
Regards,
Vishnu -
How to store file into a directory?
i want to save the file(text file) into the directory which i have created using File object in the codes below. how do i do it?
public void saveString(String filename, String string)
//declare textfile to be null
PrintWriter textFile = null;
String line = null;
try {
// writes to write.txt
textFile = new PrintWriter (new FileWriter(filename,true));
line = string;
// save string in textfile
textFile.println(line);
textFile.close();
// create a directory (to store (output).xml file)
File fobj = new File("Testing");
fobj.mkdir();
catch (IOException e) {
System.out.println("Error in opening file");
System.exit(0);
}create the directory first and then create the file u want liek this
File f = new File (fobj,filename);
and then open the fiel to write like this
textFile = new PrintWriter (new FileWriter(f,true));
regards
rohan -
How can store .gif into oracle ?
Hai,
when i am inserting .gif file into oracle,i getting the sql error message at run time like java.sql.sqlException [oracle][odbc]No data at execution values pending.
I have placed a valid .gif file path ,while i have creating file objct.
i have used below the coding to insert .gif into oracle,
Demox.java
public class Demox
public static void main(String x[])
ResultSet rs;
Connection con;
Statement st,st1;
try
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con=DriverManager.getConnection("jdbc:odbc:mydsn","scott","cipl");
st=con.createStatement();
File file = new File("c:/mahesh/oracle.gif");
System.out.println("file cotent is"+file);
InputStream inStream = new FileInputStream(file);
System.out.println("before prepstmt");
PreparedStatement psmt =con.prepareStatement("INSERT INTO + demo(id,pict)VALUES(?,?)");
psmt.setString(1, "Logo");
psmt.setBinaryStream(2, inStream, (int)file.length());
psmt.execute();
//HRER ONLY I GOT THE ERROR MSG LIKE [oracle][odbc]No data at execution values pending.//
System.out.println("after execute");
if(psmt != null)
psmt.close();
if(con != null)
con.close();
catch(Exception q)
{System.out.println("Hai:"+q);}
In database i have used long raw datatpe to store .gif file,meanwhile
I have tried blob as datatype to store .gif,still i got the same exception
:[oracle][odbc]No data at execution values pending....
So,any one could me out from this probs.It's little bit urgent....
Regards,
mahesh.Hi
Instead of storing the file in the database. Store the image in a file on the disk and store the path to the image in your database. This is one good way of doing this.
Good Luck!
Eshwar Rao
Developer Technical Support
Sun microsystems inc
http://www.sun.com/developers/support -
How to store Unicode in Oracle database ?
I have a J2EE application and currently we are storing the Unicode data in amp;#xxx; format.
The browser can display this properly but the java swing application cannot. So I need to convert this to \uxxxx format.
Is it advisable to store the data in the d/b in the \uxxxx format or amp;#xxx; format ? Advantages ? Disadvantages ?
The database is setup for UTF-8.
ThanksNot really sure what you are asking the conversion from whatever character set to Unicode should occur without thought to decimal or hex. What is the insert statement or method you are using to get the data ineserted into the database?
-
How to store Marathi Character in SQL server?
I am going to design a application having front end with VB.Net and Back end with SQL SERVER in. And I want the complete interface of that
application in marathi language.
when I enter the marathi character in data base and execute it, it shows "????????" like this.
What I do to enter and store the marathi character in Database?Are you saying in application it is showing ???? ? In that case check the locale? If you are seeing this behaviour in DB Check this
create table test(col nvarchar(22))
insert test SELECT N'नमस्कार'
insert test SELECT 'नमस्कार'
select *from test
BTB... Namaskar DAN... :)
Madhu
MCITP, MCTS, MCDBA,MCP-- Blog : http://experiencing-sql-server-2008.blogspot.com/ -
How to store Invalid Dates in SQL Server 2008
Hi,
I have SQL Server 2008 and My table has start_Date and end_date column which is DATETIME datatype.
Somehow my table is having invalid dates which is lesser than 1753-01-01 00:00:00.0 range.
I want to know how this date get inserted in the SQL Server.
Thanks,
MuthuprabhuCan you post the DDL for that table together with a SELECT query and results demonstrating invalid data?
DECLARE @dt DATETIME = '1753-01-01 00:00:00.0';
-- Command(s) completed successfully.
DECLARE @dt DATETIME = '1752-01-01 00:00:00.0';
Msg 242, Level 16, State 3, Line 4
The conversion of a varchar data type to a datetime data type resulted in an out-of-range value.
Datetime conversion:
http://www.sqlusa.com/bestpractices/datetimeconversion/
Kalman Toth Database & OLAP Architect
SQL Server 2014 Database Design
New Book / Kindle: Beginner Database Design & SQL Programming Using Microsoft SQL Server 2014 -
How to store data into log file(.doc) using CVI
The purpose is to store the capture data(from my cvi program) and store into the log file (.doc). so at the end of the program run I can retrieve the doc file where the data store to do my analysing .
Why do this: I wanted to create my program into .exe file that why I need this method or do u have other method to intro?
Any ideal or note or example to share? Pls helpIf you are explicitly trying to create a Microsoft Word document, then CVI comes with Word Report instrument that can be used to generate such files. The instrument is located in toolslib\activex\word\wordreport.fp, while a sample program can be found in samples\activex\word\wordrpt.cws.
I suggest you take a look at the example program that illustrates the fundamentals of this instrument, next you can start designing your own application using that instrument.
Proud to use LW/CVI from 3.1 on.
My contributions to the Developer Zone Community
If I have helped you, why not giving me a kudos? -
Using VBA from Excel, how to send datas into a SQL server
Hi,
How do you use VBA to provide the connection to insert datas into a table within a database.
What kind of statements do we need.
The database, and table are for example already created.
ThanksHi
I know this is an old thread but did you come right? -
How to pass variable into lov sql query using like operator
hi.
i want to use a lov where i want to pass a variable using like operator.
my query is
select empno,name from table where empno like ':ed%';
my empno is A001 TO A199 AND B001 TO B199 so i want show either A% or B% empno
how can i do this ?
reagrdskindly press Shift+F1 at a time you face this error to see the exact Oracle error message.
and provide us with that detail
and its better if you start new topic for that error... because that will be new error,,,
-- Aamir Arif
Edited by: Aamiz on Apr 7, 2010 12:27 PM
Maybe you are looking for
-
I have a IMac G5 A1058 that was running Mac OS 10.3.8 I upgraded to 10.4
I have a IMac G5 A1058 that was running Mac OS 10.3.8 I upgraded to 10.4, shortly after upgrading the system would no longer boot so I booted from the 10.4 Tiger upgrade disk from which I had upgraded and disk utility found errors on the HD file syst
-
About the cfform format "Flash"
My code: <cfform name="test" format="Flash"> <cfinput name="test1" type="text"> <cfinput name="test2" type="text"> </cfform> run the code, the input box "test1" and "test2" in two rows,how to let them in same row? Thanks.
-
720 progressive output from Sorenson Squeeze and Sony Z1 HDV
Hi I have a one off project where I need to film some shots in portrait 16:9 for output on (lots of) 720p digital screens on their sides. I plan on filming this with a Sony Z1 camera in 1080i HD mode on its side and then down-sizing in FCP and conver
-
Hi Anji, Pls send the procedure (steps) in abap query tool.How to generate a report by using query tool? thanks in advance ramu
-
Catch snapshot event in Acrobat
Hi all I scope is catch the snapshot event from acrobt and lanchuing photoshop and paste the snapshot. How I can catach the event? Thanks in advance Regards arul