PreparedStatement and table name
Hi,
I have the following snippet, and it seems that I cannot use the function
prepStmt.setString(1, TABLE_NAME);
to set the table name for the SQL prepared statement. What function should I use?
Thanks,
Rocky
final String[] TABLE_NAME =
"Borrower",
"Loan",
"Depositor",
"Account",
"Customer",
"Branch",
final String DATA_DELETE = "DELETE * FROM ?";
try
PreparedStatement prepStmt = dbConn.prepareStatement(DATA_DELETE);
for (int i =0; i < TABLE_NAME.length; i++)
System.out.println(TABLE_NAME[i]);
prepStmt.setString(1, TABLE_NAME[i]);
prepStmt.execute();
prepStmt.clearParameters();
dbConn.commit(); // not needed
prepStmt.close();
catch(SQLException e)
System.out.println(e.getMessage());
setString is just a specific case of setting a field value should not be used to set table name
what u want to do should be done at the sql String level and it's not necessary prepared statements
This would be my suggestion (didn't test it):
final String[] TABLE_NAME =
"Borrower",
"Loan",
"Depositor",
"Account",
"Customer",
"Branch",
final String DATA_DELETE = "DELETE * FROM TABLE_NAME";
try
Statement stmt = dbConn.createStatement();
for (int i =0; i < TABLE_NAME.length; i++)
System.out.println(TABLE_NAME);
stmt.executeUpdate(
sql.replaceFirst("TABLE_NAME",TABLE_NAME[i])
dbConn.commit(); // not needed
stmt.close();
catch(SQLException e)
System.out.println(e.getMessage());
Similar Messages
-
Field and Table name for purchaser
I want to know the field and table name for purchaser id and purchaser name.
Plz help me.Dear
Purchaser name are define in Header level data in Purchase Order EKKO & Purchase ID define as a Purchasing Group
Purchser Name EKKO-ERNAM
Purchase I D EKKO-EKGRP
Regards
Aamir -
Hi All,
I got some output values from the legacy system with me but need to know whats the actual field name and table name to which i need to transfer these values. How can i do it, since which theres is not field name or despcription given for the data.
Is there any way i can do it.
Points will be rewarded for all useful answers.
Regards
ABif you know the transaction code you use to post the uploaded data in SAP, you just need to do BDC recording in using transation SM35. Record the whole process and create a program from the recording... and you wont even need to know the tables and field names-- almost everything will be done for you....
All you need to do is replace record data with upload data.
You can also try to look for a standard Function Module / BAPI which can do the processing for you and provide it with a table containing the upload data ...
Reward points if useful -
Purchase Order released date field and table name
Hi,
Please tell me the Purchase Order released date field and table name.
Regards
DeepakHi,
Table : EKKO.
Fields : FRGKE,FRGZU.
You can get release date of PO from CDHDR table.
give object value as your po number and check.dont forget to give leading zeros.
The udate will be date field and transaction will be me29n for relaesed po. -
Cost Component structure field and table names
Hey all,
i need to code a BADI to push value of one column in cost component structure to another column in ccs for only order settlements..
any idea how to do this??
i am very new to abap please take it easy on ur answer..
i coulndt even find in which table and fields these values are stored...
thank youI have an OSS note, it tells you step by step how to config the badi u need.. but does not mention about the logic u ll use.. it is up to you....
so i need to find the field names and tell take these and post them to these columns...
i dont know if i make any sence, but this is all i need to do...
so i have the body i have the logic but i dunno the import and export fields...
i believe the table is ckmlkeph.... and field that populate the columns are kst0XX, but i cannot see the field name and table name if i select a line in the column and F1 ???? -
What is the field and table name to describe -Employee Hourly Rate or Emplo
Hi,
Can any one please tell me what is the field and table name to describe
Employee Hourly Rate or Employee Rate.
Thanks for ur time.
Murali.Hi Murali,
The hourly rate is tied to a Wagetype & maintained in Infotype 0008. The database table is PA0008.
the field could vary depending on the No of wagetypes maintained.
regards,
Suresh Datti -
Want field and table name for RESERVED coloum in MMBE
Hi ,
There is a RESERVED coloum in MMBE and I want this * RESERVED* coloum in MB52 .
I got to know that Field related to this RESERVED coloum is BDMNG coming from table RESB .
To confirm the field and table I checked the value in BDMNG by putting join on MARA and RESB where MATNR = BAUGR.
But I got value in BDMNG is 50 and in MMBE it is .228 for that material.
Please tell me field and table name for RESERVED coloum. and hoe to join MARA and RESB to get exact result.
Thanks and Regards,
RanuHi,
Mara-matnr is not equal to Resb-matnr and it shows no record if i do like this.
But Mara-matnr is equal to Resb-baugr, and it gives me 1 record .But porblem is that i dint get BDMNG field matching with mmbe RESEVERD coloum. -
Reg:field and table name
Hi Guys,
I am developing one report for knowing the recognised amount ,but i am not able to get the field and table name .In system it is showing that VBRAV51HD:RVAMT_REAL_G.But this is a structure,how to get a field name for recognised amount.Please help.
Thanks & Regards,
Sash.Hi sash,
I think u need to some R n D upon it. First take the structure and open it in SE11. Then try to find out what all tables does the structure comprises of. Then try finding the relevant fieldname of the table( which is also existent in the structure) getting accessed when the field is triggered. That may solve your problem. try finding the objective of your structure being shown.
Abhijit -
Whats the fieldname and table name for purchase order delivery date
hi all,
whats the fieldname and table name for purchase order delivery date
thanks and regradsEKET-EINDT is the delivery date according to the schedule lines.
for example the line item has 100 qty.
it is sent in three schedules (40, 40, 20).
Then EKET will have 3 records for one PO Line item.
The final delievry data is the EKET-EINDT for the 3rd schedule line item.
Regards,
Ravi -
Production order operation status foeld and table name
Dear all,
I want to know the field name and table name of the field "_SysStatus_" of routing for production order which can be seen through TCode "_CO03_".
thanking in advance.
Suhashi ,
check this "BAPI_PRODORD_CHANGE"
Also check this link "http://www.sap-basis-abap.com/sappp016.htm
Regards
Deepak.
Edited by: Deepak Dhamat on Oct 16, 2010 9:19 AM -
How to know columns and table name whose column size are modified
Hi guys
I want to know which all columns in the tables are modify
i.e. list of columns and table name whose column size are modified
Step1 :
CREATE TABLE employees
( employee_number number(5) ,
employee_name varchar2(50) ,
department_id number(10)
CREATE TABLE Supplier
( Supplier_number number(5) ,
Supplier_name varchar2(50) ,
CREATE TABLE customers
( customer_id number(10) not null,
customer_name varchar2(50),
address varchar2(50),
city varchar2(50),
state varchar2(25),
zip_code varchar2(10),
Step2 :
Alter table employees
MODIFY employee_number number(10)
ALTER TABLE supplier
MODIFY supplier_name varchar2(100)
step3
query to dispaly
columnname table name
employee_number employees
supplier_name supplier
How to know columns and table name whose column size are modified
could you please provide query
Thanks in Advance09:35:50 SQL> desc dba_objects
Name Null? Type
OWNER VARCHAR2(30)
OBJECT_NAME VARCHAR2(128)
SUBOBJECT_NAME VARCHAR2(30)
OBJECT_ID NUMBER
DATA_OBJECT_ID NUMBER
OBJECT_TYPE VARCHAR2(19)
CREATED DATE
LAST_DDL_TIME DATE
TIMESTAMP VARCHAR2(19)
STATUS VARCHAR2(7)
TEMPORARY VARCHAR2(1)
GENERATED VARCHAR2(1)
SECONDARY VARCHAR2(1)
NAMESPACE NUMBER
EDITION_NAME VARCHAR2(30)LAST_DDL_TIME can be utilized -
How to get the column name and table name with value
Hi All
I have one difficult requirement
I have some column values and they have given some alias column names but i need to find the correct column name and table name from the database.
For example value is "SRI" and i dont know the table and exact column name so is there any possibilities to find the column name and table name for the given value
Thanks & Regards
Srikkanth.MSearching all the database for a word...
Courtesy of michaels...
michaels> var val varchar2(5)
michaels> exec :val := 'as'
PL/SQL procedure successfully completed.
michaels> select distinct substr (:val, 1, 11) "Searchword",
substr (table_name, 1, 14) "Table",
substr (t.column_value.getstringval (), 1, 50) "Column/Value"
from cols,
table
(xmlsequence
(dbms_xmlgen.getxmltype ('select ' || column_name
|| ' from ' || table_name
|| ' where upper('
|| column_name
|| ') like upper(''%' || :val
|| '%'')'
).extract ('ROWSET/ROW/*')
) t
-- where table_name in ('EMPLOYEES', 'JOB_HISTORY', 'DEPARTMENTS')
order by "Table"or
11g upwards
SQL> select table_name,
column_name,
:search_string search_string,
result
from (select column_name,
table_name,
'ora:view("' || table_name || '")/ROW/' || column_name || '[ora:contains(text(),"%' || :search_string || '%") > 0]' str
from cols
where table_name in ('EMP', 'DEPT')),
xmltable (str columns result varchar2(10) path '.')
TABLE_NAME COLUMN_NAME SEARCH_STRING RESULT
DEPT DNAME es RESEARCH
EMP ENAME es JAMES
EMP JOB es SALESMAN
EMP JOB es SALESMAN
4 rows selected. -
How to Find what are tables and "Table Name" in particular "Data File"
hi Team,
I have one database that database 300 gb size , this database having 6 ndf files ,
here How to Find what are the tables and "Table Name" in particular "Data File"[.ndf]Hi,
In addition to Prashanth’s suggestion, you can also use the following Transact-SQL statements to get more detailed information including all objects and indexes per Filegroup / Partition and allocated data size of databases.
The script can work with Microsoft SQL Server 2005 and higher version in all Editions. For more details, please review this article:
List all Objects and Indexes per Filegroup / Partition.
-- List all Objects and Indexes
-- per Filegroup / Partition and Allocation Type
-- including the allocated data size
SELECT DS.name AS DataSpaceName
,AU.type_desc AS AllocationDesc
,AU.total_pages / 128 AS TotalSizeMB
,AU.used_pages / 128 AS UsedSizeMB
,AU.data_pages / 128 AS DataSizeMB
,SCH.name AS SchemaName
,OBJ.type_desc AS ObjectType
,OBJ.name AS ObjectName
,IDX.type_desc AS IndexType
,IDX.name AS IndexName
FROM sys.data_spaces AS DS
INNER JOIN sys.allocation_units AS AU
ON DS.data_space_id = AU.data_space_id
INNER JOIN sys.partitions AS PA
ON (AU.type IN (1, 3)
AND AU.container_id = PA.hobt_id)
OR
(AU.type = 2
AND AU.container_id = PA.partition_id)
INNER JOIN sys.objects AS OBJ
ON PA.object_id = OBJ.object_id
INNER JOIN sys.schemas AS SCH
ON OBJ.schema_id = SCH.schema_id
LEFT JOIN sys.indexes AS IDX
ON PA.object_id = IDX.object_id
AND PA.index_id = IDX.index_id
WHERE OBJ.type_desc='USER_TABLE'-- add this WHERE clause to display the information of user tables
ORDER BY DS.name
,SCH.name
,OBJ.name
,IDX.name
Thanks,
Lydia Zhang -
How to find the column name and table name with a value
Hi All
How to find the column name and table name with "Value".
For Example i have value named "Srikkanth" This value will be stored in one table and in one column i we dont know the table how to find the table name and column name
Any help is highly appricatable
Thanks & Regards
Srikkanth.M2 solutions by Michaels (the latter is 11g upwards only)...
michaels> var val varchar2(5)
michaels> exec :val := 'as'
PL/SQL procedure successfully completed.
michaels> select distinct substr (:val, 1, 11) "Searchword",
substr (table_name, 1, 14) "Table",
substr (t.column_value.getstringval (), 1, 50) "Column/Value"
from cols,
table
(xmlsequence
(dbms_xmlgen.getxmltype ('select ' || column_name
|| ' from ' || table_name
|| ' where upper('
|| column_name
|| ') like upper(''%' || :val
|| '%'')'
).extract ('ROWSET/ROW/*')
) t
-- where table_name in ('EMPLOYEES', 'JOB_HISTORY', 'DEPARTMENTS')
order by "Table"or
SQL> select table_name,
column_name,
:search_string search_string,
result
from cols,
xmltable(('ora:view("'||table_name||'")/ROW/'||column_name||'[ora:contains(text(),"%'|| :search_string || '%") > 0]')
columns result varchar2(10) path '.'
where table_name in ('EMP', 'DEPT')
TABLE_NAME COLUMN_NAME SEARCH_STRING RESULT
DEPT DNAME ES RESEARCH
DEPT DNAME ES SALES
EMP ENAME ES JONES
EMP ENAME ES JAMES
EMP JOB ES SALESMAN
EMP JOB ES SALESMAN
EMP JOB ES SALESMAN
EMP JOB ES PRESIDENT
EMP JOB ES SALESMAN
9 rows selected. -
Delivery note field name and table name in MIGO
hi experts,
i want to fetch delivery note for my material document in MIGO.
Also based on MIGO delivery note NUMBER , i need to fetch MIRO document number i.e mir4 dcoument number.
kindly provide field name and table names for delivery note .
thnaks &r egards,
raghulhi karthik,
Thanks for your quick reply.
Actually i developed a zreport which consists of fields
1. vendor
2. refrence
3. po
4. material
5. material document
6. qty
7. amount
8. movement type
9. plant
These data i fetched from MB51 by using submit logic.
All above fields are in one internal table.
Now Based on MB51 reference number , i want to fetch
1. MIR4 number
2. delivery note
IN MIR4 tcode.
Refrence number from MB51 and delivery note in MIR4 document are same .
kindly give me suggestions how to get delivery note and MIR4 number ( inv number) in MIR4 TCODE
thanks & regards,
Raghul
Maybe you are looking for
-
Data recovery after hard drive crash.
I've been using Palm Desktop Software 4.1.4 basically as a great Index Card app. My hard drive died but I recovered my DAT files from backups. On a new computer (Windows 7 x64) I reinstalled PDF 4.1.4 and added my .DAT files, but the software doesn
-
T440S OSD Brightness control failure after resume from Sleep
Hi, I have owned a T440S since late 2013. Relevant Details: T440S Model : 20AQCTO1WW OS : Windows 7 professional (original installation by Lenovo) Latest Drivers installed as of June 2014 - including HotKey and Power Management HotKey ver : 8.30 Powe
-
Is Airport Express the best way to extend Time Capsule wifi network?
I have a Time Capsule which I use for wifi as well as backups. I would like to extend its wifi range. Is an Airport Express the best way to do this? Or would an Airport Extreme get better range? Thanks.
-
I upgraded to Mountain lion. I could not open any of my word documents so i downloaded Libre Office. It is downloaded but how do I get it to work with my old documents??
-
How to organise the media for capturing
I imported from a MiniDV camera to final Cut Pro X project. The program separates the clips each time there is a cut. How can I avoid that, so that I have less clips in the browser? How can I give a name to each individual clip. If I rename it on the