on 02-26-2009 9:00 AM
Hello!
I collide with problem: I connect to database by ADO+ODBC. I open table in edit mode, try to add new record and on post event I get the error which show me that schema and tablename were splitted without quotes and dot (for example, I have schema - myschema and tablename - mytable, but error shows me MySchemaMyTable, but not "MySchema"."MyTable").
Can somebody help me?
Hello
Apparently the schema/table name is not correctly merged.
Can you provide me with a small example, which I can build with Visual Studio for closer investigation?
BTW, did you already try the ADO.NET driver of MaxDB, which I provided some time ago via SAPMats.
Regards Thomas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi!
I can't use ADO.NET because I haven't Linux.
And I found new error: when I tune DSN to MaxDB in Standart Administration I set up to use trace log in file, but it doesn't work (no any log).
I use Delphi, so I can't to show the examlpe for Visual Studio.
There's my Delphi code:
ADOQueryEx1.Append;
ADOQueryEx1.Edit;
ADOQueryEx1.Recordset.AddNew(EmptyParam, EmptyParam);
ADOQueryEx1.Recordset.Fields[0].Value:='1';
ADOQueryEx1.Recordset.Update(EmptyParam,EmptyParam); //Here I get that error
ADOQueryEx1.Post;
Best regards,
VJ.
Edited by: VJ S on Mar 24, 2009 11:02 AM
Edited by: VJ S on Mar 24, 2009 11:06 AM
In order to distinguish case sensitive names from case insensitive name, MaxDB uses quotes ("). An ODBC application can get this information from the ODBC driver with
SQLGetInfo (SQL_IDENTIFIER_QUOTE_CHAR). Usually generic ODBC applications gather such info from the driver.
Can you provide me with a small example in order to reproduce the behaviour?
Regards Thomas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
After connect to DB I select data form table:
curpos1:='MYSCHEMA';
curpos2:='MYTABLE';
...
ADOQuery1.SQL.Clear;
ADOQuery1.SQL.Add('select *');
ADOQuery1.SQL.Add(' from "'+curpos1+'"."'+curpos2+'"');
ADOQuery1.Open;
After it I try to post new record (or edit exist) and get this error:
[SAP AG][SDBODBC DLL][MaxDB] Base table not found;-4004 POS(13) Unknown table name:MYSCHEMAMYTABLE
Is it heplful? I hope you can help me.
Best regards, VJ.
I traced again.
::EXECUTE DBS WITH COMMIT 'SQLCURS_2' 2009-03-20 15:43:58.953000 [0x019C5570]
SQL COMMAND : 'select * from "MYSCHEMA"."MYTABLE"
'
RESULT COUNT: -1
CURSOR NAME: 'SQLCURS_2'
FETCH BUFFER START: 1
FETCH BUFFER END : 5
............................................
::GET ROWS AFFECTED [0x019C66C8]
ROWS: 1
::BIND PARAM 2009-03-20 15:44:23.406000 [0x019C90D0]
I T AT L I D P
1 ASCII T 0 0x00000001 0x00000009 0x00000000
::PARSE 'SQLCURS_6' 2009-03-20 15:44:23.406000 [0x019C90D0]
SQL COMMAND:'INSERT INTO MYSCHEMAMYTABLE (ADDRTABLEID) VALUES (?)'
SQL ERROR :
CODE : -4004
SQLSTATE : 42000
MESSAGE : POS(13) Unknown table name:MYSCHEMAMYTABLE
SQL ERROR :
CODE : -4004
SQLSTATE : 42000
MESSAGE : POS(13) Unknown table name:MYSCHEMAMYTABLE
::EXECUTE WITH COMMIT 'SQLCURS_6' 2009-03-20 15:44:23.406000 [0x019C90D0]
SQL ERROR :
CODE : -10210
SQLSTATE : HY010
MESSAGE : Invalid command state (No prepared SQL command)
So I understand that error in parse.
Can you help me how it can be repaired?
>
> I traced again.
>
> ::EXECUTE DBS WITH COMMIT 'SQLCURS_2' 2009-03-20 15:43:58.953000 [0x019C5570]
> SQL COMMAND : 'select * from "MYSCHEMA"."MYTABLE"
> SQL COMMAND:'INSERT INTO MYSCHEMAMYTABLE (ADDRTABLEID) VALUES (?)'
> SQL ERROR :
> CODE : -4004
> SQLSTATE : 42000
> MESSAGE : POS(13) Unknown table name:MYSCHEMAMYTABLE
> SQL ERROR :
> So I understand that error in parse.
> Can you help me how it can be repaired?
Maybe it's me, but shouldn't the table have the same name for the insert?
That would be "MYSCHEMA"."MYTABLE" than and not MYSCHEMAMYTABLE...
regards,
Lars
Hello
Maybe an ODBC-trace would help. Could you try
odbc_cons trace api on
odbc_cons trace sql on
with
odbc_cons show all
beside others, you can see, where the trace is written.
FYI, in 77ff there is an ADO.NET implementation which might be interesting for you.
[MaxDB7706b10_SDBADO|https://sapmats-de.sap-ag.de/download/download.cgi?id=9EMV0IFEM6E9ZXEUJ1Z5RTFURX2HPV9IB7NRVNSEN675K5YII8]
Regards Thomas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I've got this :
SQLColAttribute 2009-03-02 15:52:11.656000
StatementHandle [in] : 07020AB0
ColumnNumber [in] : 20
FieldIdentifier [in] : SQL_COLUMN_AUTO_INCREMENT
BufferLength [in] : 0
NumericAttrPtr [out] : SQL_FALSE
CharacterAttrPtr [out] : (null)
StringLengthPtr [out] : &(4)
SQLRETURN : SQL_SUCCESS
SQLColAttribute 2009-03-02 15:52:11.656000
StatementHandle [in] : 07020AB0
ColumnNumber [in] : 21
FieldIdentifier [in] : unknown field id: 22
BufferLength [in] : 33
CharacterAttrPtr [out] : unknown field identifier: 22
NumericAttrPtr [out] : (null)
StringLengthPtr [out] : &(9)
SQLRETURN : SQL_SUCCESS
SQLColAttribute 2009-03-02 15:52:11.656000
StatementHandle [in] : 07020AB0
ColumnNumber [in] : 21
FieldIdentifier [in] : unknown field id: 23
BufferLength [in] : 33
CharacterAttrPtr [out] : unknown field identifier: 23
NumericAttrPtr [out] : (null)
StringLengthPtr [out] : &(7)
SQLRETURN : SQL_SUCCESS
SQLColAttribute 2009-03-02 15:52:11.656000
StatementHandle [in] : 07020AB0
ColumnNumber [in] : 21
FieldIdentifier [in] : SQL_COLUMN_QUALIFIER_NAME
BufferLength [in] : 129
CharacterAttrPtr [out] : ''
NumericAttrPtr [out] : (null)
StringLengthPtr [out] : &(0)
SQLRETURN : SQL_SUCCESS
SQLColAttribute 2009-03-02 15:52:11.656000
StatementHandle [in] : 07020AB0
ColumnNumber [in] : 21
FieldIdentifier [in] : SQL_COLUMN_OWNER_NAME
BufferLength [in] : 33
CharacterAttrPtr [out] : 'DOMAIN'
NumericAttrPtr [out] : (null)
StringLengthPtr [out] : &(6)
SQLRETURN : SQL_SUCCESS
SQLColAttribute 2009-03-02 15:52:11.656000
StatementHandle [in] : 07020AB0
ColumnNumber [in] : 21
FieldIdentifier [in] : unknown field id: 1212
BufferLength [in] : 0
NumericAttrPtr [out] : 0
CharacterAttrPtr [out] : (null)
StringLengthPtr [out] : &(2)
SQLRETURN : SQL_SUCCESS
SQLColAttribute 2009-03-02 15:52:11.656000
StatementHandle [in] : 07020AB0
ColumnNumber [in] : 21
FieldIdentifier [in] : SQL_COLUMN_AUTO_INCREMENT
BufferLength [in] : 0
NumericAttrPtr [out] : SQL_FALSE
CharacterAttrPtr [out] : (null)
StringLengthPtr [out] : &(4)
SQLRETURN : SQL_SUCCESS
SQLColAttribute 2009-03-02 15:52:11.656000
StatementHandle [in] : 07020AB0
ColumnNumber [in] : 22
FieldIdentifier [in] : unknown field id: 22
BufferLength [in] : 33
CharacterAttrPtr [out] : unknown field identifier: 22
NumericAttrPtr [out] : (null)
StringLengthPtr [out] : &(9)
SQLRETURN : SQL_SUCCESS
SQLColAttribute 2009-03-02 15:52:11.656000
StatementHandle [in] : 07020AB0
ColumnNumber [in] : 22
FieldIdentifier [in] : unknown field id: 23
BufferLength [in] : 33
CharacterAttrPtr [out] : unknown field identifier: 23
NumericAttrPtr [out] : (null)
StringLengthPtr [out] : &(7)
SQLRETURN : SQL_SUCCESS
SQLColAttribute 2009-03-02 15:52:11.656000
StatementHandle [in] : 07020AB0
ColumnNumber [in] : 22
FieldIdentifier [in] : SQL_COLUMN_QUALIFIER_NAME
BufferLength [in] : 129
CharacterAttrPtr [out] : ''
NumericAttrPtr [out] : (null)
StringLengthPtr [out] : &(0)
SQLRETURN : SQL_SUCCESS
SQLColAttribute 2009-03-02 15:52:11.656000
StatementHandle [in] : 07020AB0
ColumnNumber [in] : 22
FieldIdentifier [in] : SQL_COLUMN_OWNER_NAME
BufferLength [in] : 33
CharacterAttrPtr [out] : 'DOMAIN'
NumericAttrPtr [out] : (null)
StringLengthPtr [out] : &(6)
SQLRETURN : SQL_SUCCESS
SQLColAttribute 2009-03-02 15:52:11.656000
StatementHandle [in] : 07020AB0
ColumnNumber [in] : 22
FieldIdentifier [in] :
<CURRENT WRITE POSITION>
But I don't understand where is the error. Can you help me?
Best regards, VJ.
I've got this :
::EXECUTE WITH COMMIT 'SQLCURS_13' 2009-03-02 15:52:11.656000 [0x0218B538]
PARSE ID: 000FF296 00001C01 54002C00 [1] not cached
SQL COMMAND: 'select * from domain.columns where schemaname=? and tablename=? and tabletype='TABLE' order by pos
'
INPUT PARAMETERS:
APPLICATION
I T AT L I DATA
1 ASCII T 14 6 'APTEKA'
2 ASCII T 16 7 'ADDRESS'
RESULT COUNT: 43
CURSOR NAME: 'SQLCURS_13'
FETCH BUFFER START: 1
FETCH BUFFER END : 43
SQLRETURN : SQL_SUCCESS
SQLGetDiagField 2009-03-02 15:52:11.656000
HandleType [in] : SQL_HANDLE_STMT
Handle [in] : 07020AB0
RecNumber [in] : 0
DiagIdentifier [in] : SQL_DIAG_CURSOR_ROW_COUNT
BufferLength [in] : 4
enc : ASCII
::GET RESULT SET [0x0218B538]
CURSOR NAME: 'SQLCURS_13' [0x07020188]
::GET ROWS AFFECTED [0x07020188]
ROWS: 0
::GET RESULT COUNT [0x07020188]
COUNT: 43
DiagInfoPtr [out] : 43
SQLRETURN : SQL_SUCCESS
SQLRowCount 2009-03-02 15:52:11.656000
StatementHandle [in] : 07020AB0
::GET RESULT COUNT [0x07020188]
COUNT: 43
RowCountPtr [out] : 43
SQLRETURN : SQL_SUCCESS
SQLNumResultCols 2009-03-02 15:52:11.656000
StatementHandle [in] : 07020AB0
ColumnCountPtr [out] : 24
SQLRETURN : SQL_SUCCESS
SQLNumResultCols 2009-03-02 15:52:11.656000
StatementHandle [in] : 07020AB0
ColumnCountPtr [out] : 24
SQLRETURN : SQL_SUCCESS
...
SQLColAttribute 2009-03-02 15:52:11.656000
StatementHandle [in] : 07020AB0
ColumnNumber [in] : 22
FieldIdentifier [in] : unknown field id: 23
BufferLength [in] : 33
CharacterAttrPtr [out] : unknown field identifier: 23
NumericAttrPtr [out] : (null)
StringLengthPtr [out] : &(7)
SQLRETURN : SQL_SUCCESS
SQLColAttribute 2009-03-02 15:52:11.656000
StatementHandle [in] : 07020AB0
ColumnNumber [in] : 22
FieldIdentifier [in] : SQL_COLUMN_QUALIFIER_NAME
BufferLength [in] : 129
CharacterAttrPtr [out] : ''
NumericAttrPtr [out] : (null)
StringLengthPtr [out] : &(0)
SQLRETURN : SQL_SUCCESS
SQLColAttribute 2009-03-02 15:52:11.656000
StatementHandle [in] : 07020AB0
ColumnNumber [in] : 22
FieldIdentifier [in] : SQL_COLUMN_OWNER_NAME
BufferLength [in] : 33
CharacterAttrPtr [out] : 'DOMAIN'
NumericAttrPtr [out] : (null)
StringLengthPtr [out] : &(6)
SQLRETURN : SQL_SUCCESS
SQLColAttribute 2009-03-02 15:52:11.656000
StatementHandle [in] : 07020AB0
ColumnNumber [in] : 22
FieldIdentifier [in] :
<CURRENT WRITE POSITION>
But I don't understand where is the error. Can you help me?
Best regards, VJ.
Hello
Which ODBC driver (release) do you use?
Regards Thomas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
77 | |
9 | |
9 | |
7 | |
6 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.