Why named parameter can't be used multiple times in PL/SQL block in JDBC

with the following PL/SQL block, when I run int in JDBC, I get an error,
it says, The number of parameter names does not match the number of registered parameters.
if all named parameters are used only once, then my program works fine.
My old program uses Oracle Forms to run the attached PL/SQL block correctly, I just want to run them in JDBC without more efforts, I don't want to rewrite all PL/SQL blocks.
Does oracle driver support this case? why the PL/SQL block can work in Oracle Forms but failed in JDBC?
Can we have an another solutions to avoid rewriting the PL/SQL block to stored procedure?
if I use following SQL:
BEGIN if :q is null then :q := 'X'; else :q := 'Y'; end if; END;
, Using java program:
import java.sql.*; public class RunPLSQLBlock { public static void main(String s[]) throws SQLException { String URL = "jdbc:oracle:thin:@192.168.11.199:1521:TIBSTEST"; Connection con = null; try { Class.forName("oracle.jdbc.driver.OracleDriver"); con = (Connection) DriverManager.getConnection(URL, "FBP1DEV", "FBP1DEV"); String SQL = "BEGIN  if :q is null then  :q := 'X'; else :q := 'Y'; end if; END;"; CallableStatement stmt = con.prepareCall(SQL); stmt.registerOutParameter("q", Types.VARCHAR); stmt.setString("q", "A"); stmt.execute(); } catch (Exception e) { e.printStackTrace(); } finally { if (con != null) { con.close(); } } } }
in the coding, only "q" registered, I got:
java.sql.SQLException: The number of parameter names does not match the number of registered praremeters at oracle.jdbc.driver.OracleSql.setNamedParameters(OracleSql.java:314) at oracle.jdbc.driver.OracleCallableStatement.execute(OracleCallableStatement.java:10096) at oracle.jdbc.driver.OraclePreparedStatementWrapper.execute(OraclePreparedStatementWrapper.java:5693) at RunPLSQLBlock.main(RunPLSQLBlock.java:28)
now, tried to register 3 indexes, changed fragments are below.
import java.sql.*; public class RunPLSQLBlock { public static void main(String s[]) throws SQLException { String URL = "jdbc:oracle:thin:@192.168.11.199:1521:TIBSTEST"; Connection con = null; try { Class.forName("oracle.jdbc.driver.OracleDriver"); con = (Connection) DriverManager.getConnection(URL, "FBP1DEV", "FBP1DEV"); String SQL = "BEGIN  if :q is null then  :q := 'X'; else :q := 'Y'; end if; END;"; CallableStatement stmt = con.prepareCall(SQL); stmt.registerOutParameter(1, Types.VARCHAR); stmt.registerOutParameter(2, Types.VARCHAR); stmt.registerOutParameter(3, Types.VARCHAR); stmt.setString(1, "A"); stmt.execute(); } catch (Exception e) { e.printStackTrace(); } finally { if (con != null) { con.close(); } } } }
now error changed to:
java.sql.SQLException: ORA-01006: bind variable does not exist at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:457) at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:400) at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:926) at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:476) at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:200) at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:543) at oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableStatement.java:208) at oracle.jdbc.driver.T4CCallableStatement.executeForRows(T4CCallableStatement.java:1416) at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1757) at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:4372) at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:4595) at oracle.jdbc.driver.OracleCallableStatement.execute(OracleCallableStatement.java:10100) at oracle.jdbc.driver.OraclePreparedStatementWrapper.execute(OraclePreparedStatementWrapper.java:5693) at RunPLSQLBlock.main(RunPLSQLBlock.java:26)
, now tried register only 1 position like below,
  CallableStatement stmt = con.prepareCall(SQL);   stmt.registerOutParameter(1, Types.VARCHAR);   stmt.setString(1, "A");   stmt.execute();
, it says:
java.sql.SQLException: Missing IN or OUT parameter at index:: 2 at oracle.jdbc.driver.OraclePreparedStatement.processCompletedBindRow(OraclePreparedStatement.java:2177) at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:4356) at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:4595) at oracle.jdbc.driver.OracleCallableStatement.execute(OracleCallableStatement.java:10100) at oracle.jdbc.driver.OraclePreparedStatementWrapper.execute(OraclePreparedStatementWrapper.java:5693) at RunPLSQLBlock.main(RunPLSQLBlock.java:26)
, now let try a OK case, which use all named parameters only once. coding like below, SQL and Java listed below.
BEGIN if :q is null then :r := 'X'; else :s := 'Y'; end if; EXCEPTION   WHEN NO_DATA_FOUND THEN     NULL; END;
import java.sql.*; public class RunPLSQLBlock { public static void main(String s[]) throws SQLException { String URL = "jdbc:oracle:thin:@192.168.11.199:1521:TIBSTEST"; Connection con = null; try { Class.forName("oracle.jdbc.driver.OracleDriver"); con = (Connection) DriverManager.getConnection(URL, "FBP1DEV", "FBP1DEV"); String SQL = "BEGIN  if :q is null then  :r := 'X'; else :s := 'Y'; end if; END;"; CallableStatement stmt = con.prepareCall(SQL); stmt.registerOutParameter("q", Types.VARCHAR); stmt.registerOutParameter("r", Types.VARCHAR); stmt.registerOutParameter("s", Types.VARCHAR); stmt.setString("q", "A"); stmt.execute(); System.out.println("Q :" + stmt.getString("q")); System.out.println("R :" + stmt.getString("r")); System.out.println("S :" + stmt.getString("s")); } catch (Exception e) { e.printStackTrace(); } finally { if (con != null) { con.close(); } } } }
, the case give us the following output:
Q :A R :null S :Y
2nd part, I also tried another scheme, to use 'execute immediate', test code attached below, it also have errors.
begin execute immediate 'begin if :q is null then :q := ''X''; else :q := ''Y''; :r := ''Z''; end if; end;' using in out :q, out :r; end;
, Java Code:
import java.sql.*; public class RunDynamicSQL { public static void main(String s[]) throws SQLException { String URL = "jdbc:oracle:thin:@192.168.11.199:1521:TIBSTEST"; Connection con = null; try { Class.forName("oracle.jdbc.driver.OracleDriver"); con = (Connection) DriverManager.getConnection(URL, "FBP1DEV", "FBP1DEV"); String SQL ="begin execute immediate 'begin if :q is null then :q := ''X''; else :q := ''Y''; :r := ''Z''; end if; end;' using in out :q, out :r; end;"; CallableStatement stmt = con.prepareCall(SQL); stmt.registerOutParameter("q", Types.VARCHAR); stmt.registerOutParameter("r", Types.VARCHAR); stmt.setString("q", "A"); stmt.execute(); System.out.println("Q :" + stmt.getString("q")); System.out.println("R :" + stmt.getString("r")); } catch (Exception e) { e.printStackTrace(); } finally { if (con != null) { con.close(); } } } }
, the output is, we can find when parameter 'q' is IN OUT mode, we can't get its final value:
Q :null R :Z
, now I tried my workaround, it works fine by using a temporary variable, now my named parameter is split to 2 roles, one is for IN, another is for OUT, now I can get final out value.
declare q clob; r clob; begin q := ?; r := ?; execute immediate 'begin if :q is null then :q := ''X''; else :q := ''Y''; :r := ''Z''; end if; end;' using in out q, out r; ? := q; ? := r; end;
, my test java code,
import java.sql.*; public class RunDynamicSQL { public static void main(String s[]) throws SQLException { String URL = "jdbc:oracle:thin:@192.168.11.199:1521:TIBSTEST"; Connection con = null; try { Class.forName("oracle.jdbc.driver.OracleDriver"); con = (Connection) DriverManager.getConnection(URL, "FBP1DEV", "FBP1DEV"); String SQL ="declare q clob;r clob; begin q := ?; r := ?; execute immediate 'begin if :q is null then :q := ''X''; else :q := ''Y''; :r := ''Z''; end if; end;' using in out q, out r; ? := q; ? := r; end;"; CallableStatement stmt = con.prepareCall(SQL); stmt.registerOutParameter(3, Types.VARCHAR); stmt.registerOutParameter(4, Types.VARCHAR); stmt.setString(1, "A"); stmt.setString(2, "A"); stmt.execute(); System.out.println("Q :" + stmt.getString(3)); System.out.println("R :" + stmt.getString(4)); } catch (Exception e) { e.printStackTrace(); } finally { if (con != null) { con.close(); } } } }
, the output is expected,
Q :Y R :Z
Database:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
JDBC Driver, extracted from ojdbc6_g.jar/META-INF/MANIFEST.MF :
Created-By: 1.5.0_30-b03 (Sun Microsystems Inc.)
Implementation-Vendor: Oracle Corporation
Implementation-Title: JDBC debug
Implementation-Version: 11.2.0.3.0
Repository-Id: JAVAVM_11.2.0.3.0_LINUX_110823
Specification-Vendor: Sun Microsystems Inc.
Specification-Title: JDBC
Specification-Version: 4.0
Main-Class: oracle.jdbc.OracleDriver
JDK:
java version "1.7.0"
Java(TM) SE Runtime Environment (build 1.7.0-b147)
Java HotSpot(TM) Client VM (build 21.0-b17, mixed mode, sharing)
Edited by: jamxval on 2013-3-22 2:01PM (UTC+08:00), Give full test java program and SQL, added environment/API level; Attached another problem.
Edited by: jamxval on 2013-3-26 17:57 (UTC +08), Adjust code style

Hi, thanks for your response, now I see, the named parameter is for stored procedure only, for PL/SQL block we name it placeholder name.
After cast my java.sql.CallableStatement to oracle.jdbc.OracleCallableStatement, I can find setStringAtName,
now, I have only one question:I can't find corresponding methods for registerOutputParameter, how we fetch output value?
I tried to callableStatement.getString("q"); it reports errors, but there are no ordinal binding in my source code, does placeholder names doesn't support OUT mode?
Java:
CallableStatement stmt = con.prepareCall("BEGIN  if :q is null then  :r := 'X'; else :s := 'Y'; end if; END;");
oracle.jdbc.OracleCallableStatement call = (oracle.jdbc.OracleCallableStatement) stmt;
call.registerOutParameter("q", Types.VARCHAR);
call.registerOutParameter("r", Types.VARCHAR);
call.registerOutParameter("s", Types.VARCHAR);
call.setStringAtName("q", "A");
call.setStringAtName("r", "A");
call.setStringAtName("s", "A");
call.execute();
System.out.println("Q :" + call.getString("q"));
</Java>
<output>
java.sql.SQLException: 不允许的操作: Ordinal binding and Named binding cannot be combined!
     at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
     at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
     at oracle.jdbc.driver.OracleCallableStatement.getString(OracleCallableStatement.java:2834)
     at RunPLSQLBlock.main(RunPLSQLBlock.java:33)
</output>by the way, in my below-mentioned SQL 'problematic', when my code uses 'execute immediate' and use placeholder names in IN OUT mode, we always get NULL value (i.e. ':q'), but we can get final value of ':r' when ':r' is OUT mode only; now I get a workaround attached in below-mentioned 'my workaround' block, which split the IN OUT roles to 2 parts, it can work now;
It seems that the difference between 'problematic' and 'my workaround' imply that there are something work unexpectedly when the driver process the placeholder names, because 'my workaround' and ':r in problematic case' make sure the 'execute immediate' returned output values correctly, unluckly driver layer can't get return values.
<SQL name = 'problematic'>
begin
     execute immediate 'begin if :q is null then :q := ''X''; else :q := ''Y''; :r := ''Z''; end if; end;'
     using in out :q, out :r;
end;
</SQL>
<SQL name='my workaround'>
declare     
     q clob;
     r clob;
begin
     q := ?;
     r := ?;
     execute immediate 'begin if :q is null then :q := ''X''; else :q := ''Y''; :r := ''Z''; end if; end;' using in out q, out r;
     ? := q;
     ? := r;
end;Edited by: EJP on 26/03/2013 14:14

Similar Messages

  • A question about Maveric installer created on a USB key? Can this be used multiple times?

    I have downloaded Maveric on a Mac Book Pro.
    Then without installing utilising Diskmaker X as suggested using a USB key have created Maveric installer.
    My question is that I wish to know if the above created USB installer could be used in more than once to install Maveric?
    If I put that above created USB on a Mac Book Air and do the install, and could I use the same USB installer on a second Mac Book Air to install Maveric OS?
    This will help not needing to use broadband downloads where restrictions apply?
    Regards

    Thank you Lanny.
    That is great to know about Mavericks.
    Regards

  • Why can't I use face time on iPad 2 with 3g iOS 6.0.1

    why can't I use face time on ipad2 with 3g and ios 6.0.1

    Using FaceTime http://support.apple.com/kb/ht4319
    Troubleshooting FaceTime http://support.apple.com/kb/TS3367
    The Complete Guide to FaceTime + iMessage: Setup, Use, and Troubleshooting
    http://tinyurl.com/a7odey8
    Troubleshooting FaceTime and iMessage activation
    http://support.apple.com/kb/TS4268
    Using FaceTime and iMessage behind a firewall
    http://support.apple.com/kb/HT4245
    iOS: About Messages
    http://support.apple.com/kb/HT3529
    Set up iMessage
    http://www.apple.com/ca/ios/messages/
    Troubleshooting Messages
    http://support.apple.com/kb/TS2755
    Setting Up Multiple iOS Devices for iMessage and Facetime
    http://macmost.com/setting-up-multiple-ios-devices-for-messages-and-facetime.htm l
    FaceTime and iMessage not accepting Apple ID password
    http://www.ilounge.com/index.php/articles/comments/facetime-and-imessage-not-acc epting-apple-id-password/
    Unable to use FaceTime and iMessage with my apple ID
    https://discussions.apple.com/thread/4649373?tstart=90
     Cheers, Tom

  • I have ad Apple ID on my iPad , when I use the apple on my iPhone for the first time, I put in my Apple ID for the iPad, didn't work. Need to create a new one. Why? How can I just use my iPad ID on my iPhone?

    I have ad Apple ID on my iPad , when I use the apple on my iPhone for the first time, I put in my Apple ID for the iPad, didn't work. Need to create a new one. Why? How can I just use my iPad ID on my iPhone?

    Hi kamfong,
    Went to Settings where?
    If you want to use your exisiting Apple ID on your iPad, you need to:
    1.     Go to Settings>iTunes & App Store and sign out the new ID, and then sign on the old one
    2.     Go to Settings>iCloud, scroll to the bottom and delete the iCloud account, and the sign back onto iCloud using the old ID
    You still have not indindated why you are saying that using your old ID originally "didn't work". What do you mean by that? Did you get some sort of error when you tried to sign on with your exisiting Apple ID?
    Cheers,
    GB

  • How can you expect the customer to have a LOCAL/COUNTRY Based Credit Card every where we go??? Last week I was on holiday in HK,  and  from my Hotel I was able to use m VN Credit Card with my Apple ID and purchase online!  Why THIS WEEK, can't I use my HS

    Apple_ID_card_declined_for_this_country
    How can you expect the customer to have a LOCAL/COUNTRY Based Credit Card every where we go???
    Last week I was on holiday in HK,
    and
    from my Hotel I was able to use m VN Credit Card with my Apple ID and purchase online!
    Why THIS WEEK, can't I use my HSBC Platinum Credit Card from Vietnam,
    for my Singapore Apple ID account ,
    while working here in Vietnam???

    Unfortunately, this is a problem that is driven by the DRM Dictatorship.  Despite the proliferation of mobile devices and the fact that there are many of us who do a lot of international travel, content providers don't want you to have access to their products outside of your homeland.  The Balkanized mentality of the DRM Dictatorship is way out of touch with the modern world.
    At least Apple, to its credit, allows you to use your accounts outside of your homeland as long as you have the proper credentials for them.  Most other services use the more Draconian geolocation filtering which does require you to be physically present in your homeland.  For the most part, you are not allowed to leave home if you want access to your favorite entertainment!

  • Can we use multiple "pivot_for_clauses" in 11g SQL PIVOT

    Can we use multiple "pivot_for_clauses" in 11g SQL PIVOT. Below SQL is an example of what I am trying to do - In this case instead of using JOIN, can I have three pivot_for_clauses in the same sql?
    SQL:
    MERGE INTO Test_1 dest
    USING (SELECT P1.company_id,trunc(sysdate) as load_date,num_logins,......
    FROM (SELECT company_id,action_type_id
    FROM Testauditinfo_1 where trunc(audit_date_time)=trunc(sysdate)-1) a
    PIVOT (count(action_type_id) FOR (action_type_id) IN ((1) as num_logins,(2) as num_logouts,(61) as
    num_logins_from_mobile_device,(16) as num_pref_changed,....)) P1
    JOIN
    (SELECT company_id,action_type_id,tx_type_id
    FROM Testauditinfo_1 where trunc(audit_date_time)=trunc(sysdate)-1) a
    PIVOT (count(action_type_id) FOR (action_type_id,tx_type_id) IN ((3,4) AS add_invoice, (4,4) AS
    edit_invoice,(3,3) as num_checks,(3,47) as num_paychecks,(3,7) as num_recvd_payments,(3,9) as num_bills,
    (3,35) as num_estimates,(3,46) as num_purchase_orders)) P2
    on P1.company_id=P2.company_id
    JOIN
    (SELECT company_id,action_type_id,list_type_id
    FROM Testauditinfo_1 where trunc(audit_date_time)=trunc(sysdate)-1) a
    PIVOT (count(action_type_id) FOR (action_type_id,list_type_id) IN ((3,2) AS num_items,(3,1) as
    num_accounts,(3,4) as num_employees,(3,6) as num_customers,(3,14) as num_memorized_reports)) P3
    on P2.company_id=P3.company_id
    left outer JOIN
    (SELECT company_id,create_date,count(*) as num_logos
    FROM qbo.companylogos_1 group by company_id,create_date having trunc(create_date)=trunc(sysdate)-1) P4
    on P3.company_id=P4.company_id
    ORDER BY P1.company_id) source
    ON ((dest.company_id = source.company_id) and (dest.load_date = source.load_date))WHEN MATCHED THEN
    UPDATE SET dest.num_items = source.num_items where 1=2
    WHEN NOT MATCHED THEN
    INSERT (dest.company_id,.....) values (source.company_id,.....);

    Maybe
    MERGE INTO Test_1 dest
    USING (SELECT P1.company_id,trunc(sysdate) as load_date,num_logins,......
             FROM (select *
                     from (SELECT company_id,action_type_id
                             FROM Testauditinfo_1
                            where trunc(audit_date_time) = trunc(sysdate)-1
                          ) a
                          PIVOT (count(action_type_id)
                            FOR (action_type_id) IN ((1) as num_logins,
                                                     (2) as num_logouts,(61) as num_logins_from_mobile_device,
                                                     (16) as num_pref_changed,....
                  ) P1
                  JOIN
                  (select *
                     from (SELECT company_id,action_type_id,tx_type_id
                             FROM Testauditinfo_1
                            where trunc(audit_date_time) = trunc(sysdate)-1
                          ) a
                          PIVOT (count(action_type_id)
                            FOR (action_type_id,tx_type_id) IN ((3,4) AS add_invoice,
                                                                (4,4) AS edit_invoice,
                                                                (3,3) as num_checks,
                                                                (3,47) as num_paychecks,
                                                                (3,7) as num_recvd_payments,
                                                                (3,9) as num_bills,
                                                                (3,35) as num_estimates,(3,46) as num_purchase_orders
                  ) P2
               on P1.company_id = P2.company_id
                  JOIN
                  (select *
                     from (SELECT company_id,action_type_id,list_type_id
                             FROM Testauditinfo_1
                            where trunc(audit_date_time) = trunc(sysdate)-1
                          ) a
                          PIVOT (count(action_type_id)
                            FOR (action_type_id,list_type_id) IN ((3,2) AS num_items,
                                                                  (3,1) as num_accounts,
                                                                  (3,4) as num_employees,
                                                                  (3,6) as num_customers,
                                                                  (3,14) as num_memorized_reports
                  ) P3
               on P2.company_id = P3.company_id
                  left outer JOIN
                  (SELECT company_id,create_date,count(*) as num_logos
                     FROM qbo.companylogos_1
                    group by company_id,create_date
                    having trunc(create_date) = trunc(sysdate)-1
                  ) P4
               on P3.company_id = P4.company_id
            ORDER BY P1.company_id
          ) source
       ON ((dest.company_id = source.company_id) and (dest.load_date = source.load_date))
    WHEN MATCHED
    THEN UPDATE SET dest.num_items = source.num_items where 1 = 2
    WHEN NOT MATCHED
    THEN INSERT (dest.company_id,.....)
          values (source.company_id,.....)Did you try it ?
    Regards
    Etbin

  • Why can´t i use face time call with on my ipod touch with ios6

    Why can´t i use face time call with on my ipod touch with ios6

    iTech, First change your apple password, than go to 'setting' and than click on 'Facetime' and make sure your facetime email is right than retry. Also calling apple support can help you or the best way is to go down to the apple store for direct help. I really hope that what i have told you have helped and try to reset your iphone.
          iTech Support Team

  • I just bought my export pdf but if I sing in and enter in my plan I don't see it, why? when can I start using it?

    I just  bought my export pdf how can i start using it? if i sign in & look for my export pdf I am sent to the page to pay it again??? Could you help me please?

    Hi florence,
    Thanks but it did not work.
    I bougth the Export PDF for power point but I do not see it in my account
    and if I clicked in my orders buttons, nothing appears, it seems my
    purchase is lost. Could you help me to verify it, I did it yesterdar
    September 22, 2014 around 10:30 in the morning Mexico time. Or how do I get
    my funds back?
    Regards
    Fabiola
    2014-09-23 5:50 GMT-05:00 florencejohn <[email protected]>:
        I just bought my export pdf but if I sing in and enter in my plan I
    don't see it, why? when can I start using it?  created by florencejohn
    <https://forums.adobe.com/people/florencejohn> in Adobe ExportPDF - View
    the full discussion <https://forums.adobe.com/message/6755125#6755125>

  • Why i can't speak using Face Time

    why i can't speak using Face Time
    1 time ago (no so long time ago) i can but from few days ago no.
    My Iphone tells Face Time doesn't work

    Face time tells to me that I can't contact the person I'm calling. It' s sounds strange because few days ago I was able to  call the same person. It could be some particular ID settings?

  • Using multiple timer in the same SessionBean

    Hello,
    Is it possible to use multiple timer in the same Stateless Session Bean. In my application a user can schedule some task to execute. To do so I was thinking of creating a Session Bean which would create calendar timer on user request and, when one of the timer expires, retrieve the task to execute thanks to the information stored in the timer.
    When I tried the solution explained above, it seems that the @timeout method is synchronized on 1 timer. For example if I create a timer that will be executed every 10 seconds and another one executed every 30 seconds, the timeout callback is called every 30 seconds but 4 times.
    My code looks like that :
    @Stateless
    @LocalBean
    public class TimeManager {
        public void onUserRequest(ScheduleExpression expression) {
            Timer timer = timerService.createCalendarTimer(expression, timerCfg);
        @Timeout
        void timeout(Timer timer) {
            logger.log(Level.INFO, (String) timer.getInfo());
    }Is there a way to do what I want?
    Thank you

    This doesn't make any sense to me. If i were to write a bunch of schemas for a particular applicaion, would
    I have them all in the same namespace? You would normally have one schema that describes the information model associated with the one namespace that the different documents in your application use.
    If so, why can't I load more than one in the same name space?The parser chooses the schema based on the namespace alone. There is no other information used to decide which schema to use, so you can only have one schema for the namespace.
    They all have different root elements.You can have different root elements in the one schema.
    I don't even need the namespaces, but I can't
    figure out how to get rid of them (the schema isn't valid with out them according to XML Spy). You can set the schema explicitily before parsing, but not (AFAIK) set after parsing has begun, except by using the mapping of namespace to schema location.
    I have also tried to use the external-noNameSpaceSchemaLocationproperty, but it doesn't seem like you can pass in an array of schemas to that one. It only expects a
    String as the Object you pass in to setProperty. Yes, you can only validate a document against the one schema.
    So, how can I load all my schemas so I don't have to reference them in the XML documents? Either combine your schemas so you have one schema for your namespace that validates elements which are defined in that namespace (the formal/correct way of doing it), or construct a filter that inserts a PI to point to the schema once the root element is opened (the pragmatic/bit of a hack way of doing it).
    Pete

  • Avoid same TID used multiple times

    Hello everybody,
    I have a little problem with transaction id. What I do at the Moment:
    I have an JAVA based RFC Client that connects to SAP ECC 6.0 via JCo3. If I have a message for upload to SAP...
    1) ... I request a TID
    2) ... I add the received TID to the iDoc and store that iDoc to a database
    3) ... I send the iDoc (including the TID) to SAP, using the stored TID for the sending-process
    I store all the iDoc information in the database to be able to re-send the iDoc - in case of a connection problem or simmilar. Now I had a problem where I managed sending some iDocs twice. Basically I thought ECC would not proceed an iDoc that has an already used TID but it did. I wonder if there is a way to avoid a TID being used multiple times with JCo. Or should it be handled from ECC?
    Thanks for help
    Sebastian

    Now I had a problem where I managed sending some iDocs twice. Basically I thought ECC would not proceed an iDoc that has an already used TID but it did. I wonder if there is a way to avoid a TID being used multiple times with JCo. Or should it be handled from ECC?
    Please note that in general transactional RFC (tRFC) is used to prevent multiple execution in case of errors, not for successful calls (see for example [sending and executing tRFC LUWs|http://help.sap.com/saphelp_nw04/helpdata/en/25/bcfa40badbf46fe10000000a1550b0/content.htm]). In essence the TID reference can be deleted by the client and the server once the RFC call was executed successfully. So you cannot use it to prevent sending (and processing) and IDoc multiple times in general.
    Now, if we talk about errors for tRFC calls, we do not talk about normal errors in the IDoc processing (i.e. a failed IDoc which might be in status 51 or 56 or something like that). For IDocs it's important to distinguish between creating them on the database and processing the IDocs (in most systems configured to be done in a separate LUW, even if immediate processing is chosen in the partner profile). Most likely you don't want to resend an IDoc once it exists in SAP (as any error handling from then on should be done in SAP).
    So TID handling is not build for successful RFCs. This is why you see in some application code provisions to prevent duplicate postings (e.g. issue an error as soon as for example a duplicate reference number is encountered).
    Cheers, harald

  • HT1911 Why does Itunes have me logging in multiple times to buy a song? Somehow, my account got disabled now. It also shows that I am logged in....?

    Why does itunes have me logging in multiple times to buy a song? I can access everything else fine, but now my account is disabled for some reason although my password was entered correctly... help

    I've seen a couple of other threads over the last 10 minutes posting similar problems, so it appears to have affected other people as well - the poster on the first thread has now posted again saying that it's now working for him, so you could give it another try.
    Edit : your reply appeared as I was attempting to post this

  • A Cocoa window which is used multiple times (for instances of a class)

    Hi everyone,
    I develop with newest xCode using Obj-C, Java and Cocoa.
    It works perfectly to create a window and connect it to some code: I just design it, and connect it to a class which has been instantiated previously.
    What I need now is a window, which is used multiple times. Means that I create a class where the window should be connected to, from which I create multiple instances.
    I've seen that it works to create a class in Obj-C and just generate the window by code: it works to generate multiple windows. But how would I be able to design a window with InterfaeBuilder for a class which is not yetinstantiated? A class for which I create the instances while my app is running?
    Thanks a lot for your answers!
    -Lucas

    Like PeeJay says, a custom window controller seems the way to go. Try creating a subclass of NSWindowController, with header something like this:
    #import <Cocoa/Cocoa.h>
    @interface MyWindowController : NSWindowController
    IBOutlet NSTextField *infoField;
    -(void)setInfoText:(NSString *)str;
    @end
    The implementation of the setInfoText would be something like:
    -(void)setInfoText:(NSString *)str{
    [infoField setStringValue:str];
    Create a nib file with your window in interface builder. Drop the header file for your custom window controller into the interface builder window. Set the custom class of the nib's File's Owner to MyWindowController. You can then hook up the window and infoField outlets from File's Owner to your window.
    In the body of your code where you open a new info window, add something like:
    MyWindowController *windowController=[[MyWindowController alloc] initWithWindowNibName:@"nameOfWindowNibFile"];
    [windowController setInfoText:@"Whatever"];
    [windowController showWindow:self];
    If you are going to have an undetermined amount of these custom window, it might be a good idea to store the window controller instances in a mutable array, rather than retaining instance variables for each one.
    Jim

  • Can Elements be installed multiple times on different computers?

    Can elements be installed multiple times on different computers.

    It can be installed on as many computers as you want, but it can only be activated and thus used without restrictions on 2.
    Mylenium

  • Can i install itunes multiple times on one computer for multiple users?

    Can i install itunes multiple times on one computer for multiple users?

    Like most applications you only need to install it once for it to be available to all users. (That said it is possible to install an application and only make it available to the current user, but that's rarely needed.)
    tt2

Maybe you are looking for