Invalid length parameter passed to the LEFT or SUBSTRING function, error on INSERT

I have a stored procedure that does a BULK INSERT of a csv file into myCSVTable then INSERTs records from
myCSVTable into myTable. The INSERT statement is giving me this error: 
Invalid length parameter passed to the LEFT or SUBSTRING function.
CSV File: 
3,020000007,OR,051,97205,02020005,41075,19470721,2,0,,0,0,0,0,0,1,0,0,,,,,,,,,0,2,,334418,334418,334418,13,,0,,0,0,0,0,0,1,0,0,1,20100217,,,,,20100304,20121030,1,1,,,0,0,0,0,0,,,,,0,0,0,0,9,0,0,0,1,1,0,0,0,3,00,20100304,20100426,20100922,20101011,20100304,20100922,20101011,,20101011,20100819,,20100326,20100326,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,0,0,,,1,1,,9,9,1,1,1,1,0,0,111150,111150,111150,999999,5586.25,4714.01,5884.28,7055.89,11097.89,10839.39,0.00,2,,,,,20120617,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,The
Workforce Investment Board for the City of xxxxxxxx and xxxxxxxxx and W,020005,,mstr: 1000000000000000017  js: 372651          epi: 1,Jane Doe
4,020000007,OR,051,97205,02020005,41075,19470721,2,0,,0,0,0,0,0,1,0,0,,,,,,,,,0,2,,334418,334418,334418,13,,0,,0,0,0,0,0,1,0,0,1,20100217,,,,,20100304,20121030,1,1,,,0,0,0,0,0,,,,,0,0,0,0,9,0,0,0,1,1,0,0,0,3,00,20100304,20100426,20100922,20101011,20100304,20100922,20101011,,20101011,20100819,,20100326,20100326,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,0,0,,,1,1,,9,9,1,1,1,1,0,0,111150,111150,111150,999999,5586.25,4714.01,5884.28,7055.89,11097.89,10839.39,0.00,2,,,,,20120617,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,The
Workforce Investment Board for the City of xxxxxxxx and xxxxxxxxx and W,020005,,mstr: 1000000000000000017  id: 020000007       epi: 1,Jane Doe
There is no LEFT or SUBSTRING function used in the procedure and there are no triggers on either table. 
The procedure had been working fine until today, when I altered one of the CSV fields. The code which triggers the error is this:
INSERT [myTable]
SELECT * FROM [myCSVTable]
The weird thing is, the 1st record containing the changed field (mstr: 1000000000000000017  js: 372651          epi: 1) triggers the error, but the 2nd record containing
the old field value (mstr: 1000000000000000017  id: 020000007       epi: 1), does not. 
There are only blank spaces in the 2 strings, no non-printable characters or anything like that. I'm confused.

A View of myTable was causing the problem.
Hi LoriCazares,
Do you mean that you have solved this issue? If so, please close this thread.
Regards,
Elvis Long
TechNet Community Support

Similar Messages

  • Invalid length parameter passed to the LEFT or SUBSTRING function.

     Below code is returning me invalid length (or) parameter.
    Msg 537, Level 16, State 2, Line 2
    Invalid length parameter passed to the LEFT or SUBSTRING function.
    , ( select Top 1 person_id from person_membership where status_flag='A' and membership_id = a.membership_id and person_id in (select person_id from person where first_name =SUBSTRING(a.firstname, 1, CHARINDEX(' ', a.firstname) - 1) and surname = REVERSE(SUBSTRING(REVERSE(a.firstname), 1, CHARINDEX(' ', REVERSE(a.firstname)) - 1)) ))as Person_ID
    ,(select rtrim(ltrim(isNull(address_line1,''))) + ' ' + rtrim(ltrim(isNull(address_line2,''))) + ' ' + rtrim(ltrim(isNull(address_line3,'')))
    + ' ' + rtrim(ltrim(isNUll(suburb,''))) + ' ' + rtrim(ltrim(isNUll(state,''))) + ' ' + rtrim(ltrim(isNUll(convert(char(10),postcode),'')))
    from address where address_type= 'P' and person_id = ( select Top 1 person_id from person_membership where status_flag='A' and membership_id = a.membership_id and person_id in (select person_id from person where first_name =SUBSTRING(a.firstname, 1, CHARINDEX(' ', a.firstname) - 1) and surname = REVERSE(SUBSTRING(REVERSE(a.firstname), 1, CHARINDEX(' ', REVERSE(a.firstname)) - 1)) ))
    )as Person_Postal_Address
    ,(select rtrim(ltrim(isNull(address_line1,''))) + ' ' + rtrim(ltrim(isNull(address_line2,''))) + ' ' + rtrim(ltrim(isNull(address_line3,'')))
    + ' ' + rtrim(ltrim(isNUll(suburb,''))) + ' ' + rtrim(ltrim(isNUll(state,''))) + ' ' + rtrim(ltrim(isNUll(convert(char(10),postcode),'')))
    from address where address_type= 'H' and person_id = ( select Top 1 person_id from person_membership where status_flag='A' and membership_id = a.membership_id and person_id in (select person_id from person where first_name =SUBSTRING(a.firstname, 1, CHARINDEX(' ', a.firstname) - 1) and surname = REVERSE(SUBSTRING(REVERSE(a.firstname), 1, CHARINDEX(' ', REVERSE(a.firstname)) - 1)) ))
    )as Person_Home_Address
    ,(SELECT contact.contact_detail FROM contact WHERE contact.contact_type = 'H' AND contact.person_id = d.person_id AND
    contact.contact_id = (SELECT max(dbo.contact.contact_id) FROM dbo.contact WHERE dbo.contact.contact_type = 'H'
    and dbo.contact.person_id = (select Top 1 person_id from person_membership where status_flag='A'
    and membership_id = a.membership_id and person_id in (select person_id from person where first_name =SUBSTRING(a.firstname, 1, CHARINDEX(' ', a.firstname) - 1) and surname = REVERSE(SUBSTRING(REVERSE(a.firstname), 1, CHARINDEX(' ', REVERSE(a.firstname)) - 1)) ) ) )
    ) as Person_Home
    ,(SELECT contact.contact_detail FROM contact WHERE contact.contact_type = 'W' AND contact.person_id = d.person_id AND
    contact.contact_id = (SELECT max(dbo.contact.contact_id) FROM dbo.contact WHERE dbo.contact.contact_type = 'W'
    and dbo.contact.person_id = (select Top 1 person_id from person_membership where status_flag='A'
    and membership_id = a.membership_id and person_id in (select person_id from person
    where first_name =SUBSTRING(a.firstname, 1, CHARINDEX(' ', a.firstname) - 1) and surname = REVERSE(SUBSTRING(REVERSE(a.firstname), 1, CHARINDEX(' ', REVERSE(a.firstname)) - 1)))))
    ) as Person_Work_Phone
    -kccrga http://dbatrend.blogspot.com.au/

    I have fixed the query by applying the below solution
    , ( select Top 1 person_id from person_membership where status_flag='A' and membership_id = a.membership_id and person_id in (select person_id from person
    where first_name =SUBSTRING(a.firstname, NULLIF(CHARINDEX(' ',a.firstname),0)+1, CHARINDEX(' ', a.firstname) + 1)
    and surname = REVERSE(SUBSTRING(REVERSE(a.firstname),NULLIF(CHARINDEX(' ',a.firstname),0)+1, LEN(a.firstname)- CHARINDEX(' ', REVERSE(a.firstname)) + 1)) ))as Person_ID
    ,(select rtrim(ltrim(isNull(address_line1,''))) + ' ' + rtrim(ltrim(isNull(address_line2,''))) + ' ' + rtrim(ltrim(isNull(address_line3,'')))
    + ' ' + rtrim(ltrim(isNUll(suburb,''))) + ' ' + rtrim(ltrim(isNUll(state,''))) + ' ' + rtrim(ltrim(isNUll(convert(char(10),postcode),'')))
    from address where address_type= 'P' and person_id = ( select Top 1 person_id from person_membership where status_flag='A' and membership_id = a.membership_id
    and person_id in (select person_id from person where first_name =SUBSTRING(a.firstname, NULLIF(CHARINDEX(' ',a.firstname),0)+1,LEN(a.firstname)- CHARINDEX(' ', a.firstname) + 1)
    and surname = REVERSE(SUBSTRING(REVERSE(a.firstname),NULLIF(CHARINDEX(' ',a.firstname),0)+1, LEN(a.firstname)- CHARINDEX(' ', REVERSE(a.firstname)) + 1)) ))
    )as Person_Postal_Address
    ,(select rtrim(ltrim(isNull(address_line1,''))) + ' ' + rtrim(ltrim(isNull(address_line2,''))) + ' ' + rtrim(ltrim(isNull(address_line3,'')))
    + ' ' + rtrim(ltrim(isNUll(suburb,''))) + ' ' + rtrim(ltrim(isNUll(state,''))) + ' ' + rtrim(ltrim(isNUll(convert(char(10),postcode),'')))
    from address where address_type= 'H' and person_id = ( select Top 1 person_id from person_membership where status_flag='A'
    and membership_id = a.membership_id and person_id in (select person_id from person
    where first_name =SUBSTRING(a.firstname, NULLIF(CHARINDEX(' ',a.firstname),0)+1, LEN(a.firstname)-CHARINDEX(' ', a.firstname) + 1)
    and surname = REVERSE(SUBSTRING(REVERSE(a.firstname),NULLIF(CHARINDEX(' ',a.firstname),0)+1, LEN(a.firstname)- CHARINDEX(' ', REVERSE(a.firstname)) + 1)) ))
    )as Person_Home_Address
    ,(SELECT contact.contact_detail FROM contact WHERE contact.contact_type = 'H' AND contact.person_id = d.person_id AND
    contact.contact_id = (SELECT max(dbo.contact.contact_id) FROM dbo.contact WHERE dbo.contact.contact_type = 'H'
    and dbo.contact.person_id = (select Top 1 person_id from person_membership where status_flag='A' and membership_id = a.membership_id
    and person_id in (select person_id from person where first_name
    =SUBSTRING(a.firstname, NULLIF(CHARINDEX(' ',a.firstname),0)+1, LEN(a.firstname)-CHARINDEX(' ', a.firstname) + 1)
    and surname = REVERSE(SUBSTRING(REVERSE(a.firstname),NULLIF(CHARINDEX(' ',a.firstname),0)+1, LEN(a.firstname)- CHARINDEX(' ', REVERSE(a.firstname)) + 1)) ) ) )
    ) as Person_Home_Phone
    ,(SELECT contact.contact_detail FROM contact WHERE contact.contact_type = 'W' AND contact.person_id = d.person_id AND
    contact.contact_id = (SELECT max(dbo.contact.contact_id) FROM dbo.contact WHERE dbo.contact.contact_type = 'W' and dbo.contact.person_id = (select Top 1 person_id from person_membership where status_flag='A'
    and membership_id = a.membership_id and person_id in (select person_id from person where first_name
    =SUBSTRING(a.firstname, NULLIF(CHARINDEX(' ',a.firstname),0)+1, LEN(a.firstname)-CHARINDEX(' ', a.firstname) + 1)
    and surname = REVERSE(SUBSTRING(REVERSE(a.firstname), NULLIF(CHARINDEX(' ',a.firstname),0)+1, LEN(a.firstname)-CHARINDEX(' ', REVERSE(a.firstname)) + 1)) ) ) )
    ) as Person_Work_Phone
    -kccrga http://dbatrend.blogspot.com.au/

  • Adding a CM: Invalid length parameter passed to the RIGHT function. (CINF)

    We started seeing this error message a week ago when attempting to add a Credit Memo.  We only see this error message when entering Credit Memos and not any other finacial documents.  I've done some preliminary research and haven't really come up with anything to point to the issue.  Prior to reporting this to my support partner, I wanted to see if anybody here has seen this before or give me some ideas to look into the source of the issue.
    Full error message: Microsoft SQL Native Client SQL Server Invalid length parameter passed to the RIGHT function. (CINF)

    Checking the list of form ID's at [http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/892] shows the A/R Credit Memo as 179 and the A/P Credit Memo as 181.  This also corresponds with what I see when viewing the system information on the form.

  • Getting error Invalid length parameter passed

    Hi,
    I'm getting an error running my query. It say "Invalid length parameter passed to the LEFT or SUBSTRING  function. I will be getting the string in between of hyphen using the code below. May i ask your assistance or idea on how to fix this issue.
    thank you.
     Substring(ins.itemid,11,CHARINDEX('-',ins.itemid+'-',11)-11) AS MODEL
    Msg 537, Level 16,
    State 3, Line 1
    Invalid length parameter passed to the LEFT or SUBSTRING
    function.
    Sample data of Itemid.
    B300-4410-ONEMAX-U
    B300-1725-XWHT-U
    B300-3110-VT981-U
    B300-1720-DRZRKCROBLK-U
    B300-1720-DRDTHN32BLK-U

    That'll cause empty strings to show up into you're result set but shouldn't cause the the SUBSTRING function to fail. 
    The error is the result of the SUBSTRING function trying to bring back a negative number of characters.
    Try running the following and see what comes back...
    SELECT ins.itemid
    FROM dbo.TableName ins
    WHERE LEN(ins.itemid) < 11
    If you don't find any itemids what are less than 11 characters (I'm 99% sure you will), try using a little test script like the following to test suspect values...
    IF OBJECT_ID('tempdb..#temp') IS NOT NULL
    DROP TABLE #temp
    GO
    CREATE TABLE #temp (
    itemid VARCHAR(30)
    INSERT #temp (itemid) VALUES
    ('B300-4410-ONEMAX-U'),
    ('B300-1725- '),
    ('B300- 3110-VT981-U'),
    ('B300-1720-DRZRKCROBLK-U'),
    ('B300- 1720-DRDTHN32BLK-U')
    SELECT ins.itemid
    FROM #temp ins
    WHERE LEN(ins.itemid) < 11
    SELECT
    SUBSTRING(
    ins.itemid, 11, CHARINDEX('-',ins.itemid+'-',11)-11) AS MODEL FROM #temp ins
    HTH,
    Jason
    Jason Long

  • How to get each value from a parameter passed like this '(25,23,35,1)'

    Hi
    One of the parameter passed to the function is
    FUNCTION f_main_facility(pi_flag_codes VARCHAR2) return gc_result_set AS
    pi_flag_codes will be passed a value in this way '(25,23,35,1)'
    How to get each value from the string
    like 25 first time
    23 second time
    35 third time
    1 fourth time
    I need to build a select query with each value as shown below:-
    (SELECT t2.org_id, t4.description
    from org_name t2, ref_org_name t3, code_table t4
    where t2.att_data = t4.code
    and t3.ref_code = t2.att_type
    and t2.att_type = 25 and t3.code_type = t4.code_type
    and to_date('01-JAN-10', 'DD-MON-YY') between t2.att_start_date AND t2.att_end_date) q1,
    (SELECT t2.org_id, t4.description
    from org_name t2, ref_org_name t3,code_table t4
    where t2.att_data = t4.code
    and t3.ref_code = t2.att_type
    and t2.att_type = 23 and t3.code_type = t4.code_type
    and to_date('01-JAN-10', 'DD-MON-YY') between t2.att_start_date AND t2.att_end_date) q2,
    (SELECT t2.org_id, RTRIM(xmlagg(xmlelement(e, t4.description || ';')
    ORDER BY t4.description).EXTRACT('//text()'), ';') AS DESCRIPTION
    from org_name t2, ref_org_name t3,code_table t4
    where t2.att_data = t4.code
    and t3.ref_code = t2.att_type
    and t2.att_type = 35 and t3.code_type = t4.code_type
    and to_date('01-JAN-10', 'DD-MON-YY') between t2.att_start_date AND t2.att_end_date
    group by t2.org_id) q3,
    (SELECT t2.org_id, t4.description
    from org_name t2, ref_org_name t3, code_table t4
    where t2.att_data = t4.code
    and t3.ref_code = t2.att_type
    and t2.att_type = 1 and t3.code_type = t4.code_type
    and to_date('01-JAN-10', 'DD-MON-YY') between t2.att_start_date AND t2.att_end_date) q4
    Please help me with extracting each alue from the parm '(25,23,35,1)' for the above purpose. Thank You.

    chris227 wrote:
    I would propose the usage of regexp for readibiliy purposes and only in the case if this doesnt perform well, look at solutions using substr etc.
    select
    regexp_substr( '(25,23,35,1)', '\d+', 1, 1) s1
    ,regexp_substr( '(25,23,35,1)', '\d+', 1, 2) s2
    ,regexp_substr( '(25,23,35,1)', '\d+', 1, 3) s3
    ,regexp_substr( '(25,23,35,1)', '\d+', 1, 4) s4
    from dual 
    S1     S2     S3     S4
    "25"     "23"     "35"     "1"In pl/sql you do something like l_val:= regexp_substr( '(25,23,35,1)', '\d+', 1, 1);
    If t2.att_type is type of number you will do:
    t2.att_type= to_number(regexp_substr( '(25,23,35,1)', '\d+', 1, 1))Edited by: chris227 on 01.03.2013 08:00Sir,
    I am using oracle 10g.
    In the process of getting each number from the parm '(25,23,35,1)' , I also need the position of the number
    say 25 is at 1 position.
    23 is at 2
    35 is at 3
    1 is at 4.
    the reason I need that is when I build seperate select for each value, I need to add the query number at the end of the select query.
    Please see the code I wrote for it, But the select query is having error:-
    BEGIN
    IF(pi_flag_codes IS NOT NULL) THEN
    SELECT length(V_CNT) - length(replace(V_CNT,',','')) FROM+ ----> the compiler gives an error for this select query : PLS-00428:
    *(SELECT '(25,23,35,1)' V_CNT  FROM dual);*
    DBMS_OUTPUT.PUT_LINE(V_CNT);
    -- V_CNT := 3;
    FOR L_CNT IN 0..V_CNT LOOP
    if L_CNT=0 then
    V_S_POS:=1;
    V_E_POS:=instr(pi_flag_codes, ',', 1, 1)-1;
    else
    V_S_POS:=instr(pi_flag_codes,',',1,L_CNT)+1;
    V_E_POS:=instr(pi_flag_codes, ',', 1, L_CNT+1)-V_S_POS;
    end if;
    if L_CNT=V_CNT then
    V_ID:=TO_NUMBER(substr(pi_flag_codes,V_S_POS));
    else
    V_ID:=TO_NUMBER(substr(pi_flag_codes,V_S_POS,V_E_POS));
    end if;
    VN_ATYPE := ' t2.att_type = ' || V_ID;
    rec_count := rec_count +1;
    query_no := 'Q' || rec_count;
    Pls help me with fetching each value to build the where cond of the select query along with the query number.
    Thank You.

  • Parameter passing problem to standard JSP iView

    Hi,
    I'm trying to launch a standard iView with some a parameter directly from the browser by calling the url http://<server>/<iview>?<param>=<value>
    The iView ID is com.sap.pct.hcm.ecmmain.approval and by looking at its details from the content catalog I saw there was a property called CREVI. I would like to fill this in but the iview doesn't respond to the URL params at all. Setting them staticly by editing the iView works perfect.
    I have also checked that the "Parameters to pass from Page Request" property includes * and excludes some other properties than the one I'm testing.
    I thought this was going to be simple but can't just make it work..I guess I'm missing something basic or the property can't be used? Any ideas?
    Thanks,
    Mikko

    Hi Mikko,
    We have found inconsistencies with regards to parameter passing in the URL, sometimes they are read and sometimes not.  I suggest that you try to change the order of the parameters as this can affect if its read.  I also believe other parameters can interfere whether or not it is read so try various scenarios.
    Cheers,
    John

  • Parameter Passing from UWL to WebDynpro Component

    Hi Everyone,
    I m having a small problem in parameter passing from the UWL to the Webdynpro component(EP6 SP16).
    The UWL shows a list of shopping carts and I ve configured it such that the Shopping carts open in the webdynpro application. Now the requirement is that I want to pass the shopping cart number from the workitem container and retrieve it in the webdynpro component.
    The only thing that i m able to retrieve is the work-item ID. I ve followed the documentation on help.sap.com but I m not able to figure out how to move ahead with this.The code which i m using to retrive the dynamic parameter is
    String text = WDWebContextAdapter.getWebContextAdapter().getRequestParameter("DynamicParameter");
    Can somebody please help me with this..
    Regards,
    Prathamesh

    Have you looked at this weblog by Ginger Gatling?
    Create new UI's for existing workflow tasks with ABAP Web Dynpro and Universal Worklist!
    Hope this helps.
    Sudha

  • Parameter passing from master to subreport

    Is it possible to pass a multi-value parameter from a master report to one or more subreports? If so, how?
    Thanks for any help.
    Wayne E. Pfeffer

    Yes you can do this. I suggest the following: In your subreport make the report parameter a multi-value parameter. Test the subreport stand alone and make sure it works. Then drop the subreport into your main report, and map the subreport parameters to the main report parameters.
    Scenario 1 (multi value parameter pass through):
    The Main report has report parameter A which is a multi value parameter. You want to pass it to SubReport1 which has a report parameter B which is also defined as multi value parameter. In this case the mapping is just a simple parameter expression: =Parameters!A.Value
    The subreport RDL element would look like this:
              <Subreport Name="SubReport1">
                <Parameters>
                  <Parameter Name="B">
                    <Value>=Parameters!A.Value</Value>
                  </Parameter>
                </Parameters>
              </Subreport>  
    Scenario 2:
    The Main report has no report parameters. You have a SubReport1 with a report parameter B defined as multi value parameter. You want to pass e.g. three selected values "A", "B", "C" as parameter values to the subreport. You need to create a multidimensional object array on-the-fly, e.g. with the Split function, e.g.: =Split("A,B,C", ",")
    RDL example:
              <Subreport Name="SubReport1">
                <Parameters>
                  <Parameter Name="B">
                    <Value>=Split("A,B,C", ",")</Value>
                  </Parameter>
                </Parameters>
              </Subreport>
    Scenario 3:
    The Main report has a multi-value parameter A. You want to pass only the first selected value from the main report's parameter to the subreport and the subreport's report parameter B is a single-value parameter. You can do this by using e.g. =Parameters!A.Value(0)
    RDL example:
              <Subreport Name="SubReport1">
                <Parameters>
                  <Parameter Name="B">
                    <Value>=Parameters!A.Value(0)</Value>
                  </Parameter>
                </Parameters>
              </Subreport>
    -- Robert

  • Java.util.zip.ZipException: a device attached to the system is not function

    getting a java.util.zip.zipexception : a device attached to the system is not functioning error - what could cause such an error?
    My program finds all zip files in an archive and then searches through them for xls files, which it extracts and re-locates.
    I havent even a clue where to look for the cause of this exception but Ill attach at the bottom the code in the general vicitiny of the trigger so that you can get kind of an idea what Im trying to do, and if im lucky, even spot my problem. :) Thanks!!
    //zips is an array of zip files
    int found = 0;
    File[] haveXLs = new File[zips.length];
    for (int i = 0; i < zips.length; i++){
    String fileName = new String("L:/Vision/Archive/" + zips.getName());
    ZipFile archive = new ZipFile(fileName);
    String name = zips[i].getName().substring(0,8);
    for(Enumeration e = archive.entries(); e.hasMoreElements();){
    ZipEntry entry = (ZipEntry) e.nextElement();
    if(entry.getName().substring(0,8) == name){
    haveXLs[found] = zips[i];
    found++;

    Hey there a few things.
    Make sure that you dont use fileseparators like you do. ("/")
    Use the separator generated for your system.
    Something like:
    String sep = System.getProperty("file.separator");
    You mentioned it work local, but not network.
    Either you have plenty of harddrives or L: is a mapped drive.
    Is it working at the mapped drive?
    When you say on the network, how are you accessing the files?
    Could it be possible for another user to lock a file, so you wont have access to it over the network?
    BR.
    MagDy

  • Left outer join functions like simple join

    I created two views SCO_REQGROSSLINES_V & SCO_REQLINESCOMPLETE on Oracle requisitions base tables. Our business rules enforce the following identity: the number of gross requisition lines will always be greater than or equal to the number of requisition lines complete. (By complete I mean delivered.)
    Each view has a key named DATESUBINV_KEY constructed of a transaction date and the subinventory code using this logic:
    , TO_CHAR(TRUNC(transaction_date),'YYYYMMDD') || subinventory_code
    On 03-SEP-2010 a user created a requisition with one line item for material from the HEAT subinventory which was not delivered. This row is retuned in the result set when I query on SCO_REQGROSSLINES_V but is NOT returned when I query on SCO_REQLINESCOMPLETE. So far so good.
    When I issue either of the the following left outer joins I do not get the row for the row for the HEAT subinventory on 03-SEP-2010:
    select rgl.trxn_date
    , rgl.subinventory
    , rgl.line_count gross_line_count
    , rgl.ext_prc gross_value
    , rlc.line_count lines_filled
    , rlc.ext_prc lines_filled_value
    from SCO_REQGROSSLINES_V rgl left outer join sco_reqlinescomplete_v rlc
    ON rgl.datesubinv_key = rlc.datesubinv_key
    where rgl.TRXN_DATE BETWEEN to_date('29-AUG-2010') AND to_date('04-SEP-2010')
    and rlc.trxn_date BETWEEN to_date('29-AUG-2010') AND to_date('04-SEP-2010')
    order by rgl.trxn_date, rgl.subinventory
    select rgl.trxn_date, rgl.subinventory
    , rgl.line_count gross_line_count
    , rgl.ext_prc gross_value
    , rlc.line_count lines_filled
    , rlc.ext_prc lines_filled_value
    from SCO_REQGROSSLINES_V rgl
    , sco_reqlinescomplete_v rlc
    where rgl.TRXN_DATE BETWEEN to_date('29-AUG-2010') AND to_date('04-SEP-2010')
    and rlc.trxn_date BETWEEN to_date('29-AUG-2010') AND to_date('04-SEP-2010')
    AND rgl.datesubinv_key = rlc.datesubinv_key(+)
    order by rgl.trxn_date, rgl.subinventory
    Question: Why would the left outer joins function as a simple join on DATESUBINV_KEY? Do keys on views function differently than keys defined in the data dictionary? If they do how can I make these keys to function like data dictionary keys?

    Hi,
    The WHERE clause is applied after the outer join is completed. In your example, rows from rgl will be in the result set even if they have no match in rlc. In those cases, all the columns from rlc will be NULL.
    Okay, so you have these rows that contain data from rgl but NULLs where the data from rlc was supposed to go. Now it's time to start the WHERE clause. You then apply conditions like this in the WHERE clause:
    AND     rlc.trxn_date BETWEEN ...NULL is between anything, so the row that the outer join prodeuced is rejected.
    All conditions involivn columns from rlc probably need to be part of the join condition, not the WHERE clause.
    For example, in you first query the FROM and WHERE clauses might be:
    FROM          sco_reqgrosslines_v      rgl
    LEFT OUTER JOIN  sco_reqlinescomplete_v  rlc  ON    rgl.datesubinv_key   = rlc.datesubinv_key
                                            AND   rlc.trxn_date       BETWEEN TO_DATE ( '29-AUG-2010'
                                                                        , 'DD-MON-YYYY'
                                                  AND       TO_DATE ( '04-SEP-2010'
                                                              , 'DD-MON-YYYY'
    WHERE   rgl.trxn_date     BETWEEN TO_DATE ( '29-AUG-2010'
                             , 'DD-MON-YYYY'
                   AND     TO_DATE ( '04-SEP-2010'
                             , 'DD-MON-YYYY'
                             )Always use (at least) two arguments when calling TO_DATE.
    Conditions that only involve rgl can be in the WHERE clause, but if any conditions from rlc are in the WHERE clause, then the effect will be the same as an inner join.
    There no difference between tables and views (or sub-queries) in this regard: the same thing would happen regardless of whether rgl and rlc were really tables or not.

  • What may be the cause of this error java.sql.SQLException: invalid sql type passed to callable statement in iplanet ussing JNDI

     

    Hi,
    The possibilities can be of various reasons, with the sql statements,
    xml descriptors, data sources, improper drivers anything. To crack down
    the solution, kindly let me know the error messages and what exactly are
    you trying to accomplish.
    Thanks & Regards
    Raj
    manimaran t wrote:
    what may be the cause of this error java.sql.SQLException: invalid sql
    type passed to callable statement in iplanet ussing JNDI
    Try our New Web Based Forum at http://softwareforum.sun.com
    Includes Access to our Product Knowledge Base!

  • To pass parameter values to the object reference of action step in sequence file of teststand programatically using C#.

    //Initialize the Engine
                EngineClass myEngine = new EngineClass();
                myEngine.LoadTypePaletteFilesEx(TypeConflictHandlerTypes.ConflictHandler_Prompt, 0);
                Step myStep = myEngine.NewStep(AdapterKeyNames.DotNetAdapterKeyname,StepTypes.StepType_Action);
                myStep.Name = "object";
                DotNetModule dotnetmodule = myStep.Module as DotNetModule;
                dotnetmodule.SetAssembly(DotNetModuleAssemblyLocations.DotNetModule_AssemblyLocation_File,@"C:sequence.dll");
                dotnetmodule.ClassName = "CN";
                dotnetmodule.MemberType = DotNetModuleMemberTypes.DotNetMember_GetProperty;
                dotnetmodule.MemberName = "ISI";  
    mySequence.Locals.NewSubProperty("object", PropertyValueTypes.PropValType_Reference, false, "", 0);        
    Sequence mySequence = myEngine.NewSequence();
                mySequence.Locals.NewSubProperty(varName, PropertyValueTypes.PropValType_Reference, false, String.Empty, 0);
    mySequence.InsertStep(myStep, 0, StepGroups.StepGroup_Main);
                SequenceFile seqFile = myEngine.NewSequenceFile();
                seqFile.InsertSequence(mySequence);
    seqFile.Save("C:\\mySeq.seq");
    I have done this,dynamically creating a sequence file in teststand programatically through c#.
    Problem is
    1.I created an action step and object Reference variable for the step, but i am not able to pass  parameter values to the objectReference 
    2.I am not able to load the sequence in to the main Sequence of the sequence file in the teststand. How can I do these two things.

    Hi,
    have you ever followed on my Links ?!?!?
    If not please jump to this one
    http://forums.ni.com/ni/board/message?board.id=330&thread.id=26880 
    and read the the answer from Mannoch
    starting with this words:
    Anthony -
    Currently, functionality for retrieving the Metadata Token for a class constructor or member is not fully provided in the TestStand .NET Adapter API. The DotNetModule.GetConstructorMetadataToken() and DotNetModule.GetMetadataToken() methods only return the correct Metadata Token when the member/constructor prototypes have already been loaded. Thus, in the case of your code, when you call DotNetModule.GetMetadataToken(), the method is returning -1 because the member prototype for the Step you are referring to has not yet been loaded.
    That means have to do a workaround for your stuff.
    Juergen
    =s=i=g=n=a=t=u=r=e= Click on the Star and see what happens :-) =s=i=g=n=a=t=u=r=e=

  • Problems with Flexible Parameter Passing - Can anyone help with the answer

    Hi,
    having gone to the trouble of creating a generic form handler which utlises the ability of the PL/SQL Gateway to handle flexible parameters, we've come across an almighty problem.
    Whilst the gateway will create two arrays of parameter names and values, it doesn' t seem to handle arrays of values. So, although some of our forms have multi select list form elements, these seem to be incompatible with the Flexible parameter method, as only the first value is returned.
    Does anyone know of a solution to this?
    I really hope so, otherwise the whole methodology is a waste of effort, and I can't imagine why Oracle bothered to include it!
    Here's hoping.
    Thanks
    Dan

    Not sure what flexible parameters are but in the past I've worked on a form that had to pass multiple values (from a multi-select list item) to a report via a single parameter. We did this by creating a pipe delimited ("|") string of all the selected values. Leading and trailing pipes were also added to the concatenated string.
    This was exploded into individual rows by using the statement below:
    WITH t AS (SELECT '|1|2|3|4|' str FROM dual)
    SELECT str, level
    , SUBSTR(str, INSTR(str, '|', 1, level) +1, INSTR(str, '|', 1, level+1)-INSTR(str, '|', 1, level)-1) str2
    FROM t
    CONNECT BY INSTR(str, '|', 2, level) <> 0;
    '|1|2|3|4|' is the value of the passed in parameter.
    So the report query could look something like
    WITH t AS (SELECT SUBSTR(:p_str, INSTR(:p_str, '|', 1, level) +1, INSTR(:p_str, '|', 1, level+1)-INSTR(:p_str, '|', 1, level)-1) itemid
    FROM dual
    CONNECT BY INSTR(:p_str, '|', 2, level) <> 0)
    SELECT a.*
    FROM items a, t
    WHERE a.itemid = TO_NUMBER(t.itemid);
    Hope this helps.

  • Parameter value for the Compensation Review CREVI is invalid

    Dear Friends in a trying to access the Compensation Review application in MSS when i preview it applications shows the list of the employees. when i try to view the details of the comp review i am getting the error
    "Parameter value for the Compensation Review CREVI is invalid"
    What is this CREVI parameter? How do i get rid of this issue?

    Activated the HCM_ECM_CI_1 Business Function

  • Invalid table name when pass in the table name as variable in dynamic sql

    Hi,
    I need to create a stored procedure which will return a list of data to my java application like the following.
    first, select the table name from the first table.
    For example : SELECT T_NAME FROM MDR_SMSTABLES
    second, select the data from the table which returned by first select statement
    For example : SELECT * FROM T_NAME.
    I use dynamic sql with cursor to select the data. But it returns "java.sql.SQLException: ORA-00903: invalid table name"
    I fetch the table name to varchar2. I think this might the cause it returns me the this error. But i don't know what type should i put for the table name other then varchar2.
    val2 VARCHAR2(200);
    OPEN cv FOR
    SELECT T_NAME FROM MDR_SMSTABLES WHERE T_DATE=d_dt_sent;
    FETCH cv INTO val2;
    WHILE cv%FOUND
    LOOP
    OPEN refcur FOR
    'SELECT * FROM :t WHERE MID = :m' USING val2, msg_id;
    EXIT WHEN refcur IS NOT NULL;
    FETCH cv INTO val2;
    END LOOP;
    As my stored procedure is quite long, so i just paste some of the code here. Hope the information is enough. Can anyone please help?
    Thanks

    DECLARE
    val2 VARCHAR2 (200);
    cv sys_refcursor;
    refcur sys_refcursor;
    BEGIN
    OPEN cv FOR
    SELECT table_name
    FROM user_tables
    WHERE table_name IN ('EMP', 'DEPT');
    FETCH cv INTO val2;
    WHILE cv%FOUND
    LOOP
    OPEN refcur FOR 'SELECT * FROM '||val2;
    EXIT WHEN refcur IS NOT NULL;
    FETCH cv INTO val2;
    END LOOP;
    END;

Maybe you are looking for

  • No Conversation History neither in Outlook Conversation History nor in Lync Conversation Tab

    Good day, people! I use Lync Server 2013 and MSOffice Lync 2013 and also Exchange 2010. All users in our company felt fine about their conversation history in lync. A couple weeks ago it started: i created new AD Users - and their conversation histor

  • Nokia PC Suite running on Windows 7 (64 bit) with ...

    Can you give us a date for when we will be able to sync our calendar and contacts from MS Outlook 2010 64 bit with PC Suite!? OVI Suite support for this might be acceptable, but far from optimal as this program is pretty similar to using a 18 wheel m

  • Problem verifying xml signature

    We have a problem with verifying XML Signatures which are part of a SOAP message. Thanks a lot for helping! Hope my problem is understandable - otherwise ask. We use the following enviroment: Java6 Axis 2 V1.2 with XML Beans Step 1: The Java 6 XML Si

  • How to set sysdate as default date in dashboard prompt

    Hi all I want to set default date(sysdate) in dashboard prompt. How to do that. I have not done this before. tell me in clear. Thanks in advance.

  • The other kind of Pi

    Diademm 9.10.2160 SP 1b Try this DAC and look the result. Dac-Script original : Dim Pi : Pi = 3.14 Sub SFD_ReadChannel( ChannelNumberP, ParamP, DataP, ErrorP )   DataP = Pi End Sub and modification: Dim Pi_ : Pi_ = 3.14 Sub SFD_ReadChannel( ChannelNu