Asking for bind variable where none is needed

Good Morning,
I am still working these regexp date_time project.
I have a problem where oracle is asking for a bind variable where it doesn't need any as far as I can see. I am trying to capture various date times in a column and formatting them into one default format used by oracle. Here is what I got which works before I wrap it in the TO_DATE function
There are many when then's but I am using only one here.
select case
when regexp_substr(date_time,'^(0?[1-9]|1[0-2])/(0?[1-9]|[1-2][0-9]|3[0-1])/9[[:digit:]]{4}') is not null
then regexp_substr(date_time,'^(0?[1-9]|1[0-2])/(0?[1-9]|[1-2][0-9]|3[0-1])/9[[:digit:]]{4}')
else date_time
end as new_time
from raw_data;
The above statement works
Now when I want to format the date that I found with this:
select case
when regexp_substr(date_time,'^(0?[1-9]|1[0-2])/(0?[1-9]|[1-2][0-9]|3[0-1])/9[[:digit:]]{4}') is not null
then TO_DATE('regexp_substr(date_time,'^(0?[1-9]|1[0-2])/(0?[1-9]|[1-2][0-9]|3[0-1])/9[[:digit:]]{4}')','MM/DD/YYYY')
else date_time
end as new_time
from raw_data;
I get a request to insert a value for the digit as a bind variable. The digit should be populated from the when statement when it returns not null when a date is found.
Could some one please tell me even if what I wrote here is even possible or make a suggestion to the syntax to get around this issue?
All this is going to be incorporated into an update statement later on.
I am running this on sql developer, oracle 11g.
Thanks for your help in this matter in advance.
regards,
Al

From looking at the code, as you have not supplied any scripts to create a table and demonstrate the error...
Your case statement is trying to return two types
select case
when regexp_substr(date_time,'^(0?[1-9]|1[0-2])/(0?[1-9]|[1-2][0-9]|3[0-1])/9[[:digit:]]{4}') is not null
then TO_DATE('regexp_substr(date_time,'^(0?[1-9]|1[0-2])/(0?[1-9]|[1-2][0-9]|3[0-1])/9[[:digit:]]{4}')','MM/DD/YYYY')
else date_time
end as new_time
from raw_data;or simply
select case when <expr>
            then <RETURN A DATE>
            else <RETURN A VARCHAR2>
        end as new_time
  from raw_data;The column cannot be both.
Sorry I don't know your requirements.
You could drop the else part and just return the converted date.
You could fetch it back in two columns, the ones you can convert in one column (Which would be an oracle date type),
the ones you cannot convert in another (which would be varchar2).
Cheers,
GP>

Similar Messages

  • My iPhone 4s (iOS 6) sometimes asks for my password when none is needed.

    Cancel works and does not ask again.

    General browsing on Safari (not a site where a password is needed). Phone asks for password. Hit cancel, all is good & does not ask again. Another site on Safari, left blank & hit OK. Did not ask again. Latest, after turning on phone and entering passcode to use phone (phone lock passcode needed through all of this), it then (right away) asked for password, twice and responded like above, then said I did not enter proper password and offered a reset option. Hit cancel and did not ask again. I did have a pending text message (not in other cases), but read it after canceling password ask. So far, inconsistent requirement for password.

  • I am trying to set up an account without a credit card. When I get to the screen which asks for credit card information, 'none' is not an option. Why not?

    I am trying to set up an iTunes account without a credit card. However when I get to the screen that asks for credit card information, 'none' is not an option.  According to the instructions on the website, that should be an option. Any help would be greatly appreciated.

    Thanks for the response,
    Yes, I followed the instructions to the letter. But it asks for credit information anyway and 'none' is supposed to be an option when setting up an account 'with no credit card'.
    I have two new iphones, the first one set up as expected, where 'none' was an option. Now that I'm attempting to set up the second with different information, there is no 'none', only Mastercard,Visa, AmerX, Discover and Paypal.
    My wife is ready to throw hers out the window, help me stop her...

  • Everytime i need to add a song in my i phone,it always ask for earse and sync option,i need to avoid that a add songs manually.

    everytime i need to add a song in my i phone,it always ask for earse and sync option,i need to avoid that and add songs manually.

    https://support.apple.com/kb/ht1535

  • Getting error for bind variables

    Hello Experts ;
    SQL> DECLARE
      2  l_eid  number;
      3  l_name  varchar2(30);
      4  BEGIN
      5  l_eid:=1000;
      6  select name into l_name from tab1 where no = l_eid;
      7  l_eid:=9999;
      8  select name into l_name from tab1 where no = l_eid;
      9  l_eid:=299999;
    10  select name into l_name from tab1 where no = l_eid;
    11* END;
    PL/SQL procedure successfully completed.
    when  creating bind variables  i am getting error :
    SQL> variable b1 number;
    SQL> exec :b1 :='select name from tab1 where no = :b1';
    BEGIN :b1 :='select name from tab1 where no = :b1'; END;
    * ERROR at line 1:
    ORA-06502: PL/SQL: numeric or value error: character to number conversion error
    ORA-06512: at line 1

    @ SY
    SolomonYakobson wrote:
    You need to explain "method not workable for me". I have no idea what method you are talking about and what are you trying to achieve.
    SY.
    SQL>DECLARE
        v_value  number;
        v_dispaly varchar2(30);
        BEGIN
       v_value :=100000;
        select name into v_display from tab1 where no = :v_value;
        DBMS_OUTPUT.PUT_LINE(v_display);
        v_value :=20000;
        select name into v_display from tab1 where no = :v_value;
        DBMS_OUTPUT.PUT_LINE(v_display);
         v_value :=250000;
        select name into v_display from tab1 where no = :v_value;
        DBMS_OUTPUT.PUT_LINE(v_display);
      * END;
    RS>/
    PL/SQL procedure successfully completed.
    >>  This is not workable for me ,  Here getting error  >>
    SQL> DECLARE
      2  variable  b1  number;
      3  exec  :b1;
      4  BEGIN
      5  select  name  from  tab1  where no =: b1;
      6* END;
    RS>/
    variable b1 number;
    ERROR at line 2:
    ORA-06550: line 2, column 13:
    PLS-00103: Encountered the symbol "NUMBER" when expecting one of the following:
    := . ( @ % ; not null range default character
    Thanks !

  • How to see values for bind variables in statspack output

    Hi all.
    Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64bit Production
    PL/SQL Release 9.2.0.4.0 - Production
    CORE 9.2.0.3.0 Production
    TNS for Solaris: Version 9.2.0.4.0 - Production
    NLSRTL Version 9.2.0.4.0 - Production
    Running sprepsql.sql to get full sql and explain plan from hash value...
    SQL comes back with bind variables :1, :2, :3 etc.
    How can I find out what the values are for the bind variables so i can plug them in and run them in test db?
    Thanks for all your help.

    I don't have a trace file...
    I need to know what the values are and if there is anyway to see them from the output of the sprepsql...
    currently looks like:
    select
    r.status,
    NVL(r.required_date, to_date('12/31/3999', 'MM/DD/YYYY')),
    r.calc_qty,
    r.issued_qty,
    r.workorder_type,
    r.workorder_base_id,
    r.workorder_lot_id,
    r.workorder_split_id,
    r.workorder_sub_id,
    r.operation_seq_no,
    r.piece_no,
    r.warehouse_id,
    0,
    wbs_code
    from
    REQUIREMENT r
    where r.part_id = *:1*
    and r.workorder_type = 'W'
    and r.calc_qty > r.issued_qty
    and r.subord_wo_sub_id is null
    AND STATUS IN ('R', 'S','U','H','F')
    AND WAREHOUSE_ID = *:2*
    Thanks for your help.

  • How to use function v( ) for bind variable 30 char

    I have the following process, try to load columns from table to the page. One of the column complains about > 30 char cannot use bind variable. I change to
    V('c1.OBJ_OUT_SOURCIING_WAD_TYPE') but still not work.
    Please help;
    BEGIN
    FOR c1 in ( SELECT *
    FROM #OWNER#.OBJECT_OUT_SOURCING
    WHERE OBJ_NAME = :P503_OBJ_NAME AND
    OBJ_OWNER = :P503_OBJ_OWNER AND
              DATABASE_NAME = :P503_DATABASE_NAME)
    LOOP
    :P503_OBJ_NAME := c1.OBJ_NAME;
    :P503_OBJ_OWNER := c1.OBJ_OWNER;
    :P503_DATABASE_NAME := c1.DATABASE_NAME;
    :P503_APPL_NAME := c1.APPL_NAME;
    :P503_OBJ_TYPE := c1.OBJ_TYPE;
    :P503_OBJ_OUT_SOURCIING_WAD_TYPE := V('c1.OBJ_OUT_SOURCIING_WAD_TYPE');
    END LOOP;
    END;

    Che-Hwa,
    Change this statement:  :P503_OBJ_OUT_SOURCIING_WAD_TYPE := V('c1.OBJ_OUT_SOURCIING_WAD_TYPE'); to:  htmldb_application.update_cache_with_write(p_name=>'P503_OBJ_OUT_SOURCIING_WAD_TYPE',p_value=>c1.P503_OBJ_OUT_SOURCIING_WAD_TYPE);Scott

  • I want to change my password but can not get passed verification even though the answers are correct, so I have asked for an email and none has come.Can some one help?

    I have tried to change my password and get to the part where you need to verify by answering the questions, and I get can not get any further, as it tells me the answers aren't the ones they have but I know it is correct, so I have asked for an email to be sent, but no email comes.I receive other emails from iTunes but not the one helping me to change the password. Has any one got any idea why?

    Contact iTunes customer support, no one in these user to user support forums can assist  you.

  • Safari asking for keychain "login" in non-administrative account.

    To protect my wife's newly acquired refurbished MacBook from her complete lack of knowledge about Macs or computers in general, I set myself up as the Administrator on her MacBook and protected this account with a password. I then set her up as a simple user without a password, but to whose account the MacBook goes automatically after a reboot (to make things simple for her).
    Now each time my wife opens Safari on her account, it asks her for "your keychain password" (she has none established on her account). Instead, the password that is accepted by Safari is my administrative account (while she is opening Safari on her account that is not password protected). Interestingly, when I log in to my administrative account and open Safari, it does not ask for this password.
    If she hits "cancel" on this password request, Safari appears to function without problems, however, she is annoyed by this frequent appearance of this window asking for the password and is asking me to make it stop (I have no clue how).
    Any suggestions?
    Thanks.

    Hi resourcesforlif...,
    I did as suggested and lost my keychain set-up. (nameX.keychain). It still seems to be in home/Library/Keychains but haven't figured how it get it back - it is no longer listed in Keaychain sidebar. When/if I do I will methodically go through my key chain and manually copy all data I need and then print it out and laboriously re-enter it into a new keychain file. ( I do have a back up of nameX.keychain incase what I found in my home library is corrupted); at some previous point I was able to make my nameX.keychain my default keychain. Will figure it out again, I am sure.
    What a bore, though; the hours I have wasted on all this.
    Since installing Leopard to my 4 month old MacBook I feel I am getting bloatware from Apple. Enough is enough. So far the following have occurred:
    -Help crashes all the time from the Finder (all Help was gone but now I get it sporadically in Safari, Palm stuff, a few other apps but it is temperamental).
    - Mt Keychain problems: Seemed scrambled and had to sign in whenever opening Safari;
    - my Contacts/Addresses and Calendar to my Palm TX broke - can't isync them though all else in PalmDeskTop works; to be fair, this may have happened between Leopard instal and keychain fix-it the little update mentioned above.
    -I don't know if I can blame this on Leopard but now my Word docs cannot be spell checked in anything other than American spelling and there is no way to change it to British spelling. I have to check everything in Texted. Go figure.
    I suspect Leopard was released too early.
    I've never had this problem with any Mac OS upgrade and I've done them all. I feel like I'm in a Windows Nightmare. Given what I have gone through, I would never have upgraded. Ya, ya! I should have backed up but I don't have the room and I really trusted Apple to get it right, again.
    Cheers,
    mhikl

  • Prompt for bind variables in SQL developer

    Hi!
    Just installed the latest 3.2 version of SQL Developer, and tried to do an explain plan.
    Now the tool prompts me for values for the bind variable. It didn't do that in my previous version (version 3. something).
    Thats anoying :-)
    How do I disable that feature?
    Example:
    explain plan for
    select * from emp
    where department_id = :1;
    If i right click on the statement or press F10, I get no prompt for the bind variable...
    Regards
    Søren

    Old fashioned way, like this:
    EXPLAIN PLAN FOR
    SELECT * FROM scott.emp
    where deptno = :1;
    SELECT PLAN_TABLE_OUTPUT FROM TABLE(DBMS_XPLAN.DISPLAY());
    Executed with F5 gives me this output
    plan FOR succeeded.
    PLAN_TABLE_OUTPUT
    Plan hash value: 3956160932
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 5 | 190 | 3 (0)| 00:00:01 |
    |* 1 | TABLE ACCESS FULL| EMP | 5 | 190 | 3 (0)| 00:00:01 |
    Predicate Information (identified by operation id):
    1 - filter("DEPTNO"=TO_NUMBER(:1))
    13 rows selected

  • Stored Outline for Bind Variable

    Hi,
    Please let me know the use of stored outline to maintain the same execution plan for a sql which contains bind variable.
    I know how to use stored outline for a sql which does not contain bind variable. But I want the use of stored outline for sql where bind variables have been used. Please provide an example.
    Thanks,
    Mrinmoy
    Edited by: user3001930 on Aug 10, 2010 11:22 PM

    Not sure as I don't use them myself, but on AskTom:
    http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:1396058400346694178
    He says:
    >
    stored outlines are deprecated in 11g - replaced by query plan baselines.
    http://download.oracle.com/docs/cd/B28359_01/server.111/b28318/sqlplsql.htm#sthref2589

  • After IOS 8 upgrade, when I turn my phone on, it asks for a password and none of my passwords seem to work. I have already managed to update my password.

    I upgraded to IOS 8 and now when I turn on the phone, it is asking for a password and I have used every password I have used previously but the phone is not accepting the last one I upgraded to. I did a reset of my password but now have to wait 20 more minutes before I can try to get into my phone. I have no idea as to what to do. Thanks to anyone who can help.

    Could it be your email password, or your exchange pass code ? If that does not work you may need to restore the iPad. Good luck.

  • How Do you set up the IPod Touch to your pc home computer - when it asks for a password - what password is needed?

    I just received an IPod Touch for a gift. Have a home computer through Charter. Have wi fi with pc at home.  I am unable to get the Ipod to work with the pc and wifi. 
    Wi fi is on - At choose a Network - Have the option of t.dillow and other.
    When i choose tdillow it asks for a password.  What password is required?
    I cannot get my email either.
    How do I get the IPOD to connect to my wifi and enable to use mail through Yahoo account?

    You need the password for your network/router. Sometime the dfault password is on a sticker on the router.  As the person who controls/set up the router.

  • Memory Dump for Bind Variable included in 10046 trace file

    A curious thing I've seen today. While looking through an extended Oracle Trace file, I see the following:
    =====================
    PARSING IN CURSOR #26 len=88 dep=0 uid=28 oct=6 lid=28 tim=2667421262 hv=3259943383 ad='4bbb4ad8'
    UPDATE V_QRTZ_TRIGGERS SET JOB_DATA = :1 WHERE TRIGGER_NAME = :2 AND TRIGGER_GROUP = :3
    END OF STMT
    PARSE #26:c=0,e=54,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=1,tim=2667421260
    BINDS #26:
    bind 0: dty=113 mxl=3876(3876) mal=00 scl=00 pre=00 oacflg=03 oacfl2=0 size=3876 offset=0
    bfp=0cd99aa4 bln=3876 avl=86 flg=05
    value=
    Dump of memory from 0x0CD99AA4 to 0x0CD99AFA
    *CD99AA0          01005400 00002C01 00000100      [.T...,......]*
    *CD99AB0 00000100 EB23EF03 581D0000 571D0000  [......#....X...W]*
    *CD99AC0 0F000F00 00000000 0F005920 0E14E12F  [........ Y../...]*
    *CD99AD0 CDE21ADA 00000000 737E06D9 0400FB09  [..........~s....]*
    *CD99AE0 07000F00 800387E6 A17B3F20 0000000E  [........ ?{.....]*
    *CD99AF0 571D0000 EE56CF00 00001500           [...W..V.....]*
    bind 1: dty=1 mxl=128(45) mal=00 scl=00 pre=00 oacflg=03 oacfl2=10 size=256 offset=0
    bfp=0cd99984 bln=128 avl=15 flg=05
    value="EC-MHM Retrieve"
    bind 2: dty=1 mxl=128(96) mal=00 scl=00 pre=00 oacflg=03 oacfl2=10 size=0 offset=128
    bfp=0cd99a04 bln=128 avl=32 flg=01
    value="2BBDE87AF15D4B5E867AB6482D7D58C8"
    BINDS #9:
    bind 0: dty=1 mxl=32(18) mal=00 scl=00 pre=00 oacflg=03 oacfl2=1 size=192 offset=0
    bfp=0c2de90c bln=32 avl=18 flg=05
    value="EC_SCHEDULE_PIN_TO"
    bind 1: dty=1 mxl=128(15) mal=00 scl=00 pre=00 oacflg=13 oacfl2=1 size=0 offset=32
    bfp=0c2de92c bln=128 avl=15 flg=01
    value="EC-MHM Retrieve"
    bind 2: dty=1 mxl=32(32) mal=00 scl=00 pre=00 oacflg=13 oacfl2=1 size=0 offset=160
    bfp=0c2de9ac bln=32 avl=32 flg=01
    value="2BBDE87AF15D4B5E867AB6482D7D58C8"
    EXEC #9:c=15625,e=1060,p=0,cr=0,cu=0,mis=0,r=0,dep=1,og=1,tim=2667424863
    FETCH #9:c=0,e=95,p=0,cr=4,cu=0,mis=0,r=1,dep=1,og=1,tim=2667425091
    FETCH #9:c=0,e=1,p=0,cr=0,cu=0,mis=0,r=0,dep=1,og=0,tim=2667425236
    Is this normal and is it caused by size of Bind Variable?
    Kind regards,
    TRONd

    It's normal and and happens due to bind variable datatype. In your case this is blob, (there are a couple of other datatypes - timestamp among other) which will be represented that way in the trace file.
    Best regards
    Maxim

  • Report Viewer asking for Login credentials on Non-Development PC

    I have created several reports within Crystal 2008(using the push method). I run these reports in a VB6 application using the Report Viewer. Reports without sub-reports will run on both the development and non-development PC. If I try to run a report with a sub on a non-development PC it will prompt the user for login credentials.
    I can run the same report(with a sub) in development or on a PC with Crystal 2008 and Visual Basic installed. I have created a setup.exe to install this on the pc and included both the Crystal runtime 2008 and Crystal Report Viewer 2008 as prerequisites.
    Any help would be appreciated

    We created a form in Visual Studio 2008 that holds the Crystal Report Viewer.  We then used Interop to wrap the assembly into a usable reference for the VB6 application. 
    This was working fine when we were using the pull method for the report but once we changed the code to use the push method reports with subs will ask for a login. No matter what is entered the report will not print to the screen.  The reports without a sub will print just fine.
    Not sure what to look for next?
    Thanks for your quick response.

Maybe you are looking for

  • Use a checkbox to hide/show (toggle) another field

    I have a form I am creating in Adobe Acrobat X.  The form will ultimately be used as a data entry interface on iPads.  I need to keep the form very simple but there is a lot of technical information the end users may need to help fill out the forms. 

  • How do I get pics from all apps gallery etc?

    How do I upload from my gallery etc?

  • Default trace?

    Hi Friends, usr/sap/<sid>/DVEBMGS<nn>/j2ee/cluster/server0/log/archive In the above folder the default trace files of XI are getting archived, which is  zip format and in hidden mode.These files have occupied huge amount of space. What is the importa

  • 2 master pages with table data flow

    Hi,   My form got 2 master pages. Each master page will display atleast once in the output preview. First page displays table data which may or may not flow to the second page depending on the no.of records. But, the form will show both the master pa

  • Corresponding travel plan needs to be disabled in My Travel Requests

    Dear all, We want to disable the column "Corresponding travel plan" from My Trips and Expenses --> My Travel Requests in Webdynpro Java Application. Where should I do the customization in spro? Thank you, Regards, Gauri Gosavi.