Toystore: Using findByKey instead of other query methods
I think I already know the answer to this but I cannot exactly find supporting documentation. I would like to know when it is appropriate to use findByKey over setting the where clause parameters and calling executeQuery. I notice the Toystore sample does this wherever possible. When do I know I should use it in my application and why? As a standard practice, I have been using the where clause method. Are there any pitfalls to using findByKey?
Thanks for the response. I tried List Item, but it isn't what i sought as it is a display-only field. I could say Update allowed false, but still people ask question why the list is provided when we cant change it.
I found an interesting solution to it.
On the database field (say change_allowed) if 'Y' denotes "Yes" and 'N' denotes "No" then use Property Palette and change the Column Name (under Database Group) to decode(change_allowed,'Y','Yes','N','No') change_allowed and increase the size of the column to 5 instead of 1. Works amazingly well :)
Similar Messages
-
Lightswitch html use the 'any' query method
Hi
Can someone please tell me how i can use the "any" query method for entity collections in lightswitch html?
ThanksHi Xpert360
It's for a type of EntityCollection this is the code from the msls-2.5.2.vsdoc.js line 2220
any: function any(predicate) {
/// <summary>
/// Determines whether this sequence contains any
/// items that optionally satisfy a condition.
/// </summary>
/// <param name="predicate" type="Function" optional="true">
/// A function to test each item for a condition.
/// <br/>Signature: Boolean item.predicate(item)
/// </param>
/// <returns type="Boolean">
/// True if this sequence contains any items that
/// satisfy the condition, if any; otherwise, false.
/// </returns>
var result = false;
this.each(function (item) {
if (!predicate || predicate.call(item, item)) {
result = true;
return false;
return true;
return result;
Check it out and let me know if you know how to use it, my problem is how to use the call back function.
Thanks -
Hi
I checked following page and I understood that PB 12.6 supports native connection for connecting to MS SQL Server 2012.
Latest database native drivers supported by PowerBuilder 12.6
http://wiki.scn.sap.com/wiki/display/SYBPB/Latest+database+native+drivers+supported+by+PowerBuilder+12.6
But there is no info about other connecting methods (e.g. OLEDB).
Does PB 12.6 support to use them ?
And is there a info of it ?
Thanks.
Tsuyoshi YagiHi Tsuyoshi;
1) FYI: OLE-DB and ODBC are examples of "middle-ware" and are not a direct connection to any DBMS vendor!
2) The true native client connection to SS is SNC (SQLServer Native Client). That connection mechanism is supported in PB.
Note: You could also use JDBC or ADO.Net as well from PB. Personally, I always use SNC for the best performance and supported DML functionality.
HTH
Regards ... Chris -
ISE 1.2, Patch 7: "NAK requesting to use PEAP instead"
We're experiencing seemingly random occurrences of users failing authentication because they're trying PEAP vs EAP. Does anyone know if it is possible to force the Windows supplicant to use EAP only?
For what it's worth, the user can fail authentication for hours and I can either allow open authentication on the port for a bit, or the user can leave for the day and come back tomorrow and authentication will succeed. I'm not sure if it's an ISE problem or a supplicant problem, but I'm leaning towards supplicant.
Personas:
Administration
Role:
PRIMARY(A)
System Time:
Apr 24 2014 08:26:58 AM America/New_York
FIPS Mode:
Disabled
Version:
1.2.0.899
Patch Information:
7,1,3
11001
Received RADIUS Access-Request
11017
RADIUS created a new session
15049
Evaluating Policy Group
15008
Evaluating Service Selection Policy
15048
Queried PIP
15048
Queried PIP
15004
Matched rule
11507
Extracted EAP-Response/Identity
12500
Prepared EAP-Request proposing EAP-TLS with challenge
12625
Valid EAP-Key-Name attribute received
11006
Returned RADIUS Access-Challenge
11001
Received RADIUS Access-Request
11018
RADIUS is re-using an existing session
12301
Extracted EAP-Response/NAK requesting to use PEAP instead
12300
Prepared EAP-Request proposing PEAP with challenge
12625
Valid EAP-Key-Name attribute received
11006
Returned RADIUS Access-Challenge
11001
Received RADIUS Access-Request
11018
RADIUS is re-using an existing session
12302
Extracted EAP-Response containing PEAP challenge-response and accepting PEAP as negotiated
12318
Successfully negotiated PEAP version 0
12800
Extracted first TLS record; TLS handshake started
12805
Extracted TLS ClientHello message
12806
Prepared TLS ServerHello message
12807
Prepared TLS Certificate message
12810
Prepared TLS ServerDone message
12305
Prepared EAP-Request with another PEAP challenge
11006
Returned RADIUS Access-Challenge
11001
Received RADIUS Access-Request
11018
RADIUS is re-using an existing session
12304
Extracted EAP-Response containing PEAP challenge-response
12305
Prepared EAP-Request with another PEAP challenge
11006
Returned RADIUS Access-Challenge
11001
Received RADIUS Access-Request
11018
RADIUS is re-using an existing session
12304
Extracted EAP-Response containing PEAP challenge-response
12305
Prepared EAP-Request with another PEAP challenge
11006
Returned RADIUS Access-Challenge
11001
Received RADIUS Access-Request
11018
RADIUS is re-using an existing session
12304
Extracted EAP-Response containing PEAP challenge-response
12305
Prepared EAP-Request with another PEAP challenge
11006
Returned RADIUS Access-Challenge
11001
Received RADIUS Access-Request
11018
RADIUS is re-using an existing session
12304
Extracted EAP-Response containing PEAP challenge-response
12318
Successfully negotiated PEAP version 0
12812
Extracted TLS ClientKeyExchange message
12804
Extracted TLS Finished message
12801
Prepared TLS ChangeCipherSpec message
12802
Prepared TLS Finished message
12816
TLS handshake succeeded
12310
PEAP full handshake finished successfully
12305
Prepared EAP-Request with another PEAP challenge
11006
Returned RADIUS Access-Challenge
11001
Received RADIUS Access-Request
11018
RADIUS is re-using an existing session
12304
Extracted EAP-Response containing PEAP challenge-response
12313
PEAP inner method started
11521
Prepared EAP-Request/Identity for inner EAP method
12305
Prepared EAP-Request with another PEAP challenge
11006
Returned RADIUS Access-Challenge
11001
Received RADIUS Access-Request
11018
RADIUS is re-using an existing session
12304
Extracted EAP-Response containing PEAP challenge-response
11522
Extracted EAP-Response/Identity for inner EAP method
11806
Prepared EAP-Request for inner method proposing EAP-MSCHAP with challenge
12305
Prepared EAP-Request with another PEAP challenge
11006
Returned RADIUS Access-Challenge
11001
Received RADIUS Access-Request
11018
RADIUS is re-using an existing session
12304
Extracted EAP-Response containing PEAP challenge-response
11808
Extracted EAP-Response containing EAP-MSCHAP challenge-response for inner method and accepting EAP-MSCHAP as negotiated
15041
Evaluating Identity Policy
15006
Matched Default Rule
15013
Selected Identity Source - *****
24431
Authenticating machine against Active Directory
24470
Machine authentication against Active Directory is successful
22037
Authentication Passed
11824
EAP-MSCHAP authentication attempt passed
12305
Prepared EAP-Request with another PEAP challenge
11006
Returned RADIUS Access-Challenge
11001
Received RADIUS Access-Request
11018
RADIUS is re-using an existing session
12304
Extracted EAP-Response containing PEAP challenge-response
11810
Extracted EAP-Response for inner method containing MSCHAP challenge-response
11814
Inner EAP-MSCHAP authentication succeeded
11519
Prepared EAP-Success for inner EAP method
12314
PEAP inner method finished successfully
12305
Prepared EAP-Request with another PEAP challenge
11006
Returned RADIUS Access-Challenge
11001
Received RADIUS Access-Request
11018
RADIUS is re-using an existing session
12304
Extracted EAP-Response containing PEAP challenge-response
15036
Evaluating Authorization Policy
24433
Looking up machine in Active Directory - host/*****
24435
Machine Groups retrieval from Active Directory succeeded
15048
Queried PIP
15048
Queried PIP
15048
Queried PIP
15048
Queried PIP
15048
Queried PIP
15004
Matched rule - Default
15016
Selected Authorization Profile - DenyAccess
15039
Rejected per authorization profile
12306
PEAP authentication succeeded
11503
Prepared EAP-Success
11003
Returned RADIUS Access-Rejectsalodh,
Thank you for your response. Below is the authorization policy it should hit. The trouble is the workstation wants to use PEAP for some reason but we don't want PEAP because we're certificate-based. I understand what you're saying, and it's because I didn't word my question correctly.
12500
Prepared EAP-Request proposing EAP-TLS with challenge
12625
Valid EAP-Key-Name attribute received
11006
Returned RADIUS Access-Challenge
11001
Received RADIUS Access-Request
11018
RADIUS is re-using an existing session
12301
Extracted EAP-Response/NAK requesting to use PEAP instead
If the NAK would not request PEAP, it would continue on to the following Authorization Policy (and succeed):
Name
Wired-******-PC
Conditions
Radius:Service-Type EQUALS Framed
AND
Radius:NAS-Port-Type EQUALS Ethernet
AND
*******:ExternalGroups EQUALS **********/Users/Domain Computers
AND
Network Access:EapAuthentication EQUALS EAP-TLS
Again, this PEAP request only happens occasionally. This same workstation will work at other days/times. If I could figure out why some workstations randomly request PEAP (or find a way to force EAP only) I think that would take care of it.
Thanks again, sir.
Andrew -
Use of 'static' keyword in synchronized methods. Does it ease concurrency?
Friends,
I have a query regarding the use of 'synchronized' keyword in a programme. This is mainly to check if there's any difference in the use of 'static' keyword for synchronized methods. By default we cannot call two synchronized methods from a programme at the same time. For example, in 'Program1', I am calling two methods, 'display()' and 'update()' both of them are synchronized and the flow is first, 'display()' is called and only when display method exits, it calls the 'update()' method.
But, things seem different, when I added 'static' keyword for 'update()' method as can be seen from 'Program2'. Here, instead of waiting for 'display()' method to finish, 'update()' method is called during the execution of 'display()' method. You can check the output to see the difference.
Does it mean, 'static' keyword has anything to do with synchronizaton?
Appreciate your valuable comments.
1. Program1
public class SynchTest {
public synchronized void display() {
try {
System.out.println("start display:");
Thread.sleep(7000);
System.out.println("end display:");
} catch (InterruptedException e) {
e.printStackTrace();
public synchronized void update() {
try {
System.out.println("start update:");
Thread.sleep(2000);
System.out.println("end update:");
} catch (InterruptedException e) {
e.printStackTrace();
public static void main(String[] args) {
System.out.println("Synchronized methods test:");
final SynchTest synchtest = new SynchTest();
new Thread(new Runnable() {
public void run() {
synchtest.display();
}).start();
new Thread(new Runnable() {
public void run() {
synchtest.update();
}).start();
Output:
Synchronized methods test:
start display:
end display:
start update:
end update:
2. Program2
package camel.java.thread;
public class SynchTest {
public synchronized void display() {
try {
System.out.println("start display:");
Thread.sleep(7000);
System.out.println("end display:");
} catch (InterruptedException e) {
e.printStackTrace();
public static synchronized void update() {
try {
System.out.println("start update:");
Thread.sleep(2000);
System.out.println("end update:");
} catch (InterruptedException e) {
e.printStackTrace();
public static void main(String[] args) {
System.out.println("Synchronized methods test:");
final SynchTest synchtest = new SynchTest();
new Thread(new Runnable() {
public void run() {
synchtest.display();
}).start();
new Thread(new Runnable() {
public void run() {
synchtest.update();
}).start();
Output:
Synchronized methods test:
start display:
start update:end update:
end display:the synchronized method obtain the lock from the current instance while static synchronized method obtain the lock from the class
Below is some code for u to have better understanding
package facado.collab;
public class TestSync {
public synchronized void add() {
System.out.println("TestSync.add()");
try {
Thread.sleep(2000);
} catch (InterruptedException e) {
e.printStackTrace();
System.out.println("TestSync.add() - end");
public synchronized void update() {
System.out.println("TestSync.update()");
try {
Thread.sleep(2000);
} catch (InterruptedException e) {
e.printStackTrace();
System.out.println("TestSync.update() - end");
public static synchronized void staticAdd() {
System.out.println("TestSync.staticAdd()");
try {
Thread.sleep(2000);
} catch (InterruptedException e) {
e.printStackTrace();
System.out.println("TestSync.staticAdd() - end");
public static synchronized void staticUpdate() {
System.out.println("TestSync.staticUpdate()");
try {
Thread.sleep(2000);
} catch (InterruptedException e) {
e.printStackTrace();
System.out.println("TestSync.staticUpdate() - end");
public static void main(String[] args) {
final TestSync sync1 = new TestSync();
final TestSync sync2 = new TestSync();
new Thread(new Runnable(){
public void run() {
sync1.add();
}).start();
new Thread(new Runnable(){
public void run() {
sync2.update();
}).start();
try {
Thread.sleep(3000);
} catch (InterruptedException e) {
e.printStackTrace();
new Thread(new Runnable(){
public void run() {
sync1.staticAdd();
}).start();
new Thread(new Runnable(){
public void run() {
sync2.staticUpdate();
}).start();
} -
Exception access violation using jlong instead of jint
Hi,
I hope you can help me.
I'm using Java5 under Windows XP and I'm developing under Eclipse.
I try to use an "old" c-Application accesed via JNI.
Status Quo is that, I have access to the c-side, over my JNI-conform DLL. My current task is to translate the c-side structs to java-objects. This also works, but only with limitation.
Calling methods bidirectional is working, manipulation a java-object is like a walk on an warm and sunny Saturday afternoon.
But I'm not able to use all possible parameters (for now I have tried to use jobject, jstring, jint, jboolean, jlong).
The first problem I had, were using Strings as parameters, but this now I deal with the loopway over java/lang/object (using java/lang/String results in an access_violation).
The next problem, and the harder one, is, that I cannot use the type long or jlong.
int (jint) is no problem, with int all works fine, but if I change the environment, creating and using long, I allways get an the access_violation shown below.
Is there anything, I need to know?
working c-side-code:
jobject someObject;
jint anIntegerValue;
anIntegerValue =5;
jmethodID mid3 = (*env)->GetMethodID(env, cl, "initReturnSomeObject", "(ILjava/lang/Object;)Ljava/lang/Object;");
if(mid3 == (jmethodID)0) printf("\ndooofes MethodName4!\n");
else {
const char* myParams;
myParams = "ooooohwow!!!";
someObject = (*env)->CallObjectMethod(env, jobj, mid3,
anIntegerValue, (*env)->NewStringUTF(env, myParams));
}wokring java-side-code
public Object initReturnSomeObject(int i, Object obj) {
String s = (String)obj;
System.out.println("String: "+s+"\nInteger: "+i);
some = new SomeObject(s,i);
if(some==null) System.out.println("Some is not yet initialized, FEAR!!!!\n");
else System.out.println("Yoh, I'm soooo many good!! \nSome:\nString: "+some.getS1()+"\nInt: "+some.getI1()+"\n");
return (Object)some;
so, und this code, doesn't work. you can see, the changes are dramatically!! ;)
sorry for my sarcasm. I do not know, why it doesn't work.
jlong aLongValue;
aLongValue = 2;
jmethodID mid3 = (*env)->GetMethodID(env, cl, "initReturnSomeObject", "(JLjava/lang/Object;)Ljava/lang/Object;");
if(mid3 == (jmethodID)0) printf("\ndooofes MethodName4!\n");
else {
const char* myParams;
myParams = "ooooohwow!!!";
someObject = (*env)->CallObjectMethod(env, jobj, mid3,
aLongValue, (*env)->NewStringUTF(env, myParams));
public Object initReturnSomeObject(long i, Object obj) {
String s = (String)obj;
System.out.println("String: "+s+"\nInteger: "+i+"\nLong: ");
some = new SomeObject(s,(int)i);
if(some==null) System.out.println("Some is not yet initialized, FEAR!!!!\n");
else System.out.println("Yoh, I'm soooo many good!! \nSome:\nString: "+some.getS1()+"\nInt: "+some.getI1()+"\n");
return (Object)some;
# An unexpected error has been detected by Java Runtime Environment:
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x6d942975, pid=1784, tid=1648
# Java VM: Java HotSpot(TM) Client VM (1.6.0_03-b05 mixed mode, sharing)
# Problematic frame:
# V [jvm.dll+0x182975]
# An error report file with more information is saved as hs_err_pid1784.log
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
#do you need some other informations or details? something out of the log-file? ok, i have to take the bus, so sorry for uncomplete informations or sentences ;)
till later.Hi,
I'm quite sure, the signature is correct. For failure check, yesterday I ran javap to check the signature, but I do also mean, that I changed the signature afterwards for several time. And, it works ;) at least the way, using Integer.
Trying to use java/lang/String everytime I got the Error, that the method could not be found - this is the part, I was wrong in my description. So the error-Message is a different one.
Belonging to the question for assumptions I made... it's difficult. I'm quite new to JNI, so, I don't know, what I can assume to do. The Method call seems to be a kind of reflection-mechanism. So I assume that the behaviour is similar. But reflection I'm not very firm, either ^^.
What I do assume is, that the parameter-value J fits to the java-type jlong. But a work around on this, I will try today. getting the jlong into an char* or using long instead of jlong or using Ljava/lang/Long; or a casted Long as Ljava/lang/Object; ...
I'm anxious to the ideas, I will have, bypassing this point. if there is no way, I will write a file, send a email or something like this ;)
Thx for thinking about my problem jschel!! It's great not to be alone.
John -
Hi All,
I am new to TestStand. Still in the process of learning it.
What are Parameters? How are they differenet from Variables? Why can't we use variables for passing data from one sequnece to another? What is the advantage of using Parameters instead of Variables?
Thanks in advance,
LaVIEWan
Solved!
Go to Solution.Hi,
Using the Parameters is the correct method to pass data into and out of a sub sequence. You assign your data to be passed into or out of a Sequence when you are in the Edit Sequence Call dialog and in the Sequence Parameter list.
Regards
Ray Farmer -
How to Create Instances in the Transient Root Node and Sub Nodes from Root Node Query Method ?
Hi All,
I am Creating a BOPF BO with 3 Nodes,
Node 1) ROOT -- > contains a query,
using Root Node I have created Search UIBB Configuration in FBI.
In testing -- > when i enter Data in the Search Criteria Fields am able to get the details in to the query method
from Imporing parameter : 'IT_SELECTION_PARAMETERS'.
HERE I am fetching data from a standard table and trying to fill the data in the Node : 'MNR_SEARCH_RESULT'.
How to Append data to the Sub node 'MNR_SEARCH_RESULT' when there is no Node instance created in the ROOT Node ?
For This I have created an instance in the ROOT Node and Using that I tried to create Instance in the Sub Node 'MNR_SEARCH_RESULT'.
Below is my code which i have placed in the Query method ..
DATA : LR_DATA TYPE REF TO ZBO_S_ROOT1.
DATA : LR_SEARCH_RES TYPE REF TO ZBO_S_MNR_SEARCH_RESULT.
DATA : LO_CI_SERVICE_MANAGER TYPE REF TO /BOBF/IF_TRA_SERVICE_MANAGER,
LO_TRANSACTION_MANAGER TYPE REF TO /BOBF/IF_TRA_TRANSACTION_MGR.
LO_CI_SERVICE_MANAGER = /BOBF/CL_TRA_SERV_MGR_FACTORY=>GET_SERVICE_MANAGER( IV_BO_KEY = ZIF_BO_TEST_PO_C=>SC_BO_KEY ).
LO_TRANSACTION_MANAGER = /BOBF/CL_TRA_TRANS_MGR_FACTORY=>GET_TRANSACTION_MANAGER( ).
CREATE DATA LR_DATA.
LR_DATA->KEY = LO_CI_SERVICE_MANAGER->GET_NEW_KEY( ).
LR_DATA->ROOT_KEY = IS_CTX-ROOT_NODE_KEY.
LR_DATA->PIPO_MAT_ID = '100100'.
LR_DATA->PIPO_MAT_DESC = 'MATERIAL'.
LR_DATA->PIPO_SPRAS = 'E'.
LR_DATA->PIPO_MATL_TYPE = 'ZPMI'.
LR_DATA->PIPO_MATL_GROUP = 'ZKK'.
DATA lt_mod TYPE /bobf/t_frw_modification.
DATA lo_change TYPE REF TO /bobf/if_tra_change.
DATA lo_message TYPE REF TO /bobf/if_frw_message.
FIELD-SYMBOLS: <ls_mod> LIKE LINE OF lt_mod.
APPEND INITIAL LINE TO lt_mod ASSIGNING <ls_mod> .
<ls_mod>-node = ZIF_BO_TEST_PO_C=>sc_node-ROOT.
<ls_mod>-change_mode = /bobf/if_frw_c=>sc_modify_create.
<ls_mod>-key = LR_DATA->KEY.
<ls_mod>-data = LR_DATA.
DATA : LT_CHG_FIELDS TYPE /BOBF/T_FRW_NAME.
DATA : LS_CHG_FIELDS LIKE LINE OF LT_CHG_FIELDS.
DATA : LV_KEY TYPE /BOBF/CONF_KEY.
CALL METHOD IO_MODIFY->CREATE
EXPORTING
IV_NODE = ZIF_BO_TEST_PO_C=>sc_node-ROOT
IV_KEY = LR_DATA->KEY
IS_DATA = LR_DATA
IV_ROOT_KEY = IS_CTX-ROOT_NODE_KEY
IMPORTING
EV_KEY = LV_KEY .
CREATE DATA LR_SEARCH_RES.
LR_SEARCH_RES->KEY = LO_CI_SERVICE_MANAGER->GET_NEW_KEY( )..
LR_SEARCH_RES->PARENT_KEY = LV_KEY.
LR_SEARCH_RES->ROOT_KEY = LV_KEY.
LR_SEARCH_RES->MATNR = '123'.
LR_SEARCH_RES->ERSDA = SY-DATUM.
LR_SEARCH_RES->ERNAM = SY-UNAME.
**LR_SEARCH_RES->LAEDA = .
**LR_SEARCH_RES->AENAM = .
**LR_SEARCH_RES->VPSTA = .
*LR_SEARCH_RES->LVORM = .
LR_SEARCH_RES->MTART = 'ZPI'.
LR_SEARCH_RES->MBRSH = 'ZTP' .
LR_SEARCH_RES->MATKL = 'MAT'.
**LR_SEARCH_RES->BISMT = ''
**LR_SEARCH_RES->MEINS =
CALL METHOD io_modify->create
EXPORTING
iv_node = ZIF_BO_TEST_PO_C=>sc_node-MNR_SEARCH_RESULT
is_data = LR_SEARCH_RES
iv_assoc_key = ZIF_BO_TEST_PO_C=>sc_association-root-MNR_SEARCH_RESULT
iv_source_node_key = ZIF_BO_TEST_PO_C=>sc_node-root
iv_source_key = LV_KEY
iv_root_key = LV_KEY.
I am Unable to set data to the Node . I did not get any error message or Dump while executing . when i tried to retrive data I got the details from the node but am unable to view those details in the FBI UI and BOBT UI while testing .
Please provide your valuable Suggestions.
Thanks in Adv.
Thanks ,
Kranthi Kumar M.Hi Kranthi,
For your requirement you need only two nodes. Root Node and Result node. Use the same structure for both.
To create Instance while search.
Create Query method with input type which has the required fields for selection criteria.
Fetch the data and create instance in the root node.
Pass the new instance key as exporting parameter form Query Method.
To Move data from ROOT to Result.
Create a action at root node.
Write a code to create new entries in Result node.
Then configure the Search UIBB and display result in List UIBB. Add button and assign the action MOVE_MAT_2_RESULT.
Create another List uibb to display data from Result node.
Connect the UIBBs using wire schema. SEARCH -> LIST(ROOT) ---> LIST(RESULT).
Give src node association for ROOT to RESULT Configuration.
Regards,
Sunil -
Hi all,
From Page 354 of the the Book "Pro T-SQL 2008 Programmer's Guide" written by Michael Coles (published by apress), I copied the following code (Listing 12-9 Retrieving Job Candidates with the query Method):
--Coles12_9.sql // saved in C:/Documemnts/SQL Server Management Studio
-- Coles Listing 12-9 Retrieving Job Candidates with the query Method
-- Doing XQuery and the xml Data Type in AdvantureWorks
-- 17 March 2015 1105 AM
USE AdventureWorks;
GO
SELECT Resume.query
N'//*:Name.First,
//*:Name.Middle,
//*:Name.Last,
//*:Edu.Level
FROM HumanResources.JobCandidate;
I executed this set of Listing 12-9 code in my SQL Server 2012 Management Studio and I got the following error messages:
Msg 105, Level 15, State 1, Line 4
Unclosed quotation mark after the character string '//*:Name.First,
//*:Name.Middle,
//*:Name.Last,
//*:Edu.Level
FROM HumanResources.JobCandidate;
Msg 102, Level 15, State 1, Line 4
Incorrect syntax near '//*:Name.First,
//*:Name.Middle,
//*:Name.Last,
//*:Edu.Level
FROM HumanResources.JobCandidate;
I am not able to figure out why I got the error messages. Please kindly help and advise me how to correct this set of sql codes.
Thanks in advance,
Scott ChangHi Scott,
I don't have that book at hand, but your problem is the "Unclosed quotationmark after the character string",as the error message shows. You have to enclose the 'XQUERY' string quotation in the
query().
SELECT jobcandidateid, Resume.query
N'//*:resume,
//*:Name.Middle,
//*:Name.Last,
//*:Edu.Level' --enclose the quotation here
FROM HumanResources.JobCandidate;
For XQUERY learning, here is a good
link.
If you have any question, feel free to let me know.
Eric Zhang
TechNet Community Support -
Advantages of using J1IS instead of J1IIN for excise invoice during stock t
Hi,
what are the advantages of using J1IS instead of J1IIN for excise invoice during stock transfer order....using delivery.
Please clarify clearly.
Regards,
DharaniHi all,
Any Suggestions for my query.
Regards,
Dharani -
How do we use MSHOST instead of ASHOST in JCO Block xMII 11.5?
Our SAP configuration has changed, and we are being told that we need to use MSHOST instead of ASHOST. Can someone tell us how we can do this in the JCO block? The error we are getting when I try to do a Get List:
(xxxx is there to replace servernames)
Fatal Error: JCOProxy error: Connect from SAP gateway to RFC server failed
Connect_PM
GWHOST=xxxxx, GWSERV=xxxxx, ASHOST=xxxxx, SYSNR=11
LOCATION SAP-Gateway on host xxxx/xxxxx
ERROR Gateway not connected to local R/3
Release 700
Component SAP-Gateway
Version 2
RC 726
Module gwr3cpic.c
Line 5609
Counter 18Todd,
Just for kicks can you Remote Desktop onto the MII server and try to ping both your MS and AS hosts? Then I would try to verify that the communication port is actually open across the network, a quick and dirty method is to from the Command Prompt of the MII server use the telnet command:
telnet server port
If the screen goes blank then you will know that the port traffic is acceptable between the servers, otherwise you will get a connection error message back and you can blame the firewall for the issue.
Thanks,
Sam -
How to use Associative Array in sql query?
Hello,
I have a problem on using Associative Array variable on query; and my query is similar to the one below;
TYPE OTHERGENERICS IS TABLE OF NUMBER(10) INDEX BY BINARY_INTEGER;
othersGenerics OTHERGENERICS;
CURSOR cursor_othersGenerics IS
select master.GENERICCODEID
from ASMTRG_ARTICLEMASTER master
join ASMTRG_ARTICLEMAP map on MAP.ARTICLECODEID = MASTER.ID
group by MASTER.GENERICCODEID
minus
select FGG.GENERICCODEID
from asmtrg_icfocusgroup fg
join asmtrg_icfocusgrpchannel fgc on FGC.GROUPID = FG.ID and fgc.isactive=1
join asmtrg_icfocusgengroup fgg on FGG.GROUPID = FG.ID and FGg.ISACTIVE=1
where fgc.channelid=1 and fg.isactive = 1
group by FGG.GENERICCODEID;
BEGIN
OPEN cursor_othersGenerics;
FETCH cursor_othersGenerics BULK COLLECT INTO othersGenerics;
CLOSE cursor_othersGenerics;
SELECT icfrd.*,
CASE
WHEN EXISTS(select ta.genericcodeid from <???XXX???> ta where ta.genericcodeid = icfgrp.genericcodeid) THEN -1
ELSE icfrd.icfgroupid
END CLASSIFICATION
FROM ASMTRGVIW_ICFOCUSREPORTDATA icfrd
LEFT JOIN ASMTRG_ICFOCUSGROUP icfgrp on icfrd.ICFGROUPID = icfgrp.ID
WHERE (channelId IS NULL OR icfrd.CHANNELID = channelId)
AND (asmCodeId IS NULL OR icfrd.ASMCODEID = asmCodeId)
AND (yearId IS NULL OR icfrd.YEARID = yearId)
AND (monthId IS NULL OR icfrd.MONTHID = monthId)
END;
By the way this is a part of my function.
The "othersGenerics" is my associative array variable and <???XXX???> is the place where I need to use my "othersGenerics" array to check. So far I've tried
"select ta.genericcodeid from table(cast(otherGenerics as OTHERGENERICS)) ta where ta.genericcodeid = icfgrp.genericcodeid",
"select ta.genericcodeid from table(otherGenerics) ta where ta.genericcodeid = icfgrp.genericcodeid",
"select ta.genericcodeid from otherGenerics ta where ta.genericcodeid = icfgrp.genericcodeid"
and these are not working.
What is your suggestions?Your type will have to be created as an independent object in your schema. So CREATE TYPE cannot be in your function declaration, it has to be outside it. (And then the line inside your declaration that defines the type will have to be removed.)
But now I can see that you use this array as a kind of "temporary lookup table" - you populate the array and then use it for lookup in your select statement. An alternative way of doing this could be like this completely without arrays:
with othergenerics as (
select master.GENERICCODEID
from ASMTRG_ARTICLEMASTER master
join ASMTRG_ARTICLEMAP map on MAP.ARTICLECODEID = MASTER.ID
group by MASTER.GENERICCODEID
minus
select FGG.GENERICCODEID
from asmtrg_icfocusgroup fg
join asmtrg_icfocusgrpchannel fgc on FGC.GROUPID = FG.ID and fgc.isactive=1
join asmtrg_icfocusgengroup fgg on FGG.GROUPID = FG.ID and FGg.ISACTIVE=1
where fgc.channelid=1 and fg.isactive = 1
group by FGG.GENERICCODEID
SELECT icfrd.*,
CASE
WHEN EXISTS(select ta.genericcodeid from othergenerics ta where ta.genericcodeid = icfgrp.genericcodeid) THEN -1
ELSE icfrd.icfgroupid
END CLASSIFICATION
FROM ASMTRGVIW_ICFOCUSREPORTDATA icfrd
LEFT JOIN ASMTRG_ICFOCUSGROUP icfgrp on icfrd.ICFGROUPID = icfgrp.ID
WHERE (channelId IS NULL OR icfrd.CHANNELID = channelId)
AND (asmCodeId IS NULL OR icfrd.ASMCODEID = asmCodeId)
AND (yearId IS NULL OR icfrd.YEARID = yearId)
AND (monthId IS NULL OR icfrd.MONTHID = monthId)
...The with clause (subquery factoring) you can think of as a kind of temp table called othergenerics created "on-the-fly".
The optimizer may decide to actually create a temp table for you and use in the lookup, or it may decide to rewrite the query into suitable joins or nested loops or hashing - whatever the optimizer decides will be the optimal way of doing things :-)
So unless you use your array other places in your function, I would recommend dropping the array completely, skip populating an array, and instead use a with clause for your temporary lookup. -
DTP plugin can't connect to 10g DB that uses SERVICE_NAME instead of SID
Hi,
I am trying to set up a connection to a database that uses a service name instead of a SID (see below for the TNSNAMES entry. It gets an ORA-12505 error because the listener does not know of SID given in connect descriptor. The Connection descriptor used by the client was:
tdc-sun-77-vip.unix.tdc.xxxyyy.com:1521:SRV_TMS_TNV.
My understanding is that the url for JDBC for service name should use a "/" instead of a ":" to separate the port from the service name. The dialog for creating the connection in SQL Developer has radio buttons to choose between SID and Service Name, so it can generate the url appropriately. The wizard for the Eclipse plugin does not have this option and the plugin always uses a ":" as the separator.
If anyone else has encountered this and gotten around it I would appreciate knowing how.
I am using the Oracle Database Tools 1.2.0.200907171332 for Eclipse Galileo.
Thanks... Bob
AMR01TNV_TMS =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = tdc-sun-77-vip.unix.tdc.xxxyyy.com)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = tdc-sun-78-vip.unix.tdc.xxxyyy.com)(PORT = 1521))
(LOAD_BALANCE=ON)
(FAILOVER=ON)
(CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = SRV_TMS_TNV)
(FAILOVER_MODE=
(TYPE=select)
(METHOD=basic)
)))Still broken after two years. Oracle Database Tools version 1.7.2.20110330204, part of OEPE 11.1.1.7.2. Using Oracle Thin Driver ojdbc14 for 10.2.0.2.
(1) Change to Database Development perspective.
(2) In Data Source Explorer, right click Database Connections. Choose Connection Profile Oracle Database Connection.
(3) Name: OEPE Is Broken
(4) Description: Service Names Are Not Supported.
(5) Click on the icon to the right of Drivers: Oracle Thin Driver. This allows one to edit the driver definition.
(6) Change ConnectionURL to 'jdbc:oracle:thin:@server:1521/servicename. This will prove that the plug-in is not using the driver definition as a template.
(7) Use SQL Developer to probe your database. Ensure that the database is one that requires a service name and cannot connect using a SID.
(8) In the "New Connection Profile" dialog....
SID: (try a service name for a database that requires it)
Fill in Host, Port number, User name, and Password.
Note that the ConnectionURL contains a colon instead of a slash in front of the service name. The plug-in seems to be using the colon.
(9) Test Connection
java.sql.SQLException: Listener refused the connection with the following error:
ORA-12505, TNS:listener does not currently know of SID given in connect descriptor
The Connection descriptor used by the client was:
ac4-xxxxx-007-v.ysm.ac4.yahoo.com:1521:acxxxxx.ysm.ac4.yahoo.com
(10) Maybe Test Connection does not work and the plug-in is functional. Click on Finish. No, not the case.
(11) Maybe SID should be -
Native Supplicant "NAK requesting to use PEAP instead"
Hello,
We have a Cisco ISE infrastructure in place and we're experiencing seemingly random occurrences of users failing authentication because they're trying PEAP vs EAP. Does anyone know if it is possible to force the native Windows supplicant to use EAP only?
"Microsoft: Smart Card or other certificate" is selected under network authentication method, by group policy, and I thought that wouldn't allow PEAP, but our ISE logs show "NAK requesting to use PEAP instead", after which authorization
fails because we're not using PEAP.
For what it's worth, the user can fail authentication for hours and I can either allow open authentication on the port for a bit, or the user can leave for the day and come back tomorrow and authentication will succeed. I'm not sure if it's an ISE problem or
a supplicant problem, but I'm leaning towards supplicant.
Thanks,
AndrewHi,
About this issue, please contact Cisco Tech Support for help.
Karen Hu
TechNet Community Support
I've already been in contact with them and they've verified our configuration. All that can be done on the Cisco side is to "propose" the client to go through EAP-TLS as the first option, which we are doing. This will not block any clients trying to connect
using other protocols, and, though this will propose EAP-TLS, there is now way to enforce it at the supplicant level. This will be a client decision always. From Cisco:
Please monitor this after the change we applied, but if the issue persists, since we are dealing with windows supplicant, it would be a good idea to involve the native supplicant support. -
C# use textboxes instead of numericupdowns
Okay, so i have a program that calculates grades, but there is a problem that i didn't quite think through (people have 0's in their classes) and i have coded my program to not include 0's in the numeric updown. I would like to replace all numeric updowns
with textboxes, and then do the exact same thing, but only disregard the textbox from the averaging process if it is blank, or has letters. I will provide my code for the numericupdown and for hi coded the program
itself.
private void timer1_Tick(object sender, EventArgs e)
List<NumericUpDown> numList = new List<NumericUpDown>();
foreach (Control c in this.Controls)
if (c.GetType() == typeof(NumericUpDown))
NumericUpDown n = (NumericUpDown)c;
numList.Add(n);
var result = numList.GroupBy(num => num.Location.X, n => n.Value).Select(r => new
ColumnNo = r.Key,
ColumnAverage = r.Where(x => x > 0).DefaultIfEmpty(0).Average()
}).ToList();
result.Sort((a, b) => a.ColumnNo.CompareTo(b.ColumnNo));
if (result.Count > 0)
decimal percentage = 0.00M, total = 0.00M;
if (checkEdit1.Checked == true)
labelControl1.Text = "AVG: " + result[0].ColumnAverage;
if (decimal.TryParse(textEdit3.Text, out percentage))
total += (percentage / 100 * result[0].ColumnAverage);
else
labelControl1.Text = "Not Used";
So basically i want to do the EXACT same thing but use textboxes instead of numericupdowns. i want to stress i also have to change that it WILL include 0's, and exclude blank textboxes. i have tried to mess with it and has gotten too complicated for me.
any help is appretiated
Eat Mold. SubwayOk I built a core below, it's a proof of concept to show how datagridview can fit your requirements:
First thing is that we created a DataTable which will be used as a datasource for the DGV, you can add columns or rows(notice that null will create empty cells) as you like:
static DataTable GetTable()
// Here we create a DataTable with all columns.
DataTable table = new DataTable();
table.Columns.Add("Homework", typeof(double));
table.Columns.Add("ClassWork", typeof(double));
table.Columns.Add("Quiz", typeof(double));
table.Columns.Add("Test", typeof(double));
table.Columns.Add("Final", typeof(double));
table.Columns.Add("Other", typeof(double));
//Create rows
for (int i = 0; i < 30; i++)
table.Rows.Add(null, 0, 0, 0, 0, 0);
return table;
Second thing we bind the above DT to the DataGrid, and create an event on the column changed event of the datatable, which will be used to calcuate the avg as you will see later:
private void Form1_Load(object sender, EventArgs e)
dataGridView1.DataSource = GetTable();
DataTable dataTable = dataGridView1.DataSource as DataTable;
dataTable.ColumnChanged += DataTable_ColumnChanged;
Below is a method that will be calculating the avg of a column, when a column value has changed:
private void ComputeColumn(string columName)
DataTable dataTable = dataGridView1.DataSource as DataTable;
object sumObject = null;
sumObject = dataTable.Compute("Avg(" + columName + ")", "" + columName + " > 0");
switch (columName)
case "Homework":
label1.Text = sumObject.ToString();
break;
case "ClassWork":
//update another lablel
break;
default:
label1.Text = sumObject.ToString();
break;
label1.Text = sumObject.ToString();
Below are the events, One for the the datacolumn value change, and the other is to allow only numeric or decimal values to be entered into the cells:
private void DataTable_ColumnChanged(object sender, DataColumnChangeEventArgs e)
ComputeColumn(e.Column.ToString());
private void dataGridView1_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
if (e.Control is TextBox)
TextBox tb = e.Control as TextBox;
tb.KeyPress += new KeyPressEventHandler(tb_KeyPress);
void tb_KeyPress(object sender, KeyPressEventArgs e)
if (!(char.IsDigit(e.KeyChar)))
if (e.KeyChar != '\b' && e.KeyChar != '.') //allow the backspace key and . char
e.Handled = true;
And the result:
You still have the calculation of the final grade but that is easy to accomplish.
You can download this demo from:
Demo
Fouad Roumieh
Maybe you are looking for
-
Software download error on LG Spectrum
Is anyone else getting a software download error when they try to check for updates. Obviously my LG Spectrum has never notified me of the Android 4.0 (ICS) update because of the error. I spoke with a Verizon rep today and they said this has been a c
-
My iPhone is 16gb and i have no music, 500ish photos, and about 10 apps I had to delete everything off it because i couldn't take any photos because i had no space! How do i get rid of the storage other is taking up?
-
What Gives With The Login?
For several days now, whenever I've tried to log in, I get an error message that reads: "Error An Error has occured. We apologize for the inconvenience." Well, I'll say. I have to close the window, then come back to discussions, but "WALLA!" now I'm
-
How this light rays and fogg blue impression can be made in Photoshop or in illustrator?
Hi All, I am in dire need of your help, How can this special effect in attached image can be produced. To be precise, I mean light rays coming from dj player and if you notice there is blue foggy impression on tshirt , How these things can be made
-
RunInstaller hang without apparently errors
The runInstaller hang without apparently error (nothing in the installActions.log, .err and .out) We originally install 8.1.7.0 64bits on a Sparc 5.8 64 bits without problem, after this, we apply patch 8.1.7.4.1. Now are necessary installing interMed