Can't get the result if I use SUBSTR From the resultSet

Hi,
I have a request that make some changes on a String data.
This modification is an extraction of a sub string with SUBSTR function of oracle.
The problem is that I can to get the result on my java code
               pst = connect.prepareStatement(GET_PATH);
               rset = pst.executeQuery();
          while (rset.next()) {
               String chemin = rset.getString("IMG_PATH"); // rset.getString(2);
               system.out.println("Le chemin récuperé de la base est : " + chemin);
               chemins.add(chemin);
          }this is the request :
SELECT DISTINCT nl.img_id, SUBSTR(ni.img_chemin, 1, INSTR(ni.img_chemin, '\', -1)) IMG_CHEMIN from images nlThe oracle documentation say the SUBSTR function return a STRING type.
Thnaks for your help. (And sorry for my little english)
Technical Information :
DB : ORACLE
DRIVER VERSION : ojdbc14-10.2.0.3.0.jar (tested with version 9 same thing)
Java 6 update 3
Edited by: Aberghouss on 29 août 2008 17:11

Aberghouss wrote:
Hi,
I change the INSTR(ni.img_chemin, '\', -1) by number 20 and the program get correctelly the value
SELECT DISTINCT nl.img_id, SUBSTR(ni.img_chemin, 1, 20) IMG_CHEMIN from images nlNow have you any idea how can I resolve this problem with INSTRLittle confusing what you are actually doing.
You need to post code that actually has the problem.
Given that you are using names, rather than indexes, usually the problem is that the name doesn't match what is actually in the meta data. Try printing the meta data. And try using indexes just to verify that there is in fact a result (which would be another reason for not getting it.)

Similar Messages

  • Can't get same results on query using dynamic time frame versus static time frame

    I am trying to run a query on a Lookout database using MS Access. If I use static dates as criteria in the "LocalTime" field I get results that are marked on the hour, eg. 1:00 pm. If I try to use dynamic dates as criteria I get results that are marked on the half hour, eg. 1:30 pm. The results are for each hour but the difference in the queries causes the dynamic query to come up with different results than a spreadsheet generated by Lookout that the client relies on for backup. Does anybody know a way I can get the dynamic date query to act like the static query? I can't use static queries because this is for a daily report and the client will not pay for me to make 365 new queries each y
    ear. I tried NI's tech support but they pointed me to the same SQL examples that are in the Developer's Manual which are all static queries. Tech Support also told me they can't help me figure out dynamic queries.

    Yes I am using an interval clause that says "interval=1:00". I create the localtime clause dynamically and this seems to be where my problem lies. No matter what I have the dynamic function create the date/time as, i.e., 07/01/2002 or 07/01/2002 12:00 AM or 07/01/2002 00:00, the time the query returns for each record is 32 minutes after the hour. From this I assume it is averaging each hour interval from one half hour mark to the next, eg. from 12:30 am to 1:30 am. This is born out because the hourly averages do not match the averages for the same time frame that Lookout exports to an Excel spreadsheet. Thanks for your suggestion though.

  • I recently bought a new macbook pro and set it up using the migration assistant and my mac mini.  I can't get the text message forwarding feature to work with both computers.

    I recently bought a new macbook pro and set it up using the migration assistant from my mac mini.  I can't get the text message forwarding feature to work with both computers.  It keeps saying that I only have 2 devices setup, my iPad and my macbook pro.  When I mess with the setting on my mac mini, it goes from saying that that is one of the devices to my macbook pro being the 2nd device.  I think that something happened as a result of my using the migration assistant and now it thinks that my macbook pro and my mac mini are one and the same computer.  Any ideas?

    Thanks, Sig.
    The old computer is a 2.6 Ghz Intel Core 2 Duo
    The new one is a 2.3 GHz intel core i7
    In going over this, thanks to "tallking it out" with you, I did discover the Text Edit problem.  Because I've still been unable to get the new computer text size (fonts or whatever) to match the old computer, I did not notice that the curser is now different--the line midway down the curser has to be placed on the line I am working upon, otherwise the edits go elsewhere on the page.  Now, with a bit of difficulty, I am able to get Text Edit to work correctly.
    If you have any ideas as to why my menu bar and Text Edit type are still so slow, I'd love to have them. 
    (I went through the process you suggested earlier, re my Trackpad preferences, and found no improvement.)

  • How can i get the external Sql result return data to abap?

    Dear All
             I have a problem to how to get the select  result data return abap.
    I used abap to run external SQL server. below is my code:
    ***in above ,abap has already connected external SQL.
    Sql = u2018select * from user01u2019
          CALL METHOD OF rec 'Open'
            EXPORTING #1 = sql
            #2 = con
            #3 = '1'.
          IF NOT sy-subrc = 0.
            MESSAGE e000 WITH 'run external sql error!'.
          ENDIF.
    ***now ,below code how can I get the select result to abap code?
    I know I can use native_sql  such as u2018OPEN CUR1 FOR SELECT * FROM user01 AND FETCH NEXT CUR1 INTO :WAu2019.
        Thanks for all
    Sun

    Thanks.
    it is okay now by myself.
    con_str = 'Provider=SQLOLEDB.1;Password=pwd;Persist Security Info=True;User ID=name;Initial Catalog=VTL_DEMO;Data Source=192.168.21.50'.
      CREATE OBJECT o_conn 'ADODB.Connection'.
      CREATE OBJECT o_rec 'ADODB.Recordset'.
      SET PROPERTY OF o_conn 'Provider' = provider.
      SET PROPERTY OF o_conn 'ConnectionString' = con_str.
      CALL METHOD OF o_conn 'Open'.
      sql_str = 'select *  from userh'.
      CALL METHOD OF o_conn 'Execute' = o_recordset
        EXPORTING
        #1 = sql_str.
       #2 = o_conn.
      GET PROPERTY OF o_recordset 'EOF' = rs_eof.
      REFRESH itab.
      WHILE rs_eof NE 1.
        CALL METHOD OF o_recordset 'fields' = o_field
          EXPORTING
          #1 = 0.
        GET PROPERTY OF o_field 'Value' = itab-name.
        CALL METHOD OF o_recordset 'fields' = o_field
          EXPORTING
          #1 = 1.
        GET PROPERTY OF o_field 'Value' =  itab-cid.
        APPEND itab.
        CALL METHOD OF o_recordset 'MoveNext'.
        GET PROPERTY OF o_recordset 'EOF' = rs_eof.
      ENDWHILE.

  • How can i get the time and result together show in one Array or in Cluster?

    hello everyone i am a new user .I want to get the time and voltge form a Generater. How can i get the time and result together show in one Array or in Cluster?When i selecte the first(or third...) result then in the front panel display the time and the voltge.Thank you!
    I post the time and voltge NOT together photo
    Attachments:
    12345.GIF ‏54 KB

    You can create an array of clusters with one element being the time and the other being the voltage, like so (using the "Get Waveform Components" function):
    Message Edited by smercurio_fc on 10-17-2007 03:15 PM
    Attachments:
    pic.PNG ‏11 KB

  • I can run a slide show using apple tv and itunes but can't get the slides to run in a specific order

    I can run a slideshow (of pictures) using Apple TV and ITunes but can't get the pictures to run in the order I set them up with in my hard drive directory

    Welcome to the Apple Community.
    Websites and third party Apps need enabling before they will allow AirPlay of Video content. Some Website/App developers have not enabled their products, some simply haven't got around to it yet, others have stated that they won't be enabling AirPlay (likely as a result of licensing issues).
    I have created a User Tip to list Apps that have been tested with Video Airplay, if you have any Apps that you have tested please leave details in the comments at the bottom of the User Tip or email me if you don't have commenting privileges.

  • How can I get the context-parm from a web.xml file using struts?

    Hello:
    I need get the context-param from the web.xml file of my web project using struts. I want configurate the jdbc datasource connection pooling here. For example:
    <context-param>
    <param-name>datasource</param-name>
    <param-value>jdbc/formacion</param-value>
    <description>Jdbc datasource</description>
    </context-param>
    and then from any Action class get this parameter.
    Similar using a simple server can be:
    /** Initiates new XServlet */
    public void init(ServletConfig config) throws ServletException {
              for (Enumeration e = config.getInitParameterNames(); e.hasMoreElements();) {
                   System.out.println(e.nextElement());
              super.init(config);
              String str = config.getInitParameter("datasource");
              System.out.println(str);
         public void doPost(HttpServletRequest req, HttpServletResponse res)
              throws ServletException, IOException {
              // res.setContentType( );
              System.out.println("Got post request in XServlet");
              PrintWriter out = res.getWriter();
              out.println("nada");
              out.flush();
              out.close();
    but only this works for init-params, if I use
    <servlet>
         <servlet-name>MyServlet</servlet-name>
         <display-name>MyServlet</display-name>
         <servlet-class>myExamples.servlet.MyServlet</servlet-class>
         <init-param>
         <param-name>datasource</param-name>
         <param-value>jdbc/formacion</param-value>
    </init-param>
    </servlet>
    inside my web.xml. I need something similar, but using struts inside the action class for that I can get the context-params and call my database.
    Thank you

    To get context parameters from your web.xml file you can simply get the ActionServlet object from an implementing action object class. In the perform (or execute) method make the following call.
    ServletContext context = getServlet().getServletContext();
    String tempContextVar =
    context.getInitParameter("<your context param >");

  • How can I get the 23 July update to load onto my iPad. I haven't been able to access my documents or work for weeks and need to use it. Has anyone else had similar problems?

    How can I get the 23 July update to load onto my iPad. I haven't been able to access my documents or work for weeks and need to use it. Has anyone else had similar problems?

    Hello Arthur,
    Thank you for the reply.
    You were correct that deleting the app and reinstalling it was the only thing to make it work but unfortunately I lost all the documents I made, even though they were backed up to iCloud before i deleted the app. At the same time as deleting pages I had to delete keynote and numbers too, so I've lost all the documents in them too.
    The mb of data which was assigned to each programme in iCloud has reduced, so. I guess they are gone for good. Is there any other way to reaccess them?
    Not your fault but I am a bit fed up the the iPad. I have lost work that I've done and have no other copy apart from what was in iCloud, as I don't have a printer and couldn't email them too myself as I couldn't get into the programme and  i've also got episodes of tv series I purchased that I can't download and albums that are half downloaded with songs missing, so I feel a bit swindled out of time and money and am going back to DVD ,  pen and paper and CDs .
    Instead of using iCloud I guess the only way to make sure I don't loose any more documents it to email them to myself each time I save them on the iPad. Is there anything else you could suggest please?
    I don't have any other apple products apart from iPods, so I can't access the iCloud on anything else can I?
    Thanks
    Amanda

  • I just got iphone 5c and i am not happy with it. It uses to much data and i don't even know how. I can't get the ringtones i want for my contacts.I got it on my free upgrade but i want to take it back and get something else but where i got it they say i c

    I just got iphone 5c and i am not happy with it. It uses to much data and i don't even know how. I can't get the ringtones i want for my contacts.I got it on my free upgrade but i want to take it back and get something else but where i got it they say i can't because i don't have the earbuds and i have serches or them. now i am suck with a phone i don't like at all until my next upgrade. this is very dishearten

    1. If you are this unhappy with that phone, and the lost earbuds is the only thing stopping you from taking it back, why do not just buy some earbuds. That way you can get rid of that phone. It all depend upon how much you want to get rid of that phone.
    2. Yet if you are stuck with that iPhone, here is something might help you to control the data usage. By design, iPhones do turn off WiFi when they go dormant. So if a download is in progress and so forth when the phone goes dormant, it will switch to use cellular data, if this setting is left on. Therefore, from multi-sources I have learned that if you keep your iPhone connected to a power source, then it will stay connected to the available WiFi.

  • I have a 10.2.8 os. I had opened up the AOL logo on the bottom bar. Two aol boxes came up. I can get them to go away for a short time and then they come back. I have not used AOL for 6 years. How can I get the boxes to go away?

    I have a 10.2.8 os on a G4 desktop. A week ago I clicked on the AOL icon in the bottom bar. I have not used AOL for six years. Two aol boxes came up. I can not get the boxes to go away for long. They may go away for 15 minutes and they come back  while I am working. How can I get these  aol boxes to go away?
    I will be upgading to Tiger; 10.4.

    Right click on the AOL icon and select move to trash.

  • Just replaced my iphone 4 with new 4.  restore from icloud is hung on an app I no longer use (password probably expired) how can i get the restore to move on to the next app

    just replaced my iphone 4 with new 4.  restore from icloud is hung on an app I no longer use (password probably expired) how can i get the restore to move on to the next app

    Read another post in the forum about this and it appears this app also installs a profile with a proxy service that you will have to try and delete as well. Check that out.

  • I have an Ipod touch and when I connect it to my computer using a usb cord it isn't recognized, how can i get the songs that I purchased off of this iPod without syncing?

    I have an Ipod touch and when I connect it to my computer using a usb cord it isn't recognized, how can i get the songs that I purchased off of this iPod without syncing?

    For Windows see http://support.apple.com/kb/TS1538
    For Mac OS X see http://support.apple.com/kb/TS1591

  • I have a photo album in my apple tv but can't get the apple tv to use it as a screen saver. it is using older photos

    I have a photo album in my apple tv but can't get the apple tv to use it as a screen saver. it is using older photos

    Is this a software or hardware issue? 

  • I purchased a magazine using the Zinio app which I'd recently downloaded on to a recently purchased iPad. I received an error message at the time (can't recall the details) but have since been invoiced for the $8.99. How can I get the Magazine I purchased

    I purchased a magazine using the Zinio app which I'd recently downloaded on to a recently purchased iPad. I received an error message at the time (can't recall the details) but have since been invoiced for the $8.99. How can I get the Magazine I purchased?

    FOR ASSISTANCE WITH ORDERS - iTUNES STORE CUSTOMER SERVICE
    For assistance with billing questions or other order inquiries, please refer to our online support page by clicking here: http://www.apple.com/support/itunes/store/. If you cannot find the answers you are seeking in our robust knowledge base, you can contact us by visiting the following URL http://www.apple.com/support/itunes/store/, clicking on the appropriate Customer Service topic, then using the contact button or email form at the bottom of the page. Responses to emails will be provided as soon as possible.
    Phone: 800-275-2273 How to reach a live person: Press 0 four times
    Hours of Operation: Mon-Fri: 9am-5pm ET
    Email: [email protected]
    How to report an issue with Your iTunes Store purchase
    http://support.apple.com/kb/HT1933
    How to Get a Refund from the App Store
    http://gizmodo.com/5886683/how-to-get-a-refund-from-the-app-store
    Canceling a Digital Subscription
    http://gadgetwise.blogs.nytimes.com/2011/10/14/qa-canceling-a-digital-subscripti on/
     Cheers, Tom

  • HT5219 How can i get the Apple Thunderolt display to show Windows 7 i run on my system using Paralells desktop..

    How can i get the Apple Thunderolt display to show Windows 7 i run on my system using Paralells desktop..

    You may need to set the slider at the upper-right corner of the Control window to something other than the extreme left-most position:
    Hope this helps.

Maybe you are looking for

  • Unable to install itunes

    I am unable to install anything on windows 7 64-bit. I cannot even update anything including itunes or any other software. A yellow window pop-up opens saying the file cannot be opened and when I go to support, its says something about the internet s

  • Internal order budget control by year

    Hi, When using KO22 to key in internal order budget, we can key in total budget and yearly budget, but when the budget consumed, the value is only updated to field 'Assigned-total', it seems that it does not control by year, is it right? Any way to c

  • ITunes folder hierarchy.

    Is there somewhere I could find an open view of the iTunes folder hierarchy, showing where my Music goes? The reason being, I have several folders named "Music", and I am not sure which one, or where to move it to on my new iMac. user/myname/Music, c

  • Updated Java 7u9 headache. Missing shipping applet.

    I did the Apple update....tried to print a shipping label at Paypal and got the blank area with "missing plug-in."  Got directed to Oracle for the current Java update...installed it and still get the missing plug-in message.  I need to print postage

  • Selection tools make Photoshop CS crash

    When I am using either the magic wand tool or the polygonal lasso tool in Photoshop CS, the tools cause the program to behave strangely, including: -crashing (program error, PS shuts down) -PS completes a lasso by itself without me completing it -usi