Syntax error in INSERT STATEMENT
A problem on the date part of the query but why I don´t
know, Thanks for any pointers,
TIA
<cfquery name="update1" datasource="trevor_SecurityDB">
INSERT INTO imagesproducts
(title, info, date)
VALUES ( '#form.title#', '#form.info#', '#DateFormat(Now())#'
</cfquery>
Error Occurred While Processing Request
Error Executing Database Query.
[Macromedia][SequeLink JDBC Driver][ODBC
Socket][Microsoft][ODBC Microsoft Access Driver] Syntax error in
INSERT INTO statement.
The error occurred in uploadmember.cfm: line 28
26 : INSERT INTO imagesproducts
27 : (title, info, date)
28 : VALUES ( '#form.title#', '#form.info#',
'#DateFormat(Now())#' )
29 : </cfquery>
30 :
SQL INSERT INTO imagesproducts (title, info, date) VALUES (
'News test', 'Testing news info', '12-Jul-07' )
DATASOURCE trevor_SecurityDB
VENDORERRORCODE -3502
SQLSTATE 42000
Perhaps it is a reserved word issue with the date column,
since
date is an ODBC Reserved Keyword. You might try enclosing it
within brackets [ ].
<cfquery name="update1" datasource="trevor_SecurityDB">
INSERT INTO imagesproducts
(title, info, [date])
VALUES ( '#form.title#', '#form.info#', '#DateFormat(Now())#'
</cfquery>
Or, if that doesn't help, you might try using a cfqueryparam
tag for the '#DateFormat(Now())#' value using a cfsqltype =
"CF_SQL_TIMESTAMP" (assuming a date/time datatype on the column).
Also, you might look into using one of the CreateODBCDateTime() or
CreateODBCDate() functions.
Phil
Similar Messages
-
I have a flash form that is used to inserts a record into an
Access database table. In the for there are 4 datefields, several
text input fields, and several select fields. When I submit the
form, I get a syntax error that reads:
Executing Database Query. [Macromedia][SequeLink JDBC
Driver][ODBC Socket][Microsoft][ODBC Microsoft Access Driver]
Syntax error in INSERT INTO statement.
The error occurred on line 184. Complex object types cannot
be converted to simple values.
Line 184 is the last line of the Values in the insert query.
The query looks like this:
<CFQUERY DATASOURCE="#REQUEST.DataSource#">
INSERT INTO EstimateNumber(
BidNumber,
Project,
JobSite,
EstimatedBy,
Region,
Company,
Division,
InquiryNumber,
SafetyChecklist,
SafetyChecklistDate,
QCChecklist,
QCChecklistDate,
EstimatedValue,
UserUsername,
UserPassword,
Updated,
ReviewDate,
ReviewedBy,
Discipline,
BidDate,
JobNumber,
UpdatedBy
VALUES(
#FORM.BidNumber#,
'#FORM.Project#',
'#FORM.JobSite#',
'#FORM.EstimatedBy#',
#FORM.Region#,
#FORM.Company#,
#FORM.Division#,
'#FORM.InquiryNumber#',
#FORM.SafetyChecklist#,
#FORM.SafetyChecklistDate#,
#FORM.QCChecklist#,
'#FORM.QCChecklistDate#',
#FORM.EstimatedValue#,
'#FORM.UserUsername#',
'#FORM.UserPassword#',
#FORM.Updated#,
#FORM.ReviewDate#,
#FORM.ReviewedBy#,
#FORM.Discipline#,
#FORM.BidDate#,
#FORM.JobNumber#,
'#FORM.UpdatedBy#'
</CFQUERY>
Any recomendations?Date/Time in Access provide some pretty strage hurdles. In
many occassions I have simply changed the field to a Text field and
ran with that and never seemed to have problems with the result. I
didn't like doing it but I never received errors. I have been
receiving some parameter errors with <cfqueryparam> like the
database doesn't recognized the preceding declared field in the
update or insert query. Here is an example of a wierd error with
Access. I have 2 tables. One is for estimate numbers and the other
is for sub estimate numbers that can be assigned to specific
estimate numbers. If is actually a complicated explanation about
what is taking place behind the doors on this. The concept is
simple on the surface. Both tables have the same fields except the
subestimate table has 1 extra for a user defined subestimate
number. The only relation between the two will be the estimate
number. This insert works fine.
INSERT INTO EstimateNumber(
BidNumber,
Project,
JobSite,
EstimatedBy,
Region,
Company,
Division,
InquiryNumber,
SafetyChecklist,
SafetyChecklistDate,
QCChecklist,
QCChecklistDate,
EstimatedValue,
UserUsername,
UserPassword,
ReviewDate,
Discipline,
BidDate,
JobNumber,
UpdatedBy
VALUES(
#FORM.BidNumber#,
'#FORM.Project#',
'#FORM.JobSite#',
'#FORM.EstimatedBy#',
#FORM.Region#,
#FORM.Company#,
#FORM.Division#,
'#FORM.InquiryNumber#',
#FORM.SafetyChecklist#,
<cfqueryparam
value="#FORM.SafetyChecklistDate#"
cfsqltype="CF_SQL_DATE "
maxlength="50"
>,
#FORM.QCChecklist#,
<cfqueryparam
value="#FORM.QCChecklistDate#"
cfsqltype="CF_SQL_DATE "
maxlength="50"
>,
#FORM.EstimatedValue#,
'#FORM.UserUsername#',
'#FORM.UserPassword#',
<cfqueryparam
value="#FORM.ReviewDate#"
cfsqltype="CF_SQL_DATE "
maxlength="50"
>,
#FORM.Discipline#,
<cfqueryparam
value="#FORM.BidDate#"
cfsqltype="CF_SQL_DATE "
maxlength="50"
>,
#FORM.JobNumber#,
'#FORM.UpdatedBy#'
This next one is the same exact query with the same table
setup with one added field but kicks back a parmeter error
expecting 4. I can't explain it.
INSERT INTO SubEstimate(SubBidNumber,
BidNumber,
Project,
JobSite,
EstimatedBy,
Region,
Company,
Division,
InquiryNumber,
SafetyChecklist,
SafetyChecklistDate,
QCChecklist,
QCChecklistDate,
EstimatedValue,
UserUsername,
UserPassword,
ReviewDate,
Discipline,
BidDate,
JobNumber,
UpdatedBy
VALUES(#FORM.SubBidNumber#,
#FORM.BidNumber#,
'#FORM.Project#',
'#FORM.JobSite#',
'#FORM.EstimatedBy#',
#FORM.Region#,
#FORM.Company#,
#FORM.Division#,
'#FORM.InquiryNumber#',
#FORM.SafetyChecklist#,
<cfqueryparam
value="#FORM.SafetyChecklistDate#"
cfsqltype="CF_SQL_DATE "
maxlength="50"
>,
#FORM.QCChecklist#,
<cfqueryparam
value="#FORM.QCChecklistDate#"
cfsqltype="CF_SQL_DATE "
maxlength="50"
>,
#FORM.EstimatedValue#,
'#FORM.UserUsername#',
'#FORM.UserPassword#',
<cfqueryparam
value="#FORM.ReviewDate#"
cfsqltype="CF_SQL_DATE "
maxlength="50"
>,
#FORM.Discipline#,
<cfqueryparam
value="#FORM.BidDate#"
cfsqltype="CF_SQL_DATE "
maxlength="50"
>,
#FORM.JobNumber#,
'#FORM.UpdatedBy#'
IF I get rid of the cfqueryparam fields it works. If I simply
remove the param, I get a Syntax error. Needless to say I commented
this query for the sake of sanity for the time being. -
Hi,
I am getting following error message ,
[Microsoft][ODBC Microsoft Access Driver] Syntax error in UPDATE statement.
When run this code.
<%@ page import= "java.sql.*"%>
<%
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con = DriverManager.getConnection("jdbc:odbc:bspipdb");
Statement st = con.createStatement();
st.executeUpdate("update tscipshift set 11-Aug-08='M' where TechN='Elamparuthi'");
%>
tscipshift=table ,column=11-Aug-08 are all exist.
I dont know why I am getting error mesage.
Any idea why?Shahbaz2008 wrote:
you haven't set your user name and password hereI don't believe that's necessary with Access. Then again, it's not an enterprise database.
Connection con = DriverManager.getConnection("jdbc:odbc:bspipdb");
change it to this
Connection con = DriverManager.getConnection("jdbc:odbc:bspipdb","+username+","+password+");
here pass your username and password...
In Oracle default user name and password is
username = scott
password = tigerSo who uses that? Only an eejit would leave that account open.
So the statement would be
Connection con = DriverManager.getConnection("jdbc:odbc:bspipdb","scott","tiger");
or In Mirosoft Access there is no user name and password so the statement will be Like I said - unnecessary, and not the reason the OP is having problems.
Connection con = DriverManager.getConnection("jdbc:odbc:bspipdb","","");>
Besides this change your table name 11-Aug-08 to anything that is not start with number or any special symbols.
for example aug112008 is good or aug is too good.No, it's still not good if you understand ANYTHING about relational databases and normalization.
I think it would work.I think you're just as stup!d as the OP.
% -
JDBC: Syntax error in UPDATE statement???
Hi,
I have been trying to solve this seemingly simple problem for the past 4 hours, and I had no success. I am working on a jdbc:odbc connection which utilizes MS Access. I have been constantly getting "Syntax error in UPDATE statement", and this is the statement
(name of the table is CDs, columns are number, artist, album, label and date - all strings):
query = "UPDATE CDs SET artist = '" + fields.artist.getText() +"', album = '" +
fields.album.getText() + "', label = '" +
fields.label.getText() + "', date = '" +
fields.date.getText() + "' WHERE number = '" + fields.number.getText() + "'";
Can anybody recognize an error? Thank you,
mirkokrugA couple of possibilities.
If the column NUMBER is numeric then it wouldn't need quotes around the data value. Also if the column DATE is a date or date/time type then the format from the textbox may not be correct.
Col -
SQL*Loader-930: Error parsing insert statement for column
we upload data on daily basis in application throug apps user and these table are invloved
1. DEV_RA_INTERFACE_LINES_ALL(owner is a apps)
2.RA_INTERFACE_LINES_ALL(owner is a AR)
we do steps
1 delete record from DEV_RA_INTERFACE_LINES_ALL table
2 delete record from RA_INTERFACE_LINES_ALL table
3 load data using sql loader with apps user
4 insert in RA_INTERFACE_LINES_ALL table
we want to change user i mean these step do dataupload user not apps
we give the proper rights to dataupload like select,delete and insert rights on these table to dataupload user but when i going to load data throug sql loader we receive error
SQL*Loader-930: Error parsing insert statement for column APPS.DEV_RA_INTERFACE_
LINES_ALL.ORIG_SYSTEM_BILL_ADDRESS_ID.
ORA-00904: "F_ORIG_SYSTEM_BILL_ADDR_REF": invalid identifier
and if i insert data through apps then done.make sure that u have no speces left
between lines.
give the path of control file path correctly. -
SQL*Loader-929: Error parsing insert statement for table
Hi,
I get the following error with SQL*Loader:
Table MYTABLE loaded from every logical record.
Insert option in effect for this table: INSERT
Column Name Position Len Term Encl Datatype
IDE FIRST * ; CHARACTER
SQL string for column : "mysequence.NEXTVAL"
CSI_NBR 1:10 10 ; CHARACTER
POLICY_NBR 11:22 12 ; CHARACTER
CURRENCY_COD 23:25 3 ; CHARACTER
POLICY_STAT 26:27 2 ; CHARACTER
PRODUCT_COD 28:35 8 ; CHARACTER
END_DAT 44:53 10 ; CHARACTER
FISCAL_COD 83:83 1 ; CHARACTER
TOT_VAL 92:112 21 ; CHARACTER
SQL*Loader-929: Error parsing insert statement for table MYTABLE.
ORA-01031: insufficient privileges
I am positive that I can SELECT the sequence and INSERT into the table with the user invoking sql*loader.
Where does that "ORA-01031" come from?
Regards
...Options:
1) you are wrong about privileges OR
2) you have the privilege only when you connect via SQL*Plus (or whichever other tool you used to test the insert).
Is it possible that during your test you enabled the role which granted you the INSERT privilege - and that SQL*Loader doesn't do this?
Can you see the table in this list?
select *
from user_tab_privs_recd
where table_name='MY_TABLE'
and owner='table owner whoever';
select *
from user_role_privs;Any roles where DEFAULT_ROLE is not YES?
HTH
Regards Nigel -
Syntax Error in Update Statement
Would a smart and kind CF pro mind putting a fresh pair of
eyes on this code and tell me where the syntax error is? All the
fields in the statement are numeric except the last one (comments).
I have enclosed them in val() to ensure they are numeric when
inserted into the DB. The fields they're being inserted into are
numeric. I need to be numeric because I will be doing calculations
on them. Also, I have triple-checked to ensure the datasource,
table, and field names all match.
Thanks,
GwenHTry using <cfqueryparam>
<cfquery datasource="reviews">
UPDATE evals
SET focus = <cfqueryparam cfsqltype="cf_sql_numeric"
value="#form.focus#">
, strengths = <cfqueryparam cfsqltype="cf_sql_numeric"
value="#form.strengths#">
, tailored = <cfqueryparam cfsqltype="cf_sql_numeric"
value="#form.tailored#">
, badinfo = <cfqueryparam cfsqltype="cf_sql_numeric"
value="#form.badinfo#">
, format = <cfqueryparam cfsqltype="cf_sql_numeric"
value="#form.format#">
, visual = <cfqueryparam cfsqltype="cf_sql_numeric"
value="#form.visual#">
, grammar = <cfqueryparam cfsqltype="cf_sql_numeric"
value="#form.grammar#">
, pronouns = <cfqueryparam cfsqltype="cf_sql_numeric"
value="#form.pronouns#">
, written = <cfqueryparam cfsqltype="cf_sql_numeric"
value="#form.written#">
, achieve = <cfqueryparam cfsqltype="cf_sql_numeric"
value="#form.achieve#">
, sell = <cfqueryparam cfsqltype="cf_sql_numeric"
value="#form.sell#">
, negative = <cfqueryparam cfsqltype="cf_sql_numeric"
value="#form.negative#">
, top = <cfqueryparam cfsqltype="cf_sql_numeric"
value="#form.top#">
, general = <cfqueryparam cfsqltype="cf_sql_numeric"
value="#form.general#">
, intro = <cfqueryparam cfsqltype="cf_sql_numeric"
value="#form.intro#">
, orientation = <cfqueryparam cfsqltype="cf_sql_numeric"
value="#form.orientation#">
, paragraphs = <cfqueryparam cfsqltype="cf_sql_numeric"
value="#form.paragraphs#">
, two = <cfqueryparam cfsqltype="cf_sql_numeric"
value="#form.two#">
, length = <cfqueryparam cfsqltype="cf_sql_numeric"
value="#form.length#">
, none = <cfqueryparam cfsqltype="cf_sql_numeric"
value="#form.none#">
, comments = <cfqueryparam cfsqltype="cf_sql_clob"
value="#form.comments#">
WHERE resumeID = <cfqueryparam cfsqltype="cf_sql_numeric"
value="#form.resumeID#">
</cfquery>
Ken Ford
Adobe Community Expert Dreamweaver/ColdFusion
Adobe Certified Expert - Dreamweaver CS3
Adobe Certified Expert - ColdFusion 8
Fordwebs, LLC
http://www.fordwebs.com
"GwenH" <[email protected]> wrote in message
news:[email protected]...
> Would a smart and kind CF pro mind putting a fresh pair
of eyes on this
> code
> and tell me where the syntax error is? All the fields in
the statement are
> numeric except the last one (comments). I have enclosed
them in val() to
> ensure
> they are numeric when inserted into the DB. The fields
they're being
> inserted
> into are numeric. I need to be numeric because I will be
doing
> calculations on
> them. Also, I have triple-checked to ensure the
datasource, table, and
> field
> names all match.
>
> Thanks,
> GwenH
>
> <cfquery datasource="reviews">
> UPDATE evals
> SET
> focus = val(#form.focus#)
> , strengths = val(#form.strengths#)
> , tailored = val(#form.tailored#)
> , badinfo = val(#form.badinfo#)
> , format = val(#form.format#)
> , visual = val(#form.visual#)
> , grammar = val(#form.grammar#)
> , pronouns = val(#form.pronouns#)
> , written = val(#form.written#)
> , achieve = val(#form.achieve#)
> , sell = val(#form.sell#)
> , negative = val(#form.negative#)
> , top = val(#form.top#)
> , general = val(#form.general#)
> , intro = val(#form.intro#)
> , orientation = val(#form.orientation#)
> , paragraphs = val(#form.paragraphs#)
> , two = val(#form.two#)
> , length = val(#form.length#)
> , none = val(#form.none#)
> , comments = '#form.comments#'
> WHERE resumeID = #form.resumeID#
> </cfquery>
> -
Syntax Error with EXPORT statement in ECC 6
Hi All,
I have one issue with EXPORT statement syntax.
I have declared data like below:
DATA: BEGIN OF mem_id,
mandt LIKE sy-mandt,
uname LIKE sy-uname,
modno LIKE sy-modno,
END OF mem_id.
export the memory id
EXPORT E_VBKOK XANZPK TEXTTAB XBOLNR TO MEMORY ID MEM_ID.
When I am checking the syntax error i am getting like "MEM_ID" must be a character-type field (data type C, N, D or T). by "INTERFACE". by "INTERFACE". "INTERFACE". by "INTERFACE". by "INTERFACE".
I know this statement would be like IMPORT ITAB TO JTAB FROM MEMORY ID 'table'. So I have written like below
EXPORT E_VBKOK XANZPK TEXTTAB XBOLNR TO MEMORY ID 'MEM_ID'. But still it is throwing an error.
Can you please let me know how can I resolve this?
Regards,
Jyothi CH.Hi Jyothi,
data: l_var type string.
concatenate '6' '8' into l_var separated by space.
export l_var to memory id 'BB'.
Here we have to declare the type(structure) for l_var not for BB
and in another program
data:l_var type string.
import l_var from memory id 'BB'.
write : l_var. -
hi,
i have used script for insert statement.while compiling it ,it shows error in declare section that to in t24_customer_code.can any body pls check out and tell me.
the script is ....
DECLARE
a NUMBER := 10;
t24_customer_code NUMBER;
my_tab SYS.dbms_debug_vc2coll := SYS.dbms_debug_vc2coll ();
BEGIN
LOOP
EXIT WHEN a > 20;
a := a + 1;
t24_customer_code:= 9700 + a;
INSERT INTO t24_customer
(t24_customer_code,
T24_MNEMONIC,
T24_SHORT_NAME,
T24_NAME_1,
T24_NAME_2,
T24_STREET,
T24_SECTOR,
T24_ACCOUNT_OFFICER,
T24_OTHER_OFFICER,
T24_INDUSTRY,
T24_TARGET,
T24_NATIONALITY,
T24_CUSTOMER_STATUS,
T24_LANGUAGE)
VALUES
(t24_customer_code,
'MNEMON' || a,
'HANSARUN',
'KUMAR',
'MAQSOOD',
'NIYAZ DINESH',
1001,
1,
5,
1000,
1,
'US',
2,
'US');
my_tab.EXTEND;
my_tab (a - 1) := t24_customer_code;
END LOOP;
OPEN :cur FOR
SELECT *
FROM t24_customer
WHERE t24_customer_code IN (SELECT COLUMN_VALUE
FROM TABLE (CAST (my_tab AS SYS.dbms_debug_vc2coll)));
END;
thanks
ratheeshPlease describe column name and data type on your table.
T24_MNEMONIC is not NUMBER, is it?
By the way,
VALUES
(t24_customer_code,Here t24_customer_code is not your variable
but that is column name of t24_customer.
You might get another error after solving 'ORA-01722: invalid number'
SQL> edit
Wrote file afiedt.buf
1* insert into scott.dept (deptno) values (deptno)
SQL> /
insert into scott.dept (deptno) values (deptno)
ERROR at line 1:
ORA-00984: column not allowed here -
Hi,
I'm new to coldfusion and was doing a practice survey. I'm
getting the following error:
The INSERT INTO statement contains the following unknown
field name: 'recipes'. Make sure you have typed
the name correctly, and try the operation again.
The error occurred in (coldfusion form): line 405
403 :
(lname,fname,yourID,status,preprog_survey,recipes,activity,tips,stress,other,othertext,we ight_result,lbs_gained,lbs_lost,behaviors,desc_behaviors,most_help,improve_prog)
404 : values
405 :
('#lname#','#fname#','#yourID#','#status#','#preprog_survey#','#recipes#','#activity#','# tips#','#stress#','#other#','#othertext#','#weight_result#','#lbs_gained#','#lbs_lost#','# behaviors#','#desc_behaviors#','#most_help#','#improve_prog#')
406 : </cfquery>
407 :
SQL Insert into maintaint
(lname,fname,yourID,status,preprog_survey,recipes,activity,tips,stress,other,othertext,we ight_result,lbs_gained,lbs_lost,behaviors,desc_behaviors,most_help,improve_prog)
values ('last name','first
name','444444','member,'No','0','0','1','0','1','no work, all
play','gained',' too many','','Yes','Dreaming of eating better, but
not doing it','This survey!','no improvement suggestions'
VENDORERRORCODE -3502
SQLSTATE 42000
Can anyone tell me what this possibly means? I'm sure its
probably hard to understand without seeing the form. These are the
types of fields each are:
lname, fname, yourID = text
status = radio
preprog_survey = radio
recipes, activity,tips, stress, other, = checkboxes
othertext, = text
weight_result, = radio
lbs_gained,lbs_lost, = text
behaviors, = radio
desc_behaviors, most_help, improve_prog = textLooking at the code you supplied I noticed that for the
checkboxes values where '0' and '1'.
SQL Insert into maintaint
(lname,fname,yourID,status,preprog_survey,recipes,activity,tips,stress,other,othertext,we ight_result,lbs_gained,lbs_lost,behaviors,desc_behaviors,most_help,improve_prog)
values ('last name','first
name','444444','member,'No','0','0','1','0','1','no work, all
play','gained',' too many','','Yes','Dreaming of eating better, but
not doing it','This survey!','no improvement suggestions'
You don't need quotes around numeric values, only text.
Hope that helps you. -
Help! Syntax Error in SQL statement
Hello. I'm getting an error message and I'm just not seeing
where I went wrong. The SQL statement is:
updateSQL = "UPDATE TrainingHistory SET Status='" &
fFormat(Request.Form(cStatus)) & "', StatusComments='" &
fFormat(Request.Form(cStatusComments)) & " WHERE Training_ID="
& fFormat(Request.Form(cTrainingID))
The error message is:
[Microsoft][ODBC Microsoft Access Driver] Syntax error in
string in query expression '' WHERE Training_ID=9054'.
I've been looking at it for a while. Not sure where I went
wrong. Here is a more complete version of the code:
<%
Function fFormat(vText)
fFormat = Replace(vText, "'", "''")
End Function
Sub sRunSQL(vSQL)
set cExecute = Server.CreateObject("ADODB.Command")
With cExecute
.ActiveConnection = MM_coldsuncrea_lms_STRING
.CommandText = vSQL
.CommandType = 1
.CommandTimeout = 0
.Prepared = true
.Execute()
End With
End Sub
If Request.Form("action")="update" Then
'Set variables for update
Dim updateSQL, i
Dim cTrainingID, cStatus, cStatusComments
'Loop through records on screen and update
For i = 1 To fFormat(Request.Form("counter"))
'Create the proper field names to reference on the form
cTrainingID = "Training_ID" & CStr(i)
cStatus = "Status" & CStr(i)
cStatusComments = "StatusComments" & CStr(i)
'Create the update sql statement
updateSQL = "UPDATE TrainingHistory SET Status='" &
fFormat(Request.Form(cStatus)) & "', StatusComments='" &
fFormat(Request.Form(cStatusComments)) & " WHERE Training_ID="
& fFormat(Request.Form(cTrainingID))
'Run the sql statement
Call sRunSQL(updateSQL)
Next
'Refresh page
Response.Redirect("ClassUpdateRoster.asp?Training_ID=") &
(rsClassDetails.Fields.Item("event_ID").Value)
End If
%>You need another single quote after the double quote before
the WHERE clause. You are not closing the single quote you used to
delimit the value for StatusComments. -
Syntax error in modify statement
Hi Friends,
There is an Internal table IT_STATUS which is the Parameter in BADI Method IF_EX_WORKORDER_UPDATE~BEFORE_UPDATE.
Below is the code i have written
Data: wa_status type cobai_s_status,
stat TYPE TABLE OF jstat,
wa_stat type jstat.
CALL FUNCTION 'STATUS_READ'
EXPORTING
client = sy-mandt
objnr = gv_objnr
* ONLY_ACTIVE = ' '
* IMPORTING
* OBTYP =
* STSMA =
* STONR =
TABLES
status = stat
EXCEPTIONS
object_not_found = 1
OTHERS = 2
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ELSE.
loop at it_status into wa_status.
read table stat into wa_stat with key STAT = wa_status-stat.
if sy-subrc = 0.
wa_status-stat = wa_stat-stat.
wa_status-INACT = wa_stat-INACT.
modify it_status from wa_status transporting stat inact.
endif.
endloop.
ENDIF.
At Modify statement it is giving a syntax error 'The <b>field "IT_STATUS" cannot be changed.-</b>'. what could be the reason?
Please provide me the solution.
Thanks & Regards,
SatishHi Rob,
This is the whole code which i had written in method
METHOD if_ex_workorder_update~before_update.
DATA: gv_aufnr TYPE afih-aufnr,
gv_objnr TYPE jest-objnr,
stat TYPE TABLE OF jstat,
wa_stat TYPE jstat,
wa_header TYPE cobai_s_header,
wa_status TYPE cobai_s_status,
it_status_new TYPE cobai_t_status.
DATA: status_index TYPE sy-tabix.
BREAK-POINT.
LOOP AT it_header INTO wa_header.
SELECT SINGLE aufnr FROM afih INTO gv_aufnr WHERE warpl = wa_header-warpl AND abnum = 1.
IF sy-subrc = 0.
CONCATENATE 'OR' gv_aufnr INTO gv_objnr.
CALL FUNCTION 'STATUS_READ'
EXPORTING
client = sy-mandt
objnr = gv_objnr
* ONLY_ACTIVE = ' '
* IMPORTING
* OBTYP =
* STSMA =
* STONR =
TABLES
status = stat
EXCEPTIONS
object_not_found = 1
OTHERS = 2
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ELSE.
LOOP AT it_status INTO wa_status.
status_index = sy-tabix.
READ TABLE stat INTO wa_stat WITH KEY stat = wa_status-stat.
IF sy-subrc = 0.
wa_status-stat = wa_stat-stat.
wa_status-inact = wa_stat-inact.
MODIFY it_status INDEX status_index FROM wa_status TRANSPORTING stat inact.
ENDIF.
ENDLOOP.
ENDIF.
ENDIF.
ENDLOOP.
ENDMETHOD.
Hope it will get resolved
Regards,
Satish -
Syntax error using try statement in WLST
Hi All,
I have a WLST script to create some JMS resources.
I want to implement exception handling in such a way that if the script fails at any point, all the changes done should be reverted back.
However, whenever I am trying to put a try block, the script is throwing syntax error on the first line after the try statement.
Please find below the script I am using. Please suggest
import sys
from java.lang import System
*# Putting a try statement here results in a syntax error at the below line*
print "Starting the script ..."
connect('weblogic',password,'t3://osbdev:7001')
edit()
startEdit()
servermb=getMBean("Servers/osb_server")
if servermb is None:
print 'Value is Null'
else:
+# Creating the JMS Server+
jmsserver1mb = create('WLSTJMSServer','JMSServer')
jmsserver1mb.addTarget(servermb)
+# Creating the JMS Module+
jmsMySystemResource = create("WLSTJmsSystemResource","JMSSystemResource")
jmsMySystemResource.addTarget(servermb)
subDep1mb = jmsMySystemResource .createSubDeployment('WLSTJMSSubDeployment')
subDep1mb.addTarget(jmsserver1mb)
theJMSResource = jmsMySystemResource.getJMSResource()
connfact1 = theJMSResource.createConnectionFactory('WLSTConnFact1')
connfact1.setJNDIName('jms.WLSTConnFact1')
connfact1.setSubDeploymentName('WLSTJMSSubDeployment')
print "Creating WLSTQueue1..."
jmsqueue1 = theJMSResource.createQueue('WLSTJMSQueue1')
jmsqueue1.setJNDIName('jms.WLSTJMSQueue1')
jmsqueue1.setSubDeploymentName('WLSTJMSSubDeployment')
print "Creating WLSTQueue2..."
jmsqueue2 = theJMSResource.createQueue('WLSTJMSQueue2')
jmsqueue2.setJNDIName('jms.WLSTJMSQueue2')
jmsqueue2.setSubDeploymentName('WLSTJMSSubDeployment')
*# try statement is working at only this point of the program*
try:
save()
activate(block="true")
print "script returns SUCCESS"
except:
save()
cancelEdit(defaultAnswer="y")
print "Error while trying to connect to server !!!"
print "Unexpected error: ", sys.exc_info()[0]
dumpStack()
raise
Edited by: Chintan Parekh on Mar 16, 2011 7:06 AMHi Chintan,
Try doing copy pasting the below code, you have to hit the tab or space after try or except to create its block and keep an eye on the alinement's of it.
try:
save()
activate(block="true")
print "script returns SUCCESS"
except:
save()
cancelEdit(defaultAnswer="y")
print "Error while trying to connect to server !!!"
print "Unexpected error: ", sys.exc_info()[0]
dumpStack()Also I made the alinement's properly and the script is running properly with out any error.
print "Starting the script ..."
connect('weblogic','weblogic','t3://localhost:7001')
edit()
startEdit()
servermb=getMBean("Servers/AdminServer")
if servermb is None:
print 'Value is Null'
else:
# Creating the JMS Server
jmsserver1mb = create('WLSTJMSServer','JMSServer')
jmsserver1mb.addTarget(servermb)
# Creating the JMS Module
jmsMySystemResource = create("WLSTJmsSystemResource","JMSSystemResource")
jmsMySystemResource.addTarget(servermb)
subDep1mb = jmsMySystemResource .createSubDeployment('WLSTJMSSubDeployment')
subDep1mb.addTarget(jmsserver1mb)
theJMSResource = jmsMySystemResource.getJMSResource()
connfact1 = theJMSResource.createConnectionFactory('WLSTConnFact1')
connfact1.setJNDIName('jms.WLSTConnFact1')
connfact1.setSubDeploymentName('WLSTJMSSubDeployment')
print "Creating WLSTQueue1..."
jmsqueue1 = theJMSResource.createQueue('WLSTJMSQueue1')
jmsqueue1.setJNDIName('jms.WLSTJMSQueue1')
jmsqueue1.setSubDeploymentName('WLSTJMSSubDeployment')
print "Creating WLSTQueue2..."
jmsqueue2 = theJMSResource.createQueue('WLSTJMSQueue2')
jmsqueue2.setJNDIName('jms.WLSTJMSQueue2')
jmsqueue2.setSubDeploymentName('WLSTJMSSubDeployment')
# try statement is working at only this point of the program
try:
save()
activate(block="true")
print "script returns SUCCESS"
except:
save()
cancelEdit(defaultAnswer="y")
print "Error while trying to connect to server !!!"
print "Unexpected error: ", sys.exc_info()[0]
dumpStack()Below is the output
java weblogic.WLST test.py
Initializing WebLogic Scripting Tool (WLST) ...
Welcome to WebLogic Server Administration Scripting Shell
Type help() for help on available commands
Starting the script ...
Connecting to t3://localhost:7001 with userid weblogic ...
Successfully connected to Admin Server 'AdminServer' that belongs to domain 'Domain_7001'.
Warning: An insecure protocol was used to connect to the
server. To ensure on-the-wire security, the SSL port or
Admin port should be used instead.
Location changed to edit tree. This is a writable tree with
DomainMBean as the root. To make changes you will need to start
an edit session via startEdit().
For more help, use help(edit)
You already have an edit session in progress and hence WLST will
continue with your edit session.
Starting an edit session ...
Started edit session, please be sure to save and activate your
changes once you are done.
MBean type JMSServer with name WLSTJMSServer has been created successfully.
MBean type JMSSystemResource with name WLSTJmsSystemResource has been created successfully.
Creating WLSTQueue1...
Creating WLSTQueue2...
Saving all your changes ...
Saved all your changes successfully.
Activating all your changes, this may take a while ...
The edit lock associated with this edit session is released
once the activation is completed.
Activation completed
script returns SUCCESSRegards,
Ravish Mody
http://middlewaremagic.com/weblogic
Come, Join Us and Experience The Magic…
Edited by: Ravish Mody-MiddewareMagic on Mar 16, 2011 8:33 PM -
SYntax error - on Perform Statement
Hello friends,
I have a syntax error in the following code.
the error is The field "P_I_PA0000" is unknown, but there are the following fields
in the function module.
Any suggestions.
Thanks,
Raju.
PARAMETERS: ps_file1like rlgrap-filename " Incoming file 1
DEFAULT 'c:\HR\ZCNV0008.txt' LOWER CASE,
DATA: BEGIN OF i_pa0000 OCCURS 100.
INCLUDE STRUCTURE pa0000.
DATA: END OF i_pa0000.
PERFORM upload_local_file USING ps_file1
CHANGING i_pa0000[].
*& Form upload_local_file
text
-->P_PS_FILE1 text
<--P_I_PA0000 text
FORM upload_local_file USING p_ps_file1
CHANGING p_i_pa0000[].
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = p_ps_file1
filetype = 'ASC'
TABLES
data_tab = p_i_pa0000[]
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.
ENDFORM. " upload_local_fileIf it doesn't work, why did you mark it as "solved"?
I think this is what you are trying to do:
PARAMETERS: ps_file1 LIKE rlgrap-filename " Incoming file 1
DEFAULT 'c:\HR\ZCNV0008.txt' LOWER CASE.
DATA: BEGIN OF i_pa0000 OCCURS 100.
INCLUDE STRUCTURE pa0000.
DATA: END OF i_pa0000.
PERFORM upload_local_file
TABLES i_pa0000
USING ps_file1.
*& Form upload_local_file
* text
FORM upload_local_file
TABLES p_i_pa0000
USING p_ps_file1.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = p_ps_file1
filetype = 'ASC'
TABLES
data_tab = p_i_pa0000
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.
ENDFORM. " upload_local_file
Rob -
Pro*C compilation error - bulk insert statement
Guys, I am screwed up!
There's this Pro*C application that I am working on. I made some changes in some of the functions and when I compile using Pro*C pre-compiler (Version 9), it throws an error in one of the modules that I have not even touched.
Following is the error:
>>>>>>>>>>>>>>>>>>>>>>>>>>>>
++: Release 9.0.1.1.1 - Production on Fri May 25 20:35:30 2007
(c) Copyright 2001 Oracle Corporation. All rights reserved.
System default option values taken from: C:\oracle\ora90\precomp\admin\pcscfg.cfg
Error at line 1512, column 1 in file D:\Siemens\GABS-R\Source\GSM-R_Rating\RTLRa
ting\multimainrate_supp1_cug.pc
EXEC SQL FOR :record_roaming
1
PLS-S-00382, expression is of wrong type
Error at line 1512, column 1 in file D:\Siemens\GABS-R\Source\GSM-R_Rating\RTLRa
ting\multimainrate_supp1_cug.pc
EXEC SQL FOR :record_roaming
1
PLS-S-00000, SQL Statement ignored
Semantic error at line 1512, column 1, file D:\Siemens\GABS-R\Source\GSM-R_Rating\RTLRating\multimainrate_supp1_cug.pc:
EXEC SQL FOR :record_roaming
1
PCC-S-02346, PL/SQL found semantic errors
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
The location it is referring to is:
EXEC SQL FOR :record_roaming
INSERT /*+ PARALLEL(GT_RATED_ROAMING_CALLS) */
INTO GT_RATED_ROAMING_CALLS
(GF_SEQ_NO,
GF_CALL_PRODUCT,
GF_CDR_TYPE,
GF_REC_NO,
GF_REC_STAT,
GF_INTER_REC_NO,
GF_SS_REC_NO,
GF_SS_CODE,
GF_CALLING_NUM,
GF_CALLED_NUM,
GF_CALLING_IMSI,
GF_CALLED_IMSI,
GF_CALLED_NUM_TON,
GF_DIALLED_DIGITS,
GF_LAC,
GF_CELL,
GF_IN_CKTGRP,
GF_IN_CKTID,
GF_OUT_CKTGRP,
GF_OUT_CKTID,
GF_BS_TYPE,
GF_BS_CODE,
GF_DURATION,
GF_THREAD_ID,
GF_CARRIER,
GF_AIR_TIM_CHARGE,
GF_TOLL_CHARGE,
GF_TOLL_UNITS,
GF_ROAM_SURCHARGE,
GF_ROAMING_CHARGES,
GF_ADDITIONAL_CHARGES,
GF_CUST_ID,
GF_CONT_ID,
GF_BILL_PRD,
GF_STATUS,
GF_ERROR_CODE,
GF_RECON_STAT_LANDLINE,
GF_RECON_STAT_ROAMING,
GF_CALLING_IMEI,
GF_CALLED_IMEI,
GF_MSC_ID,
GF_ACTION_CODE,
GF_MSRN,
GF_LONG_DISTANCE_AIR_CHRG,
gf_home_zone_surcharge,
GF_SWITCH_CODE,
GF_BILL_DATE,
GF_CITY_CODE,
GF_BILL_FREQ,
GF_CALL_START_DATE,
GF_CALL_END_DATE,
GF_SMS_TEXT,
GF_TIME_STAMP_AVAILABLE,
GF_TYPE_OF_CALL,
GF_PEAK_OFFPEAK,
GF_PROCESS_DATE,
GF_MATCH_DATA,
GF_ORIG_ZONE_CODE,
GF_DEST_ZONE_CODE,
GF_PRICE_PLAN_CODE
values
(:gt_rated_roaming_calls,sysdate,:roaming_details_match_data,:l_gf_rcd_zone,:l_gf_price_plan);
Pls note that the host variables match exactly the number of fields in the INTO clause (anyway, the error in such a case is different).
Please save my soul!
SanchitHi, check Metalink Note 451413.1 Pro*C Build Fails With Error PCC-02014 on File /usr/include/standards.h
I did workarround #2, and worked.
*+<Moderator edi t- deleted MOS Doc content - pl do NOT post contents of MOS Docs - this is a violation of your Support agreement>+*
Maybe you are looking for
-
I have 3 email addresses set up on my Mac. I'll label them as A, B and C. A is the primary email that was set up when I first got my Mac. C is my professional account for a company I work for. I recieve messages to that email in my Master inbox. I tr
-
Same itunes library, multiple ios devices from different people?
before anything, let me tell u that i followed the advice here... http://support.apple.com/kb/HT1495?viewlocale=en_US&locale=en_US and i lost all 3rd party apps and app data on my dad's ipad. we have two ipads at home. the one belonging to my dad was
-
Purchased a song on the Itouch had to restore it now It's not on there...HE
I've actually got a rather old computer but it runs on XP...alot of the time when I hook the touch up to the computer to sync it doesn't recognize it and makes me restore it...could be either A.) it's an old computer or B.) I bout it off of Ebay. any
-
Yosemite apple mail select all messages in conversation
It appears that Mail/View/Select/All Messages In This Conversation no longer works. The message list UI appears to indicate there are multiple messages in a conversation (they are highlighted, but not selected), but the above listed menu item is grey
-
Reports available in the Business Package for MSS and ESS
Hi, I have searched sdn.sap.com throughout looking for a comprehensive list of reports available in the business packages for both MSS and ESS, i got a little bit of joy and found some of the MSS reports but not all on sdn.sap.com, can anyone please