dbTalk Databases Forums  

Variable Execute SQL Script

comp.databases.filemaker comp.databases.filemaker


Discuss Variable Execute SQL Script in the comp.databases.filemaker forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
thelizardking@thelizardkings.com
 
Posts: n/a

Default Variable Execute SQL Script - 01-22-2007 , 02:29 PM






I have an external DB I query from File Maker Pro 8.5. I import an
Excel 2003 spreadsheet into FM and clean up the data. This spreadsheet
is essentially a delquinent list of orders that will be shipping from
our supplier late. The spreadsheet they give us is very minimal in the
Information it contains and our own seperate Oracle database shares the
same order numbers and has a lot more information regarding whats on
the order. I am trying to connect the two by importing the
spreadsheet, taking the order number and quering our local DB against
that order number using the "Execute SQL" script. I can get as far as
my WHERE command. I have no idea how to get FM to use a field from FM
as its value. I have tried "Set Variable" as my example below shows
and I have try referencing the field using FMDB:FieldName. I am at a
loss of what to do, any help would be appreciated.

SELECT OMOrder.AssignedToID, OMOrder.OrderNumber
FROM OMOrder
WHERE OMOrder.OrderNumber = $Order_Number


Reply With Quote
  #2  
Old   
thelizardking@thelizardkings.com
 
Posts: n/a

Default Re: Variable Execute SQL Script - 01-22-2007 , 03:29 PM






I know I should give more time for a reply but I'm just going to try to
clerify a bit more.

SELECT OMOrder.AssignedToID, OMOrder.OrderNumber
FROM OMOrder
WHERE OMOrder.OrderNumber = '"<<Order_Number>>'"

To note, the quotations after the = in the WHERE statement are single
quote, double <<Order_Number>> double, single quote.

Order_Number is a field I populate before hand with a single order
number. I have run my SQL through a command line, alter just the last
bit of code to an order number I know exists and have returned the
exptected results.

I am just trying to get either my Execute SQL or Import Records to
realize I want to use a field as the value to look up.


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

Default Re: Variable Execute SQL Script - 01-23-2007 , 03:52 AM



In the "Specify SQL" dialog, check the option "Calculated SQL Text" and
in the calculation box, you can specify literal text strings and fields
just as in any calculation box:

"SELECT OMOrder.AssignedToID, OMOrder.OrderNumber FROM OMOrder WHERE
OMOrder.OrderNumber = " & OrderNumber


HTH

Jeroen

thelizardking (AT) thelizardkings (DOT) com schreef:
Quote:
I know I should give more time for a reply but I'm just going to try to
clerify a bit more.

SELECT OMOrder.AssignedToID, OMOrder.OrderNumber
FROM OMOrder
WHERE OMOrder.OrderNumber = '"<<Order_Number>>'"

To note, the quotations after the = in the WHERE statement are single
quote, double <<Order_Number>> double, single quote.

Order_Number is a field I populate before hand with a single order
number. I have run my SQL through a command line, alter just the last
bit of code to an order number I know exists and have returned the
exptected results.

I am just trying to get either my Execute SQL or Import Records to
realize I want to use a field as the value to look up.


Reply With Quote
  #4  
Old   
thelizardking@thelizardkings.com
 
Posts: n/a

Default Re: Variable Execute SQL Script - 01-25-2007 , 10:06 AM



Works great! I've got a follow up question now I have a loop which
moves through each of my records and attempts to import data from the
db using the current record's order number. Import Records seems to
place its data on the first recorded no matter which record I am
currently on. I'm sure import record wasn't intented to grab
individual pieces of data multiple times but I can't figure out how I
am suppose to pull data from a db based on an individual record's field
value.


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.