Simpler Navigation for Servers and Operating Systems
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
General
cancel
Showing results for 
Search instead for 
Did you mean: 

Extract String with parentheses from DB

erwin_16
Occasional Visitor

Extract String with parentheses from DB

Hi,
I has been tried extract a Hebrew or English string that contain parentheses from table in Oracle DB and i got defective string that the parentheses are not in their original place.
anybody kmow the reason?
Thank's
6 REPLIES
Sanjay Kumar Suri
Honored Contributor

Re: Extract String with parentheses from DB

Can you share the SQL that being fired and the results returned by SQL?

sks
A rigid mind is very sure, but often wrong. A flexible mind is generally unsure, but often right.
erwin_16
Occasional Visitor

Re: Extract String with parentheses from DB


Statement s = con.createStatement();

ResultSet rs2 = s.executeQuery( "SELECT e.DESCRIPTION FROM equipment e,item i WHERE e.itemnum = i.itemnum and in2='Y' and i.itemnum='884841'" );

while (rs2.next()) {

System.out.println( "%%%%%%%%%%%%%% string=" +rs2.getString(1));

}
H.Merijn Brand (procura
Honored Contributor

Re: Extract String with parentheses from DB

is this Python?
It's not SQL. That's for sure.

Enjoy, Have FUN! H.Merijn [ who knows nothing about python ]
Enjoy, Have FUN! H.Merijn
Sanjay Kumar Suri
Honored Contributor

Re: Extract String with parentheses from DB

What is result of following SQL and what was expected?

SELECT e.DESCRIPTION FROM equipment e,item i WHERE e.itemnum = i.itemnum and in2='Y' and i.itemnum='884841'

sks
A rigid mind is very sure, but often wrong. A flexible mind is generally unsure, but often right.
Alexander M. Ermes
Honored Contributor

Re: Extract String with parentheses from DB

Hi there.
As far as i can see this is embedded sql.
Any result ? if yes, pls let us see for further examniation.
Rgds
Alexander M. Ermes
.. and all these memories are going to vanish like tears in the rain! final words from Rutger Hauer in "Blade Runner"
Yogeeraj_1
Honored Contributor

Re: Extract String with parentheses from DB

hi,

is this VB?

anyway, can you post the output of "describe" at the sqlplus level of both tables?

we would get an idea of the datatype for the "description" field.

If possible, let us also have a glimpse of the following PLSQL block execution at the sqlplus prompt.

begin
for r1 in (SELECT e.DESCRIPTION FROM equipment e,item i WHERE e.itemnum = i.itemnum and in2='Y' and i.itemnum='884841') loop
dbms_output.put_line(r1.description);
end loop;
end;

regards
Yogeeraj
ps. don't forget to issue a "set serveroutput on" before executing this plsql block.
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)