dbTalk Databases Forums  

Filemaker 6, Serial number and ODBC

comp.databases.filemaker comp.databases.filemaker


Discuss Filemaker 6, Serial number and ODBC in the comp.databases.filemaker forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Andy
 
Posts: n/a

Default Filemaker 6, Serial number and ODBC - 06-22-2005 , 11:01 AM






Hi all,

I'm inserting into a FM6 table via ODBC, and the table has a
non-modifyable serial number (auto-entered).

any idea how i can get the value of that column for the record i just
inserted?

Thanks
Andy


Reply With Quote
  #2  
Old   
ursus.kirk
 
Posts: n/a

Default Re: Filemaker 6, Serial number and ODBC - 06-22-2005 , 04:11 PM






Just put the serial-number field on your layout. Or isn't that what you
need?

Ursus

"Andy" <ajohnstone (AT) capcitypress (DOT) com> schreef in bericht
news:1119456109.758033.19970 (AT) g14g2000cwa (DOT) googlegroups.com...
Quote:
Hi all,

I'm inserting into a FM6 table via ODBC, and the table has a
non-modifyable serial number (auto-entered).

any idea how i can get the value of that column for the record i just
inserted?

Thanks
Andy




Reply With Quote
  #3  
Old   
Andy
 
Posts: n/a

Default Re: Filemaker 6, Serial number and ODBC - 06-23-2005 , 07:59 AM



ursus,

I'm accessing soley through ODBC... so no layouts involved.

What i did is basically the equivolent of the @@IDENTITY variable in
SQL Server.

I *could* do the insert, and then Select Max( ID ) FROM table... but
i'm not sure that guarantees me the ID of the row I just inserted (as
opposed to a row inserted *after* my insert, but *before* my select).

Hope that clears what I'm looking for up a bit.

Andy


Reply With Quote
  #4  
Old   
ursus.kirk
 
Posts: n/a

Default Re: Filemaker 6, Serial number and ODBC - 06-23-2005 , 08:21 AM



I am absolutely a nitwit regarding ODBC. But what I gather is that you want
to see a value inside FMP before through a ADBC connection. I don't think
that would be possible.

have you tried the FMP helpfile? it has some info on how to use OBDC. This
is the list of instructions and elements that FMP can handle. It sdoesn't
mention the @@IDENTITY. But as I don't know anything about OBDC I could be
talking rubbish.

SELECT
INSERT (ook in een subopvraag)
UPDATE
DELETE
CREATE TABLE
DROP TABLE
ALTER TABLE
CREATE INDEX
DROP INDEX
FROM-instruction
ORDER BY-instruction
GROUP BY-instruction
HAVING-instruction
WHERE-instruction
UNION-operator
FOR UPDATE-instruction
: SUM, AVG, COUNT, MAX, MIN
DISTINCT SQL-operator
Inner Join-instructions
Left Outer Join-instructions
Subopvragen
Scalaire instructions
Current of Cursor-instructions
ROW ID

"Andy" <ajohnstone (AT) capcitypress (DOT) com> schreef in bericht
news:1119531550.117832.207040 (AT) g43g2000cwa (DOT) googlegroups.com...
Quote:
ursus,

I'm accessing soley through ODBC... so no layouts involved.

What i did is basically the equivolent of the @@IDENTITY variable in
SQL Server.

I *could* do the insert, and then Select Max( ID ) FROM table... but
i'm not sure that guarantees me the ID of the row I just inserted (as
opposed to a row inserted *after* my insert, but *before* my select).

Hope that clears what I'm looking for up a bit.

Andy




Reply With Quote
  #5  
Old   
Andy
 
Posts: n/a

Default Re: Filemaker 6, Serial number and ODBC - 06-23-2005 , 09:10 AM



ursus,

Yes, I've looked through the help, and haven't found what I need, which
is why I'm asking here if and how it can be done.

The best I could do is a select immediately after the insert.. but I'm
not sure that would ensure I have the row i inserted, and not someone
else.

Thanks
Andy


Reply With Quote
  #6  
Old   
ursus.kirk
 
Posts: n/a

Default Re: Filemaker 6, Serial number and ODBC - 06-23-2005 , 11:13 AM



If you use a log-in system for your fmp file, (accounts & privileges) you
could do the following.

Create a script that
Imports your original ODBC record-serial-number together with all the data
you need for the record
then puts the original ODBC record-serial-number into a global field.

With a user based system, globals are user-specific. So gMyGlobal can hold a
value of UrsusSerial on my console (computer in the network) and at the same
time hold a completely different value AndysSerial on your console. This way
you will allways know what serial came out of the ODBC connection and that
you are the one that put it there in the first place. Be aware that normally
globals are stored when you shutdown a file. But with multi-user systems
only the last one gets stored. But then again you should almost never rely
on globals to hold data that does change to be retrieved in a new session.

Ursus

"Andy" <ajohnstone (AT) capcitypress (DOT) com> schreef in bericht
news:1119535811.102568.265530 (AT) f14g2000cwb (DOT) googlegroups.com...
Quote:
ursus,

Yes, I've looked through the help, and haven't found what I need, which
is why I'm asking here if and how it can be done.

The best I could do is a select immediately after the insert.. but I'm
not sure that would ensure I have the row i inserted, and not someone
else.

Thanks
Andy




Reply With Quote
  #7  
Old   
audleman@quasika.net
 
Posts: n/a

Default Re: Filemaker 6, Serial number and ODBC - 06-23-2005 , 12:01 PM



Why don't you create a unique ID in your SQL database and send that to
FileMaker along with the other information. Then when you wanted to get
FM's unique ID, you could do

SELECT filemakerID FROM Table WHERE sqlID = 'known ID'

When you're synchronizing between two databases, it's a commonly used
technique to have a different unique identifier for each one that you
replicate on both sides. This has added benefits, such as the ability
to tell if a record has been synchronized (look to see if both ID
fields are populated).

Kevin


Reply With Quote
  #8  
Old   
Andy
 
Posts: n/a

Default Re: Filemaker 6, Serial number and ODBC - 06-24-2005 , 09:40 AM



Kevin & ursus,

Sorry, I think I created more confusion then I cleared :-)

I don't have any other DBs right now.. FM6 is the sole database
provider, I'm just writing an application to be a front end to the
database..

I threw out the @@IDENTITY from SQL server just to ask if there's
anything similar in FM ODBC, since thats basically the functionality
I'm looking for.

Andy


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.