To put Data type inside a table of Microsoft Access (dummy ask)
Hi to all,
I am new to use database in java ... (but I did it long time in Visual Basic) and I have a trivial problem...
I try this SQL statement in different why without success...
int clientIdKey = 3;
Date = regneDate new Date();
"INSERT INTO myTable (idCli, dateReg) VALUES (" + clientIdKey + ", #" + regneDate + "# )";
The message error I get in this case is the follow:
"java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Syntax error in date in query expression '#Sat Oct 20 16:54:23 PDT 2007#'".
(I tried to format the value of regneDate in different why too... but it was not good the same...)
I know the mine is a stupid problem .., but I am not going to get the right road, so I ask to some one that it know the whay to say it me please...
Thank you very much
regards
tonyMrsangelo
Joe's correct. Do it like this:
int clientIdKey = 3;
Date regneDate = new Date();
String sql = "INSERT INTO myTable (idCli, dateReg) VALUES(?,?)";
PreparedStatement stmt = null;
try
stmt = connection.prepareStatement(sql);
stmt.setInt(1, clientIdKey);
stmt.setDate(2, regneDate);
int numRowsAffected = stmt.executeUpdate();
catch (SQLException e)
e.printStackTrace();
finally
try { if (stmt != null) stmt.close(); } catch (SQLException e) {}
} %
Similar Messages
-
I am trying to update a date type coloumn in table;
declare
cursor cur is
select current_doh
from adp_service_dates71608
for update of adp_service_dates71608.current_doh;
rec cur%rowtype;
begin
for rec in cur loop
dbms_output.put (
to_char (rec.current_doh
if rec.current_doh > 2030 then
update adp_service_dates71608 set to_date(to_char(t.current_doh,'ddmmyyyy')-100, 'ddmmyyyy')
where current of cur;
dbms_output.put_line(' updated');
else
dbms_output.new_line;
end if;
end loop;
end;
when I run it I get erro like
ORA-06550: line 11, column 6:
PLS-00103: Encountered the symbol ";" when expecting one of the following:
. ( ) , * % & | = - + < / > at in is mod remainder not range
rem => .. <an exponent (**)> <> or != or ~= >= <= <> and or
like LIKE2_ LIKE4_ LIKEC_ as between from using || multiset
member SUBMULTISET_
The symbol ")" was substituted for ";" to continue.
ORA-06550: line 13, column 57:
PLS-00103: Encountered the symbol "(" when expecting one of the following:
ORA-06550: line 13, column 99:
PLS-00103: Encountered the symbol ")" when expecting one of the following:
, * & - + / at mod remainder rem <an identifier>
<a double-quoted delimited-identifier> <an exponent (**)> as
from into || multiset bulk
what error?
thanksI formatted it for you:
declare
cursor cur is
select current_doh
from adp_service_dates71608
for update of adp_service_dates71608.current_doh;
rec cur%rowtype;
begin
for rec in cur loop
dbms_output.put ( to_char (rec.current_doh );
if rec.current_doh > 2030 then
update adp_service_dates71608
set to_date(to_char(t.current_doh,'ddmmyyyy')-100, 'ddmmyyyy')
where current of cur;
dbms_output.put_line(' updated');
else
dbms_output.new_line;
end if;
end loop;
end;Check the number of opening and closing brackets in the dbms_output.put statement. Also, the syntax of UPDATE is
UPDATE sometable SET somecolumn = somevalue WHERE ...Also "rec cur%rowtype;" is not needed or used. The Cursor FOR loop construction implicitly declares its own, and the one you declared at the top is ignored.
Message was edited by:
William Robertson -
How to change the data type in the table ESLL for the field USERF2_NUM ?
Hello Friends,
I have a requirement in which one of the change is to convert the data type of the field 'USERF2_NUM' in the table 'ESLL' from 'QUAN' to 'CHAR'.
How do i do it if i have an access to change it..........i think i should also check the impact of the change if done.
Kindly tell me as my requirement starts with this small change.
Regards,
Rajesh KumarThanks for the reply Sowmya.
I would like to know 2 things.
1. Is it ok to change the data type of the field 'USERF2_NUM ' which is in the table ESLL. from quan to char.
2. The table ESLL already has entries. if we change the data type from QUAN to CHAR what is the effect on the existing entries of the table .
Kindly reply me back.
Thanks & Regards,
Rajesh Kumar -
Querying the data type of a table/view
Is there a sql statement that will 'return' the data type of a specified table/view?
For instance column x of table y has data type int, is there a statement such as:
SELECT data_type FROM y WHERE column_name = 'x'
I know the above won't work but it gives the gist of what I am looking for.SQL> select table_name, column_name, data_type, data_length, data_precision, data_scale
2 from user_tab_columns
3 where table_name = 'EMP';
TABLE_NA COLUMN_N DATA_TYP DATA_LENGTH DATA_PRECISION DATA_SCALE
EMP EMPNO NUMBER 22 4 0
EMP ENAME VARCHAR2 10
EMP JOB VARCHAR2 9
EMP MGR NUMBER 22 4 0
EMP HIREDATE DATE 7
EMP SAL NUMBER 22 7 2
EMP COMM NUMBER 22 7 2
EMP DEPTNO NUMBER 22 2 0
8 rows selected.
SQL> desc emp
Name Null? Type
EMPNO NOT NULL NUMBER(4)
ENAME VARCHAR2(10)
JOB VARCHAR2(9)
MGR NUMBER(4)
HIREDATE DATE
SAL NUMBER(7,2)
COMM NUMBER(7,2)
DEPTNO NUMBER(2)
SQL>Message was edited by:
Jens Petersen -
How to find the Column data type changes in table
Hi All,
I need to find out the column data type changes where made recently in table .
How do i check past changes in column data type. Any data dictionary are there to find out the data type changes in the column .
Thanks in advance..<FONT FACE="Arial" size=2 color="2D0000">
You have the answer on hand (user_arguments / all_arguments)!
SQL> desc user_arguments
Name Null? Typ
OBJECT_NAME VARCHAR2(30)
PACKAGE_NAME VARCHAR2(30)
OBJECT_ID NOT NULL NUMBER
OVERLOAD VARCHAR2(40)
ARGUMENT_NAME VARCHAR2(30)
POSITION NOT NULL NUMBER
SEQUENCE NOT NULL NUMBER
DATA_LEVEL NOT NULL NUMBER
DATA_TYPE VARCHAR2(30) --> Data Type
DEFAULT_VALUE LONG
DEFAULT_LENGTH NUMBER
IN_OUT VARCHAR2(9) -->Argument direction (IN,OUT,or IN/OUT)
DATA_LENGTH NUMBER
DATA_PRECISION NUMBER
DATA_SCALE NUMBER
RADIX NUMBER
CHARACTER_SET_NAME VARCHAR2(44)
TYPE_OWNER VARCHAR2(30)
TYPE_NAME VARCHAR2(30)
TYPE_SUBNAME VARCHAR2(30)
TYPE_LINK VARCHAR2(128)
PLS_TYPE VARCHAR2(30)
CHAR_LENGTH NUMBER
CHAR_USED VARCHAR2(1)
Look for Data_Type where IN_OUT say OUT. That will be the data type retruned by that function.
Edited :
or POSITION in argument list,or null for function return value
-SK
</FONT> -
Data types in internal tables.
Examples for LINE & KEY.
Mithun,
Internal Tables as Data Types
Internal tables and structures are the two structured data types in ABAP. The data type of an internal table is fully specified by its line type, key, and table type.
Line type
The line type of an internal table can be any data type. The data type of an internal table is normally a structure. Each component of the structure is a column in the internal table. However, the line type may also be elementary or another internal table.
Key
The key identifies table rows. There are two kinds of key for internal tables - the standard key and a user-defined key. You can specify whether the key should be UNIQUE or NON-UNIQUE. Internal tables with a unique key cannot contain duplicate entries. The uniqueness depends on the table access method.
If a table has a structured line type, its default key consists of all of its non-numerical columns that are not references or themselves internal tables. If a table has an elementary line type, the default key is the entire line. The default key of an internal table whose line type is an internal table, the default key is empty.
The user-defined key can contain any columns of the internal table that are not references or themselves internal tables. Internal tables with a user-defined key are called key tables. When you define the key, the sequence of the key fields is significant. You should remember this, for example, if you intend to sort the table according to the key.
Pls. reward if useful -
Counting Data types inside compiled objects...
Hi Gurus,
My requirment is that for any user,we create 'n' no of Functions/Procs/Packages,etc.Now, all these objects will have data-types defined in them.Can i get an overall count of data-types used in a particular user...(going inside the code and checking the data types it has & the count like
For User : Scott
COUNT(*) DATA_TYPES
10 NUMBER
4521 VARCHAR2
239 XMLTYPE..
etc..
Hope some one helps...Query and Count using the dictionary view ALL_ARGUMENTS
-
Login issues using linked tables in Microsoft Access
Hello everyone!!!
Anybody knows how to set the ODBC Login and password for a group of Oracle ODBC linked tables in MS Access by using DAO or VBA?. I need to use DAO instead of ADO for my application since I use ODBC and an Oracle Database.
I know I can use the "save password" check box in the linked tables dialog, but I am developing and Access Application for my company and I'm using a generic username for the application itself by I need not to store the password in the connection string because is easy for an end user to obtain.
I would like to have a form to set the password as long it is opened, and when the form closes, the password is cleared. (Actually, when the control panel form closes, I close Access itself).....
Is there any way to set the password in the DBEngine.Workspaces object??
I searched Microsoft Developer web site and there is severan articles about this topic, but none of them work in an Oracle Database.
Is there any way to communicage with the Oracle Client from the Access application and set the password??
Thanks, I know it's a very technical question, but is the only thing I need to solve to finish my application.!!!!Does anyone know if JDBC can access linked tables
in a Microsoft Access?I doubt the bridge can. However the link is created using ODBC so you can access it directly. -
How to get the Date format inside the table
I have a startdate column in the db in the format May 5, 2001 12:39:00 PM, when I query it from a view in this way : SELECT startdate, ... FROM ..., it returns the format in the db,
However I have to do this SELECT
decode(startdate, null, 'NOT START'), startdate), ... the result is 5-MAY-01,
then I tried this to_char(startTime, 'Month DD, YYYY HH:MI: A.M.') the results become May 05, 2001 12:39:00 PM. (more space between month and day, and 05 instaed of 5)
Does anybody know how to fix this, so I get exactly what is in the db?
Thanks in advanceNo matter what you do if you are storing a date in a column it will get stored in the Oracle's internal 7 byte date format.
The way you get it on retreiving it is as set by your date format. You can either change the default date format for the instance, the individual session or the individual SQL statement(in this case using to_char(date, 'format')).
If you want to store the date in a format you want to store you'll have to store it as char or varchar2.
<BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by George ([email protected]):
I have a startdate column in the db in the format May 5, 2001 12:39:00 PM, when I query it from a view in this way : SELECT startdate, ... FROM ..., it returns the format in the db,
However I have to do this SELECT
decode(startdate, null, 'NOT START'), startdate), ... the result is 5-MAY-01,
then I tried this to_char(startTime, 'Month DD, YYYY HH:MI: A.M.') the results become May 05, 2001 12:39:00 PM. (more space between month and day, and 05 instaed of 5)
Does anybody know how to fix this, so I get exactly what is in the db?
Thanks in advance<HR></BLOCKQUOTE>
When you do to_char() with 'month' oracle blank pads the month to nine characters, the same goes with day too. So to get rid of it you'll have to trim() the month. And if you want to get a single digit for date less than 10 instead of 0x you'll have to do a bit of extra jugglery using translate() or replace().
Hope this helps
Naveen -
Problem to acces linked table from Microsoft Access 2010
We have a couple of MS access databases that have linked tables from oracle Database. When the user try to view the content of the table it gets an error saying that the table or view does not exist.
But if i create a new MS access db and link the same tables with the same user, we are able to view the content of the table. So it does not seem to be related to permissions...
If we delete the linked table and try to re-attached them we got the same error
Anyone have a clue ?It looks like this is a question that should be addressed in our ORACLE ODBC community, since it has to to with MS Access links to an Oracle DB via (I presume) an Oracle ODBC driver.
This community is for Oracle Heterogeneous Gateways. That is, Oracle DB links into 3rd party databases.
Thanks!
Matt -
Changing date help icon inside a table
Dear Experts,
We changed the icon for Date help in the theme editor. In a web dynpro screen the changed image reflects for all date fields but not for the ones inside a table.
If there's a date field inside a table then the icon still shows the default imgage. We have tried to clear local as well as cluster cache and restart the protal but with no effect.
Please help in reolving this issue.
Best Regards
Gaurang DayalI think rather than trying some quirks, you are better off opening a message with SAP.
Thanks
Prashant -
How to list column names and data types for a given table using SQL
I remember that it is possible to use a select statement to list the column names and data types of databaase tables but forgot how its done. Please help.
You can select what you need from DBA_TAB_COLUMNS (or ALL_TAB_COLUMNS or USER_TAB_COLUMNS).
-
A field is given data type is Table icon in Function Module
Hi Experts,
I am developing HCM Reports for that I have one Function Module to retrive data from Source.
One of my Requirement is to Display One of the fields below
Field Name:
Sucessfull Candidate
Vijay
Raju
Ram
to display like this in my Function Module this fields Data Type is selected Table Icon
I think because of this the field Sucessfull Candidate is not display in Data Sources.
quires:
1. what is the procedure to get data in Reporting like above requirement.
2. what I will do to appairing the field in Data sources
3.any changes in Function Module
Regards
Vijaythanks for all participants
-
Data Modeler : Modifying the Table Report layout
Hi ,
I'm using SQL Data Modeler (DM) 4.0 EA .
I used the File -> reports option to generate the reports on Table and in the report
1) I couldn't see the column data type ? (Refer below table ) , Is there any options to bring on the Data Type in the Report ?
No
Column Name
PK
FK
M
Data Type
DT
kind
Domain Name
Formula
(Default Value)
Security
Abbreviation
1
ID1
P
Y
(10)
LT
2
ID2
F
Y
(10)
LT
3
ID3
Y
(1)
LT
4
ID4
Y
(10)
LT
5
ID5
F
(20,4)
LT
2) In options to manage the Table report (Reports -> Manage). Currently I can only remove a heading (like Descriptions Notes ,columns,column comments.). Is there is any way to customize the report in such a way that I can remove some columns (mostly the empty ones) from the report and add the column comments along with the column table than a new column comments table.
Please let me know ,is there is an option to customize the report .
Note: I even tried generating the report using the search then report , but it doesn't give a complete report (i was only able to generate a report on column or table name or constraints , not all together.)
Thanks,
Srinivasan.KThanks for the immediate reply.
I checked on the DM again, the report comes good for the one which has the data type . But now all my data type changed to UNKNOWN and lokks like ,due to this my table report is coming without the "Data Type".
Can you please help me in fixing this unknown data type issue ?
Table report for the ones with proper Data type:
Columns
No
Column Name
PK
FK
M
Data Type
DT
kind
Domain Name
Formula
(Default Value)
Security
Abbreviation
1
ID1
Y
NUMERIC (10)
LT
2
SCRIPT
Y
VARCHAR (1024)
LT
3
UPGRADE_S
Y
VARCHAR (10)
LT
4
UPGRADE_D
Y
VARCHAR (250)
LT
5
UPGRADING_F
Y
VARCHAR (20)
LT
6
TIMESTAMP2
Y
Timestamp
LT -
Using Long Data type in the Page
Hi ,
I have a page (in multiple page creation form ) which is suppose to contain only the NOTES field of the entity being created . The Notes field is defined as LONG data type in the table.
Two Doubts.
1. As of now in Jdev , u only have Varchar2 data type when assigning to any messageText layout item. What should be the max value set for Max Lenght of this field on the form . I suppose its 32k+ ,since its Long Field .
Anybody has used Long notes field before ??
2. This page has only one item on it , ie Notes ,which i have defined as messageRichText as style. I have been trying to resize this item ,so that it stretches out on entire page . But it just doesnt resizes .. any idea ..below is my PG.xml code
<?xml version = '1.0' encoding = 'UTF-8'?>
<!-- dbdrv: exec java oracle/jrad/tools/xml/importer XMLImporter.class java &phase=dat+24 checkfile:~PROD:~PATH:~FILE &fullpath:~PROD:~PATH:~FILE -username &un_apps -password &pw_apps -dbconnection &jdbc_db_addr -userId "1" -rootPackage /oracle/apps/~PROD -rootdir &fullpath:~PROD:mds:directory -->
<page xmlns:jrad="http://xmlns.oracle.com/jrad" xmlns:oa="http://xmlns.oracle.com/oa" xmlns:ui="http://xmlns.oracle.com/uix/ui" version="9.0.3.8.13_1426" xml:lang="en-US" xmlns:user="http://xmlns.oracle.com/jrad/user" xmlns="http://xmlns.oracle.com/jrad" file-version="$Header$">
<content>
<oa:pageLayout id="NotesMainR" amDefName="oracle.apps.xxi.pro.server.ProAM" windowTitle="Pro Notes" controllerClass="oracle.apps.xxi.pro.webui.ProNotesCO">
<ui:corporateBranding>
<oa:image id="corporateBrandingImage" source="/OA_MEDIA/FNDSSCORP.gif"/>
</ui:corporateBranding>
<ui:contents>
<oa:messageComponentLayout id="ProInfoR" extends="/oracle/apps/xxi/pro/webui/ProInfoRN"/>
<oa:pageButtonBar id="PgButton">
<ui:contents>
<oa:submitButton id="Back" use="/oracle/apps/fnd/attributesets/Buttons/Back" unvalidated="true" serverUnvalidated="false"/>
<oa:submitButton id="Save" use="/oracle/apps/fnd/attributesets/Buttons/Save"/>
<oa:submitButton id="Continue" use="/oracle/apps/fnd/attributesets/Buttons/Continue"/>
</ui:contents>
</oa:pageButtonBar>
<oa:tableLayout id="region3" hAlign="center">
<ui:contents>
<oa:rowLayout id="region4" hAlign="left" vAlign="top" width="100%">
<ui:contents>
<oa:cellFormat id="region5" height="100%" width="100%" hAlign="left" columnSpan="1" vAlign="top">
<ui:contents>
<oa:header id="region6" text="Notes In Table Layout">
<ui:contents>
<oa:messageRichTextEditor id="ProNotesI" maximumLength="20000" viewName="CustomerPOVO" viewAttr="ProNotes" fontBar="true" alignmentGroup="true" tipType="shortTip" prompt="Pro Notes" richTextModeDisplayHeight="100%" richTextModeDisplayLength="100%"/>
</ui:contents>
</oa:header>
</ui:contents>
</oa:cellFormat>
</ui:contents>
</oa:rowLayout>
</ui:contents>
</oa:tableLayout>
</ui:contents>
</oa:pageLayout>
</content>
</page>
any idea??
thanksHi Padma,
Thanks for reply !!
The width is still pain point for me ,as i am unable to increase its width .
I tried increasing the width of the table to 100%, however ,it still doesn work .
Any pointers ??
If you have used this widget before , could you assist me with any sample code u hv ??
I would really appreciate it
thanks
Maybe you are looking for
-
Active Directory Sites and Exchange 2013 Deployment
I've recently took over responsibility of an Exchange 2013 Organization that is deployed as follows: Active Directory consists of 4 Sites. AD Site A, B, C, D Exchange 2013 Enterprise resides in 2 of the 4 AD Sites as follows: AD Site A - ExchangeSer
-
Easy way to evaluate a complex return type in adf taskflow
Hi, I use a method call in adf taskflow where I call a bpel ws . This bpel has a complex return type. I want to evaluate in the taskflow router if STATUS==true . Can this be done with pageflowscope (in the method call , I have a return value) or do I
-
hi all, i have the following data WITH table1 AS select 7369 empno, 20 deptno, to_date('12/17/80','mm/dd/yyyy') dt,800 sal from dual union all select 7566 empno, 20 deptno, to_date('04/02/81','mm/dd/yyyy') dt,2975 sal from dual union all select 778
-
Nokia 5800 unable to install settings
I have a very peculiar problem. I have a Nokia 5800 and the phone display had to be replaced. Unfortunately, the service centre also reinstalled the entire software during the process as a result of which I lost all the internet, MMS and browsing set
-
Where can I download text to speech for adobe captivate 7?
I have recetly downloaded captivate 7, but need to find the right file to allow mw to create slides with a text to speech function.