Re: SQL database and applescript?
Re: SQL database and applescript?
- Subject: Re: SQL database and applescript?
- From: email@hidden
- Date: Mon, 1 Apr 2002 14:51:09 EST
MacSQL looks promising, but for a 2.1.2 release it is completely
unacceptable. It crashes at the drop of a hat, it won't let me into databases
for which I know I have privileges, it gets confused about which tables
belong to which databases, it won't show certain tables, it won't
consistently let me edit tables, "do query" errs OMM with Applescript 1.8.2b3
(but will on others), it requires at least Carbonlib 1.3.1 even though that
version has an Applescript conflict. Beyond that, the web site is horribly
neglected (all subpages "Not Found"), the discussion list has no published
mechanism for posting questions, it is slow, and the Applescript dictionary
and sample scripts are lame at best.
If I'm totally missing the boat here, please straighten me out. I've tried
this on 3 machines, including MacOS 9.1 and OSX 10.1.3, with odd behavior on
all.
Jeff Baumann
email@hidden
www.linkedresources.com
In a message dated 3/31/02 10:13:37 AM, bryan wrote:
>
I have only seen scriptable applications which allow SQL
>
queries from inside AppleScript.
>
MacSQL is the best I've seen of this genre.
>
5 star scriptability.
>
You can actually send direct SQL Queries to your SQL
>
servers from commands imbedded in your AppleScripts.
>
>
You can even generate SQL code on the fly within your
>
script and execute it directly from within the script.
>
>
For example, I used the following (abridged version)
>
to read records from a Filemaker DB and insert them
>
into an SQL DB; (and yes I think it's easier than using
>
ODBC.) [nota bene: <opt-L> is a line wrap command]
>
>
The only important part is the very last command:
>
>
------------------------
>
tell application "FileMaker Pro"
>
activate
>
tell last record of database <opt-L>
>
"Apex Study Processing Copy_DrKM" of document 1
>
set my_data_list to {cell "Log_Status", <opt-L>
>
cell "Acct_Num", cell "Dictation_ID", <opt-L>
>
cell "Exam", cell "Facility", cell "Last_Name", <opt-L>
>
cell "First_Name", cell "Date_of_Exam", <opt-L>
>
cell "Ref_Physician", cell "Modality", <opt-L>
>
cell "Exam_Status", cell "Soc_Sec_Num", <opt-L>
>
cell "History", cell "Additional_Notes"}
>
end tell
>
end tell
>
>
set my_data_list_as_string to stringify(my_data_list)
>
--data massaging happens here to coerce the data list to
>
--the appropriate string, it's not important to the concept
>
>
set my_sql_string to <opt-L>
>
"INSERT INTO reports ( status, client_id, <opt-L>
>
patient_id, study_text, facility, last_name, <opt-L>
>
first_name, date_of_service, referring_physician, <opt-L>
>
modality, priority, custom_1, custom_2, <opt-L>
>
custom_3 ) VALUES " & my_data_list_as_string
>
>
tell application "MacSQL"
>
tell session of document 1 to do query my_sql_string
>
end tell
>
------------------------
>
>
I am totally jazzed by this,
>
...but then
>
I don't get out much.
>
>
Bryan Kaufman
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.