Convert value during a join statement
Hi folks,
Is there a way to convert value of a table field during a select statement? I have a sql statement that doesn't work because a field has zero characters prefix.
SELECT EBANBANFN EBANBNFPO EBANSTATU EBANBSART EBANMENGE EBANLFDAT EKKOAEDAT EKKOEBELN EKKO~LIFNR
INTO TABLE GT_RFQ_DATA
FROM EBAN JOIN EKKO ON EKKOSUBMI = EBANBANFN
EBANBANFN = '0003006807' and EKKOSUBMI = '3006807'
Is it possible to do a join with that condition? Will reward points.
Note: I know how to get those data without a join, so I will not give out reward points for those advices.
Thanks for all of your helps.
Try using the fucntion module CONVERSION_EXIT_ALPHA_INPUT to pad with leading Zeros
if you want to convert the value of
EKKOSUBMI = '3006807' to EKKOSUBMI = '0003006807'
or if you want to remove leading zeros
use CONVERSION_EXIT_ALPHA_OUTPUT function module.
Data: v_submi like ekko-submi.
v_submi = '3006807'
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = v_submi
IMPORTING
OUTPUT = v_submi
EXCEPTIONS
OTHERS = 1.
SELECT EBANBANFN EBANBNFPO EBANSTATU EBANBSART EBANMENGE EBANLFDAT EKKOAEDAT EKKOEBELN EKKO~LIFNR
INTO TABLE GT_RFQ_DATA
FROM EBAN JOIN EKKO ON EKKOSUBMI = EBANBANFN
EBANBANFN = '0003006807' and EKKOSUBMI = v_submi
Similar Messages
-
SOME FIELDS OF WORK AREA ARE CONVERTED TO ***** AT AT NEW STATEMENT
HELLO
SOME OF THE FIELDS OF WORK AREA ARE CONVERTED INTO *********** AT AT NEW STATEMENT .FIND BELOW THE CODE
*& Report YTEST_OBJECTS7
REPORT YTEST_OBJECTS7.
Program Description
Author.........: Jitendra Dash *
Creation date..: 17/09/2010 *
GAP ID/FS Id...: *
Transport......: *
Description u2026..: *
CHANGE HISTORY u2013 Should be completed in reverse date order *
Revised by........: <Developer name> *
Change date.......: Date of creation> *
CR/Defect No......: <Change Request No>/ <Defect#<xxx> *
Transport.........: <Request No> *
Description.......: Description about modification *
Data Declaration
TYPES: BEGIN OF gx_input,
NEMI TYPE EXT_UI,
DIVISION TYPE SPARTE ,
DATE TYPE ERDAT,
DATE1 TYPE ERDAT,
END OF gx_input.
TYPES: BEGIN OF gx_input1,
NEMI TYPE EXT_UI,
DIVISION TYPE SPARTE ,
DATE TYPE ERDAT,
DATE1 TYPE ERDAT,
int_ui TYPE INT_UI,
ANlage type anlage,
SERVICE TYPE SERCODE,
SERVICEID TYPE SERVICE_PROV,
SPARTE TYPE SPARTE,
END OF gx_input1.
TYPES : BEGIN OF gx_euitrans,
INT_UI TYPE INT_UI,
EXT_UI type EXT_UI,
END OF gx_euitrans.
TYPES : BEGIN OF gx_eservice,
INT_UI TYPE INT_UI,
SERVICE TYPE SERCODE,
SERVICEID TYPE SERVICE_PROV,
SPARTE TYPE SPARTE,
END OF gx_eservice.
TYPES : BEGIN OF gx_inst,
int_ui TYPE INT_UI,
ANlage type anlage,
END OF gx_inst.
TYPES : BEGIN OF gx_ever,
ANLAGE TYPE anlage,
EINZDAT TYPE EINZDAT,
AUSZDAT TYPE AUSZDAT,
VERTRAG type VERTRAG,
vkonto TYPE VKONT_KK,
END OF gx_ever .
TYPES : BEGIN OF gx_fkkvkp,
VKONT type VKONT_KK,
GPART type GPART_KK,
END OF gx_fkkvkp.
DATA : GIT_INPUT TYPE STANDARD TABLE OF GX_INPUT,
git_euitrans TYPE STANDARD TABLE OF gx_euitrans,
git_eservice TYPE STANDARD TABLE OF gx_eservice,
git_inst TYPE STANDARD TABLE OF gx_inst,
git_ever TYPE STANDARD TABLE OF gx_ever,
GIT_INPUT1 TYPE STANDARD TABLE OF GX_INPUT1,
GIT_fkkvkp TYPE STANDARD TABLE OF GX_fkkvkp,
WA_INPUT TYPE gx_input,
wa_euitrans LIKE LINE OF git_euitrans,
wa_eservice like LINE OF git_eservice,
WA_inst LIKE LINE OF git_inst,
wa_ever LIKE LINE OF git_ever,
wa_INPUT1 like LINE OF git_INPUT1,
wa_fkkvkp like LINE OF GIT_fkkvkp.
DATA: gv_v_localfile TYPE localfile,
gv_g_localfile type string,
gv_g_alocalfile type string,
gv_g_sender type SERVICE_PROV,
gv_g_reciever type SERVICE_PROV.
CONSTANTS : GC_AINP TYPE c LENGTH 50 VALUE '/tmp'.
************Selection screen for input *********************
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE t1.
PARAMETERS : p_rad1 RADIOBUTTON GROUP grp DEFAULT 'X' USER-COMMAND chk,
p_rad2 RADIOBUTTON GROUP grp,
p_file TYPE file_table-filename MODIF ID m1,
p_afile TYPE file_table-filename MODIF ID m2.
SELECTION-SCREEN END OF BLOCK b1.
***************Initialization*****************************
INITIALIZATION.
t1 = text-001.
***Selection of Appl ser and Presen ser for I/P file******
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF p_rad1 = 'X'.
IF screen-group1 = 'M2'.
screen-active = 0.
MODIFY SCREEN.
ENDIF.
ELSEIF p_rad2 = 'X'.
IF screen-group1 = 'M1'.
screen-active = 0.
MODIFY SCREEN.
ENDIF.
ENDIF.
ENDLOOP.
**F4 help for inputting the Filename from presentation Ser*
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
EXPORTING
program_name = sy-repid
dynpro_number = sy-dynnr
field_name = p_file
CHANGING
file_name = gv_v_localfile
EXCEPTIONS
mask_too_long = 1
OTHERS = 2.
IF sy-subrc = 0.
MOVE gv_v_localfile TO p_file.
move gv_v_localfile to gv_g_localfile.
ENDIF.
***F4 help for file on Application Server*******************
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_afile.
CALL FUNCTION '/SAPDMC/LSM_F4_SERVER_FILE'
EXPORTING
directory = GC_AINP
filemask = ' '
IMPORTING
serverfile = p_afile
EXCEPTIONS
canceled_by_user = 1
OTHERS = 2.
IF sy-subrc = 0.
move p_afile to gv_g_alocalfile.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
START-OF-SELECTION.
IF p_rad1 = 'X'.
*************Upload file into Itab from pres server*********
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = gv_g_localfile
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = '|'
HEADER_LENGTH = 0
READ_BY_LINE = 'X'
DAT_MODE = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
CHECK_BOM = ' '
VIRUS_SCAN_PROFILE =
NO_AUTH_CHECK = ' '
IMPORTING
FILELENGTH =
HEADER =
TABLES
DATA_TAB = GIT_INPUT
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_READ_ERROR = 2
NO_BATCH = 3
GUI_REFUSE_FILETRANSFER = 4
INVALID_TYPE = 5
NO_AUTHORITY = 6
UNKNOWN_ERROR = 7
BAD_DATA_FORMAT = 8
HEADER_NOT_ALLOWED = 9
SEPARATOR_NOT_ALLOWED = 10
HEADER_TOO_LONG = 11
UNKNOWN_DP_ERROR = 12
ACCESS_DENIED = 13
DP_OUT_OF_MEMORY = 14
DISK_FULL = 15
DP_TIMEOUT = 16
OTHERS = 17
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ELSEIF p_rad2 = 'X'.
*************Upload file into Itab from Applic server*********
************file should be ; seperated and not tab seper******
TRANSLATE gv_g_alocalfile USING '\/'.
OPEN DATASET gv_g_alocalfile FOR INPUT MESSAGE gv_LC_MESSAGE in TEXT MODE ENCODING DEFAULT.
IF sy-subrc = 0.
DO.
READ DATASET gv_g_alocalfile INTO wa_xls.
IF sy-subrc IS NOT INITIAL.
EXIT.
ELSE.
APPEND wa_xls TO git_xls.
ENDIF.
ENDDO.
ENDIF.
close DATASET gv_g_alocalfile.
ENDIF.
SELECT INT_UI EXT_UI from EUITRANS
into CORRESPONDING FIELDS OF TABLE git_euitrans
for ALL ENTRIES IN GIT_INPUT
WHERE ext_ui = GIT_INPUT-NEMI.
SElect INT_UI
SERVICE
SERVICEID
SPARTE from ESERVICE
into CORRESPONDING FIELDS OF TABLE git_eservice
FOR ALL ENTRIES IN git_euitrans
where INT_UI = git_euitrans-INT_UI .
SELECT INT_UI
ANLAGE from euiinstln
into CORRESPONDING FIELDS OF TABLE GIT_INST
FOR ALL ENTRIES IN git_eservice
WHERE INT_UI = git_eservice-INT_UI.
LOOP AT git_eservice into wa_eservice.
READ TABLE git_euitrans into wa_euitrans
with KEY int_ui = wa_eservice-int_ui.
IF SY-SUBRC = 0.
READ TABLE git_input into wa_input
WITH key NEMI = wa_euitrans-EXT_UI.
IF SY-SUBRC = 0.
READ TABLE GIT_INST into WA_INST
with key int_ui = wa_eservice-int_ui.
IF Sy-subrc = 0.
wa_input1-NEMI = wa_input-NEMI .
wa_input1-DIVISION = wa_input-DIVISION.
wa_input1-DATE = wa_input-DATE.
wa_input1-DATE1 = wa_input-DATE1.
wa_input1-int_ui = wa_eservice-int_ui.
wa_input1-anlage = WA_INST-anlage.
wa_input1-SERVICE = wa_eservice-service.
wa_input1-SERVICEID = wa_eservice-serviceid.
wa_input1-SPARTE = wa_eservice-sparte.
Append wa_input1 to git_input1.
ENDIF.
ENDIF.
ENDIF.
clear : wa_eservice,wa_input,WA_INST,wa_euitrans,wa_input1 .
ENDLOOP.
SELECT anlage
EINZDAT
AUSZDAT
VERTRAG
VKONTO from ever
into CORRESPONDING FIELDS OF TABLE git_ever
FOR ALL ENTRIES IN git_input1
WHERE anlage = git_input1-ANLAGE
and EINZDAT = git_input1-DATE
or AUSZDAT = git_input1-DATE1.
Select Vkont Gpart from fkkvkp
into CORRESPONDING FIELDS OF TABLE git_fkkvkp
for ALL ENTRIES IN git_ever
where Vkont = git_ever-Vkonto.
LOOP AT git_input1 INTO wa_input1 .
IF wa_input1-SPARTE = 01 .
CASE wa_input1-SERVICE.
WHEN 'FRMP'.
gv_g_sender = wa_input1-SERVICEID.
WHEN 'LNSP'.
gv_g_reciever = wa_input1-SERVICEID.
ENDCASE.
ELSEIF wa_input1-SPARTE = 02 .
CASE wa_input1-SERVICE.
WHEN 'FRO'.
gv_g_sender = wa_input1-SERVICEID.
WHEN 'DB'.
gv_g_reciever = wa_input1-SERVICEID.
ENDCASE.
ENDIF.
data : int_ui TYPE INT_UI.
*int_ui = wa_input1-int_ui .
AT NEW int_ui .
READ TABLE git_ever into wa_ever with key anlage = wa_input1-anlage.
READ TABLE git_fkkvkp INTO wa_fkkvkp with key Vkont = wa_ever-Vkonto.
CALL FUNCTION 'ZIN_COMEV_CUSTDETAILNOTIF_OUT'
EXPORTING
Y_SENDER = gv_g_sender
Y_RECEIVER = gv_g_reciever
Y_PARTNER = wa_fkkvkp-gpart
Y_BASIC_PROCESS = 'ZCDNO'
Y_SWITCHNUM =
Y_SEN_LOAD =
Y_INTUI = wa_input1-int_ui
Y_TRANSACTIONID =
Y_DATE = wa_input1-DATE
IMPORTING
X_TASK_ID =
TABLES
IDOC_STATUS =
IDOC_CONTRL =
XYT_ERROR =
EXCEPTIONS
GENERAL_FAULT = 1
NOT_FOUND = 2
OTHERS = 3
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDAT.
ENDLOOP.
IN THIS PROGRAM AT AT NEW STATEMENT IN LOOP SOME OF THE FIELDS OF wa_input1 IS CONVERTED TO ***** E.G wa_input1-anlage.
pLEASE HELP ME OUTHELLO
My Q is some fields at AT NEW statement turns into *****.Please help me out
TYPES: BEGIN OF gx_input1,
NEMI TYPE EXT_UI,
DIVISION TYPE SPARTE ,
DATE TYPE ERDAT,
DATE1 TYPE ERDAT,
int_ui TYPE INT_UI,
ANlage type anlage,
SERVICE TYPE SERCODE,
SERVICEID TYPE SERVICE_PROV,
SPARTE TYPE SPARTE,
END OF gx_input1.
GIT_INPUT1 TYPE gx_input1.
LOOP AT git_input1 INTO wa_input1 .
AT NEW int_ui .----
>hERE FIELDS OF wa_input1 ARE TURNED INTO *
EX: wa_input1-ANLAGE =******** AFTER AT IN COMMAND.
END AT
eNDLOOP -
JBO-26041: Failed to post data to database during "Insert": SQL Statement "
Dear All,
I am trying to insert the data into custom table,getting the following error. Please help me to resolve the issues.
I have created one custom table in APPS schema having the primary key and History Columns.
Created the EO based on the custom table and generate the create method.
Created the VO based on the EO and generated the VOImpl, RowImpl Java Files.
I am using the PER_PEOPLE_S sequence to populate the value into Primary key column.
Calling the below code into create method of EO object to populate the value into Primarykey column.
setPersPersonid(getOADBTransaction().getSequenceValue("PER_PEOPLE_S"));
oracle.apps.fnd.framework.OAException: oracle.jbo.DMLException: JBO-26041: Failed to post data to database during "Insert": SQL Statement "INSERT INTO XXUTS_PERSON_T(PERS_PERSONID,PERS_FIRSTNAME,PERS_LASTNAME,CREATION_DATE,CREATED_BY,LAST_UPDATED_BY,LAST_UPDATE_DATE,LAST_UPDATE_LOGIN) VALUES (?,?,?,?,?,?,?,?)".
at oracle.apps.fnd.framework.OAException.wrapperInvocationTargetException(Unknown Source)
at oracle.apps.fnd.framework.server.OAUtility.invokeMethod(Unknown Source)
at oracle.apps.fnd.framework.server.OAUtility.invokeMethod(Unknown Source)
at oracle.apps.fnd.framework.server.OAApplicationModuleImpl.invokeMethod(Unknown Source)
at xxuts.oracle.apps.csc.person.webui.XXCreatePersonCO.processFormRequest(XXCreatePersonCO.java:67)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(Unknown Source)
at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(Unknown Source)
at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processFormRequest(Unknown Source)
at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processFormRequest(Unknown Source)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(Unknown Source)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(Unknown Source)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(Unknown Source)
at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(Unknown Source)
at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processFormRequest(Unknown Source)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(Unknown Source)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(Unknown Source)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(Unknown Source)
at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(Unknown Source)
at oracle.apps.fnd.framework.webui.beans.OABodyBean.processFormRequest(Unknown Source)
at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(Unknown Source)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(Unknown Source)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(Unknown Source)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(Unknown Source)
at OA.jspService(_OA.java:72)
at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:59)
at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:462)
at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:597)
at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:521)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:713)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:370)
at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:871)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:453)
at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:221)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:122)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:111)
at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:239)
at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:34)
at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:880)
at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
at java.lang.Thread.run(Thread.java:595)
## Detail 0 ##
java.sql.SQLException: ORA-00911: invalid character
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:138)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:316)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:282)
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:639)
at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:185)
at oracle.jdbc.driver.T4CPreparedStatement.execute_for_rows(T4CPreparedStatement.java:633)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1161)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3001)
at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3074)
at oracle.jbo.server.OracleSQLBuilderImpl.doEntityDML(OracleSQLBuilderImpl.java:427)
at oracle.jbo.server.EntityImpl.doDML(EntityImpl.java:5740)
at oracle.jbo.server.EntityImpl.postChanges(EntityImpl.java:4539)
at oracle.apps.fnd.framework.server.OAEntityImpl.postChanges(Unknown Source)
at oracle.jbo.server.DBTransactionImpl.doPostTransactionListeners(DBTransactionImpl.java:2996)
at oracle.jbo.server.DBTransactionImpl.postChanges(DBTransactionImpl.java:2807)
at oracle.jbo.server.DBTransactionImpl.commitInternal(DBTransactionImpl.java:1971)
at oracle.jbo.server.DBTransactionImpl.commit(DBTransactionImpl.java:2173)
at oracle.apps.fnd.framework.server.OADBTransactionImpl.commit(Unknown Source)
at xxuts.oracle.apps.csc.person.server.XXPersonMainAMImpl.savePersonToDatabase(XXPersonMainAMImpl.java:39)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at oracle.apps.fnd.framework.server.OAUtility.invokeMethod(Unknown Source)
at oracle.apps.fnd.framework.server.OAUtility.invokeMethod(Unknown Source)
at oracle.apps.fnd.framework.server.OAApplicationModuleImpl.invokeMethod(Unknown Source)
at xxuts.oracle.apps.csc.person.webui.XXCreatePersonCO.processFormRequest(XXCreatePersonCO.java:67)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(Unknown Source)
at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(Unknown Source)
at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processFormRequest(Unknown Source)
at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processFormRequest(Unknown Source)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(Unknown Source)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(Unknown Source)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(Unknown Source)
at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(Unknown Source)
at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processFormRequest(Unknown Source)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(Unknown Source)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(Unknown Source)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(Unknown Source)
at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(Unknown Source)
at oracle.apps.fnd.framework.webui.beans.OABodyBean.processFormRequest(Unknown Source)
at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(Unknown Source)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(Unknown Source)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(Unknown Source)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(Unknown Source)
at OA.jspService(_OA.java:72)
at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:59)
at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:462)
at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:597)
at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:521)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:713)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:370)
at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:871)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:453)
at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:221)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:122)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:111)
at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:239)
at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:34)
at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:880)
at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
at java.lang.Thread.run(Thread.java:595)
java.sql.SQLException: ORA-00911: invalid character
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:138)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:316)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:282)
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:639)
at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:185)
at oracle.jdbc.driver.T4CPreparedStatement.execute_for_rows(T4CPreparedStatement.java:633)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1161)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3001)
at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3074)
at oracle.jbo.server.OracleSQLBuilderImpl.doEntityDML(OracleSQLBuilderImpl.java:427)
at oracle.jbo.server.EntityImpl.doDML(EntityImpl.java:5740)
at oracle.jbo.server.EntityImpl.postChanges(EntityImpl.java:4539)
at oracle.apps.fnd.framework.server.OAEntityImpl.postChanges(Unknown Source)
at oracle.jbo.server.DBTransactionImpl.doPostTransactionListeners(DBTransactionImpl.java:2996)
at oracle.jbo.server.DBTransactionImpl.postChanges(DBTransactionImpl.java:2807)
at oracle.jbo.server.DBTransactionImpl.commitInternal(DBTransactionImpl.java:1971)
at oracle.jbo.server.DBTransactionImpl.commit(DBTransactionImpl.java:2173)
at oracle.apps.fnd.framework.server.OADBTransactionImpl.commit(Unknown Source)
at xxuts.oracle.apps.csc.person.server.XXPersonMainAMImpl.savePersonToDatabase(XXPersonMainAMImpl.java:39)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at oracle.apps.fnd.framework.server.OAUtility.invokeMethod(Unknown Source)
at oracle.apps.fnd.framework.server.OAUtility.invokeMethod(Unknown Source)
at oracle.apps.fnd.framework.server.OAApplicationModuleImpl.invokeMethod(Unknown Source)
at xxuts.oracle.apps.csc.person.webui.XXCreatePersonCO.processFormRequest(XXCreatePersonCO.java:67)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(Unknown Source)
at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(Unknown Source)
at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processFormRequest(Unknown Source)
at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processFormRequest(Unknown Source)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(Unknown Source)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(Unknown Source)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(Unknown Source)
at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(Unknown Source)
at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processFormRequest(Unknown Source)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(Unknown Source)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(Unknown Source)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(Unknown Source)
at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(Unknown Source)
at oracle.apps.fnd.framework.webui.beans.OABodyBean.processFormRequest(Unknown Source)
at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(Unknown Source)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(Unknown Source)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(Unknown Source)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(Unknown Source)
at OA.jspService(_OA.java:72)
at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:59)
at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:462)
at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:597)
at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:521)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:713)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:370)
at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:871)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:453)
at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:221)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:122)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:111)
at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:239)
at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:34)
at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:880)
at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
at java.lang.Thread.run(Thread.java:595)
Thanksm
Sai SankilisettyDear Kumar,
I have checked the datatypes of the table and datatypes of the Pageitems, both the datatypes are same.
I have created the region using the wizard based on the VO.
My custom table having only 3 columns and History Columns.Out of 3 columns PersPersonid is Primary key column and I am assigning the sequence value to the column in create method of EO as below
public void create(AttributeList attributeList) {
super.create(attributeList);
setPersPersonid(getOADBTransaction().getSequenceValue("PER_PEOPLE_S"));
//Here PER_PEOPLE_S is the Sequence
Thanks,
Sai -
Cannot set selectOneChoice value during reload (value auto become null)
Dear all,
I have a problem that getting null value in the SelectOneChoice field in a table binded to
a view object. If I change that SelectOneChoice to inputText, it works perfectly. The details
of the situation is described as follows:
I've binded a view objects with 8 attributes to a af:table, then I manually change
2 of the inputText fields inside 'Column' fields of the table to inputlistofvalue and
selectOneChoice. The code is as follow:
<af:column sortProperty="#{bindings.OpenBalanceVO1.hints.AcNo.name}"
sortable="false"
headerText="#{bindings.OpenBalanceVO1.hints.AcNo.label}"
id="c1" width="180"
inlineStyle="font-family:'Times New Roman', 'Arial Black', times, Serif; font-size:medium;">
<af:inputListOfValues value="#{row.bindings.AcNo.inputValue}"
label="#{bindings.OpenBalanceVO1.hints.AcNo.label}"
required="#{bindings.OpenBalanceVO1.hints.AcNo.mandatory}"
columns="#{bindings.OpenBalanceVO1.hints.AcNo.displayWidth}"
maximumLength="#{bindings.OpenBalanceVO1.hints.AcNo.precision}"
shortDesc="#{bindings.OpenBalanceVO1.hints.AcNo.tooltip}"
id="it1"
model="#{bindings.AcNo2.listOfValuesModel}"
autoSubmit="false"
returnPopupListener="#{backingBeanScope.backing_ImportOpenBalance.returnListener}">
<f:validator binding="#{row.bindings.AcNo.validator}"/>
</af:inputListOfValues>
</af:column>
<af:column sortProperty="#{bindings.OpenBalanceVO1.hints.CurrencyCode.name}"
sortable="false"
headerText="#{bindings.OpenBalanceVO1.hints.CurrencyCode.label}"
id="c2">
<af:selectOneChoice value="#{row.bindings.CurrencyCode.inputValue}"
label="#{bindings.OpenBalanceVO1.hints.CurrencyCode.label}"
shortDesc="#{bindings.OpenBalanceVO1.hints.CurrencyCode.tooltip}"
id="it2" autoSubmit="false"
partialTriggers="cb1 cb2">
<f:selectItems value="#{loginInfo.activeCurrencies}" id="currenciesList"/>
</af:selectOneChoice>
</af:column>
And I have binded the returnPopupListener to returnListerner event handler to automatically
set the Currency field (2nd field) after the user chose the Account field (1st field) from
the input list of value:
public void returnListener(ReturnPopupEvent returnPopupEvent) {
RichInputListOfValues lovField = (RichInputListOfValues)returnPopupEvent.getSource();
ListOfValuesModel lovModel = lovField.getModel();
CollectionModel collectionModel = lovModel.getTableModel().getCollectionModel();
JUCtrlHierBinding treeBinding = (JUCtrlHierBinding)collectionModel.getWrappedData();
RowKeySet rks = (RowKeySet)returnPopupEvent.getReturnValue();
List tableRowKey = (List)rks.iterator().next();
DCIteratorBinding dciter = treeBinding.getDCIteratorBinding();
Key key = (Key)tableRowKey.get(0);
Row row = dciter.findRowByKeyString(key.toStringFormat(true));
DCBindingContainer bc = getBindingContainer();
DCIteratorBinding it2 = bc.findIteratorBinding("OpenBalanceVO1Iterator");
OpenBalanceVOImpl viewObject = (OpenBalanceVOImpl)it2.getViewObject();
FacesContext fctx = FacesContext.getCurrentInstance();
ExpressionFactory elFactory = fctx.getApplication().getExpressionFactory();
ValueExpression ve = elFactory.createValueExpression(fctx.getELContext(), "#{loginInfo}", LoginInfo.class);
LoginInfo loginInfo = (LoginInfo)ve.getValue(fctx.getELContext());
System.out.println("Return place: search date:" + loginInfo.getSearchDate());
Row newRow = viewObject.createRow();
String selectedAcNo = row.getAttribute("AcNo").toString();
String selectedCurrency = row.getAttribute("CurrencyCode").toString();
newRow.setAttribute("AcNo", selectedAcNo);
newRow.setAttribute("CurrencyCode",selectedCurrency);
newRow.setAttribute("OpenBal", 300);
newRow.setAttribute("AvailBal", 200);
newRow.setAttribute("CreateDate", new Date());
newRow.setAttribute("EffectiveDate", loginInfo.getSearchDate());
newRow.setAttribute("LockStatus", "N");
viewObject.insertRowAtRangeIndex(rowIndex, newRow);
The problem occurs when I use a 'createInsert' button to create a new row in the table,
and then choose a value from the inputListOfValues. The new row refresh and get the value
I chose in the first column in the new row. But the second column (currency field) is left
as empty (null value). If I change the second column frmo selectOneChoice to inputText,
the correct Currency value (e.g. "HKD" or "USD") can be shown. So I wonder if there is any
additional tricks in order to set the selectOneChoice value during refresh.
Additionally I have tried to check the state of the view object attributes during the refresh
lifecycle and found that the following reload method (else place) is being reached 3 times after I click
the 'ok' button in the popup up in the inputListOfValue.
public void beforePhase(PagePhaseEvent event) {
//System.out.println("i am here inside backing bean : before phrase 1 phrase ID:" + event.getPhaseId());
if (event.getPhaseId() == Lifecycle.PREPARE_MODEL_ID) {
if (!isPostback()) {
} else {
System.out.println("Post Back on Page Load!");
DCIteratorBinding it2 = bc.findIteratorBinding("OpenBalanceVO1Iterator");
OpenBalanceVOImpl viewObject = (OpenBalanceVOImpl)it2.getViewObject();
RowSetIterator iterator = viewObject.createRowSetIterator(null);
iterator.reset();
while (iterator.hasNext()) {
//Row row = viewObject.getCurrentRow();
Row row = iterator.next();
System.out.print("Account:" + row.getAttribute("AcNo"));
System.out.print(",AvailBal:" + row.getAttribute("AvailBal"));
System.out.print(",OpenBal:" + row.getAttribute("OpenBal"));
System.out.print(",CurrencyCode:" + row.getAttribute("CurrencyCode"));
System.out.print(",EffectiveDate:" + row.getAttribute("EffectiveDate"));
System.out.print(",UserCreate:" + row.getAttribute("UserCreate"));
System.out.println("");
if (row.getAttribute("UserCreate").toString().equals("<current user>")) {
System.out.println("Match <current user> in preload");
//row.setAttribute("CurrencyCode", "USD");
System.out.println("end of reload");
During the 1st time, the CurrencyCode field was set currently, but then in the 2nd and 3rd
times, it's value suddenly changed to 'null'. If I use inputText, all the 3 times currencyCode
field is showing correctly without the null issue.
Anyone can kindly give me some hints? Thanks a lot!!!Dear all,
I have a problem that getting null value in the SelectOneChoice field in a table binded to
a view object. If I change that SelectOneChoice to inputText, it works perfectly. The details
of the situation is described as follows:
I've binded a view objects with 8 attributes to a af:table, then I manually change
2 of the inputText fields inside 'Column' fields of the table to inputlistofvalue and
selectOneChoice. The code is as follow:
<af:column sortProperty="#{bindings.OpenBalanceVO1.hints.AcNo.name}"
sortable="false"
headerText="#{bindings.OpenBalanceVO1.hints.AcNo.label}"
id="c1" width="180"
inlineStyle="font-family:'Times New Roman', 'Arial Black', times, Serif; font-size:medium;">
<af:inputListOfValues value="#{row.bindings.AcNo.inputValue}"
label="#{bindings.OpenBalanceVO1.hints.AcNo.label}"
required="#{bindings.OpenBalanceVO1.hints.AcNo.mandatory}"
columns="#{bindings.OpenBalanceVO1.hints.AcNo.displayWidth}"
maximumLength="#{bindings.OpenBalanceVO1.hints.AcNo.precision}"
shortDesc="#{bindings.OpenBalanceVO1.hints.AcNo.tooltip}"
id="it1"
model="#{bindings.AcNo2.listOfValuesModel}"
autoSubmit="false"
returnPopupListener="#{backingBeanScope.backing_ImportOpenBalance.returnListener}">
<f:validator binding="#{row.bindings.AcNo.validator}"/>
</af:inputListOfValues>
</af:column>
<af:column sortProperty="#{bindings.OpenBalanceVO1.hints.CurrencyCode.name}"
sortable="false"
headerText="#{bindings.OpenBalanceVO1.hints.CurrencyCode.label}"
id="c2">
<af:selectOneChoice value="#{row.bindings.CurrencyCode.inputValue}"
label="#{bindings.OpenBalanceVO1.hints.CurrencyCode.label}"
shortDesc="#{bindings.OpenBalanceVO1.hints.CurrencyCode.tooltip}"
id="it2" autoSubmit="false"
partialTriggers="cb1 cb2">
<f:selectItems value="#{loginInfo.activeCurrencies}" id="currenciesList"/>
</af:selectOneChoice>
</af:column>
And I have binded the returnPopupListener to returnListerner event handler to automatically
set the Currency field (2nd field) after the user chose the Account field (1st field) from
the input list of value:
public void returnListener(ReturnPopupEvent returnPopupEvent) {
RichInputListOfValues lovField = (RichInputListOfValues)returnPopupEvent.getSource();
ListOfValuesModel lovModel = lovField.getModel();
CollectionModel collectionModel = lovModel.getTableModel().getCollectionModel();
JUCtrlHierBinding treeBinding = (JUCtrlHierBinding)collectionModel.getWrappedData();
RowKeySet rks = (RowKeySet)returnPopupEvent.getReturnValue();
List tableRowKey = (List)rks.iterator().next();
DCIteratorBinding dciter = treeBinding.getDCIteratorBinding();
Key key = (Key)tableRowKey.get(0);
Row row = dciter.findRowByKeyString(key.toStringFormat(true));
DCBindingContainer bc = getBindingContainer();
DCIteratorBinding it2 = bc.findIteratorBinding("OpenBalanceVO1Iterator");
OpenBalanceVOImpl viewObject = (OpenBalanceVOImpl)it2.getViewObject();
FacesContext fctx = FacesContext.getCurrentInstance();
ExpressionFactory elFactory = fctx.getApplication().getExpressionFactory();
ValueExpression ve = elFactory.createValueExpression(fctx.getELContext(), "#{loginInfo}", LoginInfo.class);
LoginInfo loginInfo = (LoginInfo)ve.getValue(fctx.getELContext());
System.out.println("Return place: search date:" + loginInfo.getSearchDate());
Row newRow = viewObject.createRow();
String selectedAcNo = row.getAttribute("AcNo").toString();
String selectedCurrency = row.getAttribute("CurrencyCode").toString();
newRow.setAttribute("AcNo", selectedAcNo);
newRow.setAttribute("CurrencyCode",selectedCurrency);
newRow.setAttribute("OpenBal", 300);
newRow.setAttribute("AvailBal", 200);
newRow.setAttribute("CreateDate", new Date());
newRow.setAttribute("EffectiveDate", loginInfo.getSearchDate());
newRow.setAttribute("LockStatus", "N");
viewObject.insertRowAtRangeIndex(rowIndex, newRow);
The problem occurs when I use a 'createInsert' button to create a new row in the table,
and then choose a value from the inputListOfValues. The new row refresh and get the value
I chose in the first column in the new row. But the second column (currency field) is left
as empty (null value). If I change the second column frmo selectOneChoice to inputText,
the correct Currency value (e.g. "HKD" or "USD") can be shown. So I wonder if there is any
additional tricks in order to set the selectOneChoice value during refresh.
Additionally I have tried to check the state of the view object attributes during the refresh
lifecycle and found that the following reload method (else place) is being reached 3 times after I click
the 'ok' button in the popup up in the inputListOfValue.
public void beforePhase(PagePhaseEvent event) {
//System.out.println("i am here inside backing bean : before phrase 1 phrase ID:" + event.getPhaseId());
if (event.getPhaseId() == Lifecycle.PREPARE_MODEL_ID) {
if (!isPostback()) {
} else {
System.out.println("Post Back on Page Load!");
DCIteratorBinding it2 = bc.findIteratorBinding("OpenBalanceVO1Iterator");
OpenBalanceVOImpl viewObject = (OpenBalanceVOImpl)it2.getViewObject();
RowSetIterator iterator = viewObject.createRowSetIterator(null);
iterator.reset();
while (iterator.hasNext()) {
//Row row = viewObject.getCurrentRow();
Row row = iterator.next();
System.out.print("Account:" + row.getAttribute("AcNo"));
System.out.print(",AvailBal:" + row.getAttribute("AvailBal"));
System.out.print(",OpenBal:" + row.getAttribute("OpenBal"));
System.out.print(",CurrencyCode:" + row.getAttribute("CurrencyCode"));
System.out.print(",EffectiveDate:" + row.getAttribute("EffectiveDate"));
System.out.print(",UserCreate:" + row.getAttribute("UserCreate"));
System.out.println("");
if (row.getAttribute("UserCreate").toString().equals("<current user>")) {
System.out.println("Match <current user> in preload");
//row.setAttribute("CurrencyCode", "USD");
System.out.println("end of reload");
During the 1st time, the CurrencyCode field was set currently, but then in the 2nd and 3rd
times, it's value suddenly changed to 'null'. If I use inputText, all the 3 times currencyCode
field is showing correctly without the null issue.
Anyone can kindly give me some hints? Thanks a lot!!! -
Query based on "NATURAL JOIN" statement of Oracle9i
I have created following 4 tables
create table CUST_MASTER
(CUST_NO NUMBER(3),CUST_NAME VARCHAR2(20),CUST_CITY VARCHAR2(20));
create table ITEM_MASTER
(ITEM_NO NUMBER(2),ITEM_NAME VARCHAR2(20),
PRICE NUMBER(4));
create table ORDER_HEADER
( ORDER_NO NUMBER(4), CUST_NO NUMBER(3));
create table ORDER_ITEMS
( ORDER_NO NUMBER(4), ITEM_NO NUMBER(2), QTY NUMBER(3));
Based on the above 4 table I have executed the following query.
select c.cust_no, c.cust_name, c.cust_city, oh.order_no, i.item_no, i.item_name, i.price, oi.qty
from cust_master c, item_master i, order_header oh, order_items oi
where c.cust_no = oh.cust_no and oh.order_no = oi.order_no and oi.item_no = i.item_no;
How should I build similar query in Oracle9i making use of "NATURAL JOIN" statement?Hallo,
yes you are correct.
From SQL Reference
NATURAL JOIN The NATURAL keyword indicates that a natural join is being performed. A natural join is based on all columns in the two tables that have the same name. It selects rows from the two tables that have equal values in the relevant columns
Nothing about foreign keys.
Test:
select * from scott.emp natural join scott.dept
DEPTNO EMPNO ENAME JOB MGR HIREDATE SAL COMM DNAME LOC
20 7369 SMITH CLERK 7902 17.12.1980 800 RESEARCH DALLAS
30 7499 ALLEN SALESMAN 7698 20.02.1981 1600 300 SALES CHICAGO
30 7521 WARD SALESMAN 7698 22.02.1981 1250 500 SALES CHICAGO
20 7566 JONES MANAGER 7839 02.04.1981 2975 RESEARCH DALLAS
30 7654 MARTIN SALESMAN 7698 28.09.1981 1250 1400 SALES CHICAGO
30 7698 BLAKE MANAGER 7839 01.05.1981 2850 SALES CHICAGO
10 7782 CLARK MANAGER 7839 09.06.1981 2450 ACCOUNTING NEW YORK
20 7788 SCOTT ANALYST 7566 19.04.1987 3000 RESEARCH DALLAS
10 7839 KING PRESIDENT 17.11.1981 5000 ACCOUNTING NEW YORK
30 7844 TURNER SALESMAN 7698 08.09.1981 1500 0 SALES CHICAGO
20 7876 ADAMS CLERK 7788 23.05.1987 1100 RESEARCH DALLAS
30 7900 JAMES CLERK 7698 03.12.1981 950 SALES CHICAGO
20 7902 FORD ANALYST 7566 03.12.1981 3000 RESEARCH DALLAS
10 7934 MILLER CLERK 7782 23.01.1982 1300 ACCOUNTING NEW YORK
alter table scott.emp drop constraint fk_deptno
select * from scott.emp natural join scott.dept
DEPTNO EMPNO ENAME JOB MGR HIREDATE SAL COMM DNAME LOC
20 7369 SMITH CLERK 7902 17.12.1980 800 RESEARCH DALLAS
30 7499 ALLEN SALESMAN 7698 20.02.1981 1600 300 SALES CHICAGO
30 7521 WARD SALESMAN 7698 22.02.1981 1250 500 SALES CHICAGO
20 7566 JONES MANAGER 7839 02.04.1981 2975 RESEARCH DALLAS
30 7654 MARTIN SALESMAN 7698 28.09.1981 1250 1400 SALES CHICAGO
30 7698 BLAKE MANAGER 7839 01.05.1981 2850 SALES CHICAGO
10 7782 CLARK MANAGER 7839 09.06.1981 2450 ACCOUNTING NEW YORK
20 7788 SCOTT ANALYST 7566 19.04.1987 3000 RESEARCH DALLAS
10 7839 KING PRESIDENT 17.11.1981 5000 ACCOUNTING NEW YORK
30 7844 TURNER SALESMAN 7698 08.09.1981 1500 0 SALES CHICAGO
20 7876 ADAMS CLERK 7788 23.05.1987 1100 RESEARCH DALLAS
30 7900 JAMES CLERK 7698 03.12.1981 950 SALES CHICAGO
20 7902 FORD ANALYST 7566 03.12.1981 3000 RESEARCH DALLAS
10 7934 MILLER CLERK 7782 23.01.1982 1300 ACCOUNTING NEW YORK
ALTER TABLE scott.emp
ADD CONSTRAINT fk_deptno FOREIGN KEY (deptno)
REFERENCES SCOTT.dept (deptno)
ENABLE NOVALIDATE
/Regards
Dmytro Dekhtyaryuk -
My current query works perfectly.
SELECT so.* FROM shipping_order so WHERE (so.submitter = 20) OR (so.requestor_id IN (SELECT poc.objid FROM point_of_contact poc WHERE poc.ain = 20)) OR so.objid IN (SELECT ats.shipping_order_id FROM ac_to_so ats WHERE (ats.access_control_id IN (selectac. objid FROM access_control ac WHERE ac.ain = 20 OR ac.group IN ('buyers', 'managers'))))
But when I try to create it using join statements I do not get the correct results, or any results for that matter.
Here is the query with joins.
SELECT so.* FROM shipping_order so INNER JOIN point_of_contact ON (so.requestor_id = poc.objid AND poc.ain = 20) INNER JOIN ac_to_so ats ON (so.objid = ats.shipping_order_id) INNER JOIN access_control ac ON (ats.access_control_id = ac.objid AND (ac.group IN ('buyers', 'managers') OR ac.ain = 20)) WHERE (so.submitter = 20)
Any ideas on what I am doing wrong. I tried outer joins as well and did not get the results either.
TIA.
Edited by: user9522282 on Mar 11, 2009 6:27 AM fixed typoOh sorry. Here is the sql. Thanks!
create table point_of_contact
objid number not null,
ain number not null,
constraint point_of_contact_pk primary key (objid)
create table access_control
objid number not null,
ain number,
user_group varchar2(64 byte),
constraint access_control_pk primary key (objid)
create table shipping_order
objid number not null,
submitter number not null,
requestor_id number not null,
constraint shipping_order_pk primary key (objid)
create table ac_to_so
shipping_order_id number not null,
access_control_id number not null,
constraint ac_to_so_pk primary key (shipping_order_id, access_control_id),
constraint ac_to_so_access_control_fk1 foreign key (access_control_id)
references access_control (objid),
constraint ac_to_so_shipping_order_fk1 foreign key (shipping_order_id)
references shipping_order (objid),
insert into point_of_contact (objid,ain) values (2,37);
insert into point_of_contact (objid,ain) values (1,20);
insert into access_control (objid, ain) values (1, 20);
insert into access_control (objid, user_group) values (2, 'managers');
insert into shipping_order (objid, submitter, requestor_id) values (1,20,1);
insert into shipping_order (objid, submitter, requestor_id) values (2,23,2);
insert into shipping_order (objid, submitter, requestor_id) values (3,23,2);
insert into ac_to_so (shipping_order_id, access_control_id) values (1, 1);
insert into ac_to_so (shipping_order_id, access_control_id) values (2, 2);
select so.* from shipping_order so where (so.submitter = 20)
or (so.requestor_id in (select poc.objid from point_of_contact poc where poc.ain = 20))
or so.objid in (select ats.shipping_order_id from ac_to_so ats where
(ats.access_control_id in (select ac.objid from access_control ac where ac.ain = 20
or ac.user_group in ('buyers', 'managers')))); -
How to convert nested query to join
Hello All
I wrote a query, at first i find the name of the highest mountain,then find its provience and then list of mountains in this porvience.please help me to convert it to a join or generally a standard form.thank you in advance.
select mountain from geo_mountain where province=
(select province from geo_mountain where mountain=(select name from mountain where height=(select max(height) from mountain)))
mountain: name,height,...
geo_mountain: mountain,country,provinceHi,
Welcome to the forum!
Here's one way to do it:
WITH got_r_num AS
SELECT name
, RANK () OVER (ORDER BY height DESC) AS r_num
FROM mountain
SELECT p.mountain
FROM got_r_num r
JOIN geo_mountain n ON n.name = r.name
JOIN geo_mountain p ON p.proivince = n.province
WHERE r.r_num = 1
;A slightly different approach, closer to what you posted, involves a 4-way join:
(1) In a sub-query (let's call it got_max_height) find just the maximum height from mountain
(2) Join got_max_height to mountain, to get all mountains with that height. (There may be a tie)
(3) Join this to geo_mountain to get the province(s)
(4) Join this to another copy of geo_mountain to get all mountains in the same province(s). This step is just like the self-join in the query I posted.
I hope this answers your question.
If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all the tables involved, and the results you want from that data.
Point out where the query above is producing the wrong results, and explain, using specific examples, how you get the right results from the given data in those places.
Always say what version of Oracle you're using (e.g. 11.2.0.2.0).
See the forum FAQ {message:id=9360002} -
SELECT vbrkvbeln vbfavbelv
vbrkfkdat vbrkkunag
vbrpwerks kna1name1
FROM vbrk
INNER JOIN vbrp ON vbrkvbeln = vbrpvbeln
INNER JOIN vbfa ON vbfavbeln = vbrkvbeln
INNER JOIN kna1 ON kna1kunnr = vbrkkunag
INTO CORRESPONDING FIELDS OF TABLE INVTAB
WHERE vbrp~werks IN s_werks
AND vbrk~fkdat IN s_fkdat
AND vbrk~kunag IN s_kunag
AND vbrk~fkart IN ('ZF2','FVAT')
AND vbrk~fksto <> 'X'
AND vbrk~rfbsk = 'C'
AND vbrk~sfakn = ''
AND vbrk~inco1 = 'TWO'
AND VBRK~VKORG NE '5000'
AND vbfa~vbtyp_n = 'M'
AND vbfa~vbtyp_v = 'J'.
i am writng this join statement
but when displaying i am getting multiple records for a particular entry
say for a particular documnet number if it is having N no. of line itmes and when searching in vbfa thenumber of preeecig documents are M then the resords that it is disp;laying is N*M.
but in some cases it is showing records more than this
can you please help me why it is showing more records.
and in if you can explain me with an example with a dummy no of records how it will fetch record that will be a great help.Hi Ashish,
please chk the following links for inner and outer join ,
http://help.sap.com/saphelp_erp2004/helpdata/en/cf/21ec77446011d189700000e8322d00/frameset.htm
http://www.sap-img.com/abap/several-nested-inner-join-statements-can-be-inefficient.htm
http://www.thespot4sap.com/Articles/SAPABAPPerformanceTuning_InnerJoinStatement.asp
now how to write join statements
SELECT
a~ebeln
a~ebelp
a~matnr
a~txz01
a~menge
a~meins
a~netpr
a~brtwr
a~netwr
a~mwskz
a~navnw
a~effwr
a~werks
b~eindt
FROM
ekpo AS a
INNER JOIN
eket AS b
ON
aebeln = bebeln
INTO
TABLE t_ekpo
WHERE
a~ebeln = t_ekko_temp-ebeln
AND b~ebeln = t_ekko_temp-ebeln.
Think there are 2 tables . a right hand table and a left hand table.
in inner join : only those fields having coresponding values in the left hand side table are selected.
in outer join all the fields on the left hand side table are selected and the fields which have no corresponding values in the right hand side table are displayed as null values..
Reward points if helpful
Regards ,
Amber S -
Hi All,
I need some assistance creating a sophisticated join statement. Please find below my sample data tables:
Table 1 (Region Product)
Region
Product Code
Product Desc
Dubai
Prod A
Prod A Desc
Dubai
Prod B
Prod B Desc
Dubai
Prod C
Prod C Desc
Sharjah
Prod B
Prod B Desc
Sharjah
Prod C
Prod C Desc
Abu Dhabi
Prod A
Prod A Desc
Abu Dhabi
Prod C
Prod C Desc
Table 2 (Region Locations)
Region
Location
Location Desc
Dubai
Loc 1
Dubai Mall
Dubai
Loc 2
MOE
Dubai
Loc 3
DCC
Dubai
Loc 4
MCC
Sharjah
Loc 11
Sahara Center
Sharjah
Loc 12
Mega Mall
Abu Dhabi
Loc 21
Marina Mall
Final Joined Table (Regions Locations Products)
Region
Location
Location Desc
Product Code
Product Desc
Dubai
Loc 1
Dubai Mall
Prod A
Prod A Desc
Dubai
Loc 1
Dubai Mall
Prod B
Prod B Desc
Dubai
Loc 1
Dubai Mall
Prod C
Prod C Desc
Dubai
Loc 2
MOE
Prod A
Prod A Desc
Dubai
Loc 2
MOE
Prod B
Prod B Desc
Dubai
Loc 2
MOE
Prod C
Prod C Desc
Dubai
Loc 3
DCC
Prod A
Prod A Desc
Dubai
Loc 3
DCC
Prod B
Prod B Desc
Dubai
Loc 3
DCC
Prod C
Prod C Desc
Dubai
Loc 4
MCC
Prod A
Prod A Desc
Dubai
Loc 4
MCC
Prod B
Prod B Desc
Dubai
Loc 4
MCC
Prod C
Prod C Desc
Sharjah
Loc 11
Sahara Center
Prod B
Prod B Desc
Sharjah
Loc 11
Sahara Center
Prod C
Prod C Desc
Sharjah
Loc 12
Mega Mall
Prod B
Prod B Desc
Sharjah
Loc 12
Mega Mall
Prod C
Prod C Desc
Abu Dhabi
Loc 21
Marina Mall
Prod A
Prod A Desc
Abu Dhabi
Loc 21
Marina Mall
Prod C
Prod C Desc
Here is the description:
We have a table of products available to be sold in each region
We have a table of locations in each region
We want to get a final table of which product is available in each location (region being the common factor)
I can do it manually, let’s say first for Dubai, then for Sharjah and then for Abu Dhabi and then take a union. But it's quite cumbersome and manual process, as I’ve more than 30-40 regions (1,000+ locations and 10,000+ products).
Your help will be highly appreciated.
ThanksTry this
DECLARE @Product TABLE (Region VARCHAR(50), ProductCode VARCHAR(50));
DECLARE @Location TABLE (Region VARCHAR(50), Location VARCHAR(50));
INSERT INTO @Product VALUES
('Dubai', 'Prod A'),
('Dubai', 'Prod B'),
('Dubai', 'Prod C'),
('Sharjah', 'Prod B'),
('Sharjah', 'Prod C'),
('Abu Dhabi', 'Prod A'),
('Abu Dhabi', 'Prod C')
INSERT INTO @Location VALUES
('Dubai', 'Loc 1'),
('Dubai', 'Loc 2'),
('Dubai', 'Loc 3'),
('Dubai', 'Loc 4'),
('Sharjah', 'Loc 11'),
('Sharjah', 'Loc 12'),
('Abu Dhabi', 'Loc 21')
SELECT
P.Region, L.Location, P.ProductCode
FROM @Product P
INNER JOIN @Location L
ON P.Region = L.Region
ORDER BY P.Region, L.Location
Krishnakumar S -
Length error occurred during in IMPORT statement
Dear Friends,
(length error occurred during in IMPORT statement),when im using the SUBMIT syntax..can i know what is the reason.
Thanks
Rajkumar.AHello,
I would like to know how did you solve the issue as i came across the same issue.
Thanks,
FBK -
Need to convert values into coma separated
Need to convert values into coma separated
I have a string value that stores data like 'NYK,IND,SGP,GER'
FOR EXAMPLE
V_CITY_CODE = 'NYK,IND,SGP,GER'
When I query
select * from city where city_code = V_CITY_CODE;I get no rows, this is because V_CITY_CODE has all city code as single code.
I need a function to search , and replace with ','.
I tried using instr and replace but was unable to convert it.
could some one pls assist me.
thanks in advance
SazLooking for this?
SQL> select * from emp
2 /
EMPNO DEPTNO ENAME SAL DOJ JOB
1 1 Karthick 80 03-DEC-11
2 1 Karthick_1 90 23-NOV-11
3 2 Ram 80 03-DEC-11
4 2 Ram_1 90 23-NOV-11
SQL> var v_ename varchar2(1000)
SQL> exec :v_ename := 'Karthick,Karthick_1'
PL/SQL procedure successfully completed.
SQL> select *
2 from emp
3 where ename in (
4 select regexp_substr(val, '[^,]+', 1, level)
5 from (select :v_ename val from dual)
6 connect by level <= length(val) - length(replace(val, ','))+1
7 )
8 /
EMPNO DEPTNO ENAME SAL DOJ JOB
1 1 Karthick 80 03-DEC-11
2 1 Karthick_1 90 23-NOV-11 -
Cannot convert value "......." to type
I'm running the following script on Exchange 2010. The script reads 3 text files and then removes everyone from the Distribution Group / Universal Distribution Group "Messages Delivery Restrictions - Accept Messages Only From" before adding
a new list of users
$People = gc C:\ps_scripts\Staff_Aliases.txt
$UDGroups = gc C:\ps_scripts\Universal_Distribution_Groups.txt
$DDGroups = gc C:\ps_scripts\Dynamic_Distribution_Groups.txt
ForEach ($UDGroup in $UDGroups) {
Set-DistributionGroup $UDGroup -AcceptMessagesOnlyFrom $null
Set-DistributionGroup $UDGroup -AcceptMessagesOnlyFrom((Get-DistributionGroup $UDGroup).AcceptMessagesOnlyFrom + $People)
ForEach ($DDGroup in $DDGroups) {
Set-DynamicDistributionGroup $DDGroup -AcceptMessagesOnlyFrom $null
Set-DynamicDistributionGroup $DDGroup -AcceptMessagesOnlyFrom((Get-DistributionGroup $DDGroup).AcceptMessagesOnlyFrom + $People)
and I'm getting the following error:
Cannot convert value "a.abcd h.qwerty staff-abc staff.bcd" to type "Microsoft.Exchange.Data.MultiValuedProperty`1[Microsoft.Exchange.Configuration.Tasks.DeliveryRecipientIdParameter
]". Error: "Cannot convert value "" to type "Microsoft.Exchange.Configuration.Tasks.DeliveryRecipientIdParameter". Error: "Parameter values of type Microsoft.Exchange.Configuration.Tasks.DeliveryRecipientIdParameter can't
be empty. Specify a value, and try again.
Parameter name: identity""
+ CategoryInfo : InvalidData: (:) [Set-DynamicDistributionGroup], ParameterBindin...mationException
+ FullyQualifiedErrorId : ParameterArgumentTransformationError,Set-DynamicDistributionGroup
I'm getting the content from three text files, the first contains the User Alias and the 2nd/3rd contain the Universal and Dynamic Distribution Groups.
This is an exact copy and paste from the EMC screen and I know that the script should work but I can't see what I'm doing wrong
Help or ideas please
DarrynSet-DynamicDistributionGroup $DDGroup -AcceptMessagesOnlyFrom((Get-DistributionGroup $DDGroup).AcceptMessagesOnlyFrom + $People)
Look closely at this line. Read the documentation to see how it is used.
What you h ave typed makes no sense and I cannot understand what you want to do with this.
Start here for a tutorial on how to use these CmdLets:
http://blogs.msdn.com/b/ukeducloud/archive/2011/10/05/dynamic-distribution-groups-part-1.aspx
http://blogs.technet.com/b/educloud/archive/2011/10/06/dynamic-distribution-groups-part-2.aspx
¯\_(ツ)_/¯ -
Using offset in join statement
hi,
i wanted to use offset in join statement. but it is giving error.
select a~kunnr
a~vkorg
from knvv as inner join zcust
on knvv-kunnr+5(5) = zcust-refid.hi neha,
try this code i tested it.
types: begin of ty_knvv,
INCLUDE type knvv,
kunid type i, " For u type is zcust-refid
end of ty_knvv.
data: it_knvv type STANDARD TABLE OF ty_knvv INITIAL SIZE 0,
wa_knvv type ty_knvv.
select *
from knvv
into table it_knvv.
loop at it_knvv into wa_knvv.
kunid = wa_knvv-kunnr+5(5).
wa_knvv-kunid = kunid.
MOdify it_knvv TRANSPORTING kunid.
read table zcust into wa_zcust with key resid = wa_knvv-kunid.
endloop. -
Java.sql.SQLException: Cannot convert value
I have a database table - name is client. It has one field with TimeStamp Datatype.
I am using mysql-3.23.51-win and j2sdk-1_4_0_01-windows-i586.
create table client (
MODIFIED timestamp(14)
while I am doing select MODIFIED from client that time I am receiving 00000000000000.
So It has 00000000000000 value in databse.
Now I am getting this value using ResultSet. for that
I have a one Client Object class name is GenericClient
public class GenericClient {
private java.util.Date _modified;
public java.util.Date getModified() {
return _modified;
public void setModified(java.util.Date newVal) {
this._modified = newVal;
In my database processing class I am getting database value and set that value in setModified(java.util.Date newVal).
like
private Client decodeRow(ResultSet rs) throws SQLException {
GenericClient obj = new GenericClient();
obj.setModified(rs.getTimestamp(1));
return obj;
So at obj.setModified(rs.getTimestamp(1)); line I am received error message
java.sql.SQLException: Cannot convert value '00000000000000' from column 1 to TIMESTAMP.
Please guide me why I am receiving the above error.
Thanks
AmitPlease find some more information from my side
1) I am passing Timestamp Object
2) I am using PreparedStatement
3) code
Table : client
create table client (
MODIFIED timestamp(14)
);Bean Class
public class GenericClient {
private java.util.Date _modified;
public java.util.Date getModified() {
return _modified;
public void setModified(java.util.Date newVal) {
this._modified = newVal;
}Method - which is fired error
private Client decodeRow(ResultSet rs) throws SQLException {
GenericClient obj = new GenericClient();
obj.setModified(rs.getTimestamp(1));
return obj;
}3) Error Stack
==========
java.sql.SQLException: Cannot convert value '00000000000000' from column 1 to TIMESTAMP.
at com.mysql.jdbc.ResultSet.getTimestampFromString(ResultSet.java:5538)
at com.mysql.jdbc.ResultSet.getTimestampInternal(ResultSet.java:5566)
at com.mysql.jdbc.ResultSet.getTimestamp(ResultSet.java:5219)
at com.ksea.manager.ClientManager.decodeRow(ClientManager.java:463)
at com.ksea.manager.ClientManager.loadByWhere(ClientManager.java:266)
at com.ksea.manager.ClientManager.loadByWhere(ClientManager.java:221)
at com.ksea.manager.ClientManager.loadByWhere(ClientManager.java:203)
at com.ksea.manager.ClientManager.loadByUsername(ClientManager.java:53)
at com.ksea.nt.DBSynch.synchEmployees(DBSynch.java:83)
at com.ksea.nt.DBSynch.synchAll(DBSynch.java:35)
at com.ksea.nt.DBSynch.main(DBSynch.java:168)4) db Info
=======
I am using mysql-3.23.51-win and j2sdk-1_4_0_01-windows-i586. -
Updateable scrollable result sets with join statement
I am writing a generic GUI fronend for any database that has a JDBC2.0 driver available.
I have been using scrollable updateable result sets. These work well for individual tables but as soon as two tables are linked either implicitly or explicitly with a join statement the result set meta data isDefinitelyWriteable is set to false thus preventing the result set from being updated.
Assuming I am using the JDBC-ODBC driver with java sdk1.4.0 and MS Access (although I have used other databases and JDBCs I assume that the one mentioned will be a common combination and needs to work) is there any way of getting linked tables to be updateable with scollable result sets.
I am using scrollable result sets since this prevents the necessity of putting the data in a secondary data store.
I am able to link tables programmatically by requerying the linked table with a new where clause each time the cursor moves in the linked table but this seems rather wasteful. This method is not vey satisfactory when attempting to display data from more than one table which have more than one linked level (i.e. cascaded links).
Is there a simple solution to this problem or do I have to do a rewrite using an update statement instead of having an updateable result set. I assume this method would also require the result set to be reloaded after the update.
Any suggestions much appreciated.I am trying to make the GUI as flexible as possible by constructing "views" which if necessary link tables on one field in each table. This is fine for two tables but when linking to several tables the information thats produced cannot be read easily because as it stands the information from each table is displayed on a separate tabbed page. This mechanism allows me to keep each record set for each table separate and updateable.
Since I could see that this was not very user friendly in the way that it displayed the data I decided to try and introduce a join on two or more tables and hence the introduction of the current problem.
I mentioned that the objective was to be flexible and therefore I also allow queries to be written by the user to facilitate for any shortfalls of the automatic query construction produced by using the "views" mechanism.
So the answer to your question is yes I do control the SQL selections with one mechanism but ultimately no I do not because I provide a fail safe which allows the user to enter arbitary SQL.
I only really want a solution for the controlled SQL construction mechanism where I create the link between two or more tables. As mentioned earlier these are linked on one field only but I wish to provide the option of displaying the result in a single table (tabbed page) rather than spread across multiple tabbed pages.
Maybe you are looking for
-
Message are sending from Business Process take a lot of time
Hallo, in my BP there is the problem that the sending takes a lot of time. I see for example that mapping are not going. How can find the problem; the queues are empty. This seams a generell problem because all processes are effected. Thanks in advan
-
Error while using PayloadZipBean module
hi, For sending the data in zipped format in JDBC Adapter i used "PayloadZipBean" module. While Communication channel Monitoring at Receiver end I am getting this Error:-- "Message processing failed. Cause: com.sap.engine.services.jndi.persistent.exc
-
Trouble scrolling on the main menu using my dvd player.
I can't seem to move to the scenes button when I'm on the main menu using my DVD player. This function seems to work fine on my computer. Before I burn another (very long) disc and try again, does anyone have any suggestions? Natalie
-
SWF files won't display in Firefox 2.0
Apologies in advance if this already has been covered. Couldn't find it via the search tool, and am desperately on a deadline: Using Flash 8, I created a very simple presentation. I embedded the SWF file in the HTML page. It works fine in IE, but I j
-
Has anyone had a opf parse error with container.xml missing, when it is actually present plz ?