 |
|
 |
|
Next: a cross tab??
|
| Author |
Message |
External

Since: Jan 02, 2008 Posts: 1
|
(Msg. 1) Posted: Wed Jan 02, 2008 10:24 pm
Post subject: Sql Query Archived from groups: comp>databases>paradox (more info?)
|
|
|
I have used sql queries in paradox events previoisly and had no
problems, I now to use a new ODBC driver, the sql builder works fine.
I have tried to put the code on a button and now the sql query fails.
my code is as follows. Can anyone help me. It fails at the execute
statment.
var
itemNameSQL SQL
ViewName tableview
db database
tc1,tc2,tc3 Tcursor
cus,sup,prt,so,sod Longint
ar1 Array[] anytype
dynalias Dynarray[] anytype
endVar
tc1.open("Update Integers.db")
so = tc1.LastSalesOrder
dynalias["USER NAME"] = "XX"
dynalias["PASSWORD"] = "xxxxxx "
db.open (":Altro Caliach:", dynalias)
; this will open the connection to the local table or SQL table via
the alias
itemNameSQL = SQL ; the following stores the SQL statement
into the variable
SELECT Omnis_sohfile.SOHCADS, Omnis_adrfile.ADRID,
Omnis_sohfile.SOHSONO
Omnis_sohfile.SOHCREF, Omnis_sohfile.SOHDATE, Omnis_sohfile.SOHDAQO,
Omnis_sohfile.SOHCUSC,
Omnis_adrfile.ADRCNAM, Omnis_adrfile.ADRADDR, Omnis_adrfile.ADRZIP,
Omnis_adrfile.ADRTEL,
Omnis_sohfile.SOHQVAD
FROM OMNIS.ADRFILE Omnis_adrfile, OMNIS.SOHFILE Omnis_sohfile
WHERE (Omnis_sohfile.SOHCADS = Omnis_adrfile.ADRID)
and Omnis_sohfile.SOHSONO > '~so'
endsql
IF NOT executeSQL(db, itemNameSQL, ":work:SOHCal.DB") then
MSGINFO("Sorry", "Did not work.")
endif
ViewName.open(":work:SOHCal.DB") ;displays the answer table
Endmethod >> Stay informed about: Sql Query |
|
| Back to top |
|
 |  |
External

Since: Jul 07, 2004 Posts: 38
|
(Msg. 2) Posted: Thu Jan 03, 2008 7:07 pm
Post subject: Re: Sql Query [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
Try this:
itemNameSQL.executeSql(db,":work:SOHCal.DB")
bspiteri.RemoveThis@ozemail.com.au wrote:
> I have used sql queries in paradox events previoisly and had no
> problems, I now to use a new ODBC driver, the sql builder works fine.
> I have tried to put the code on a button and now the sql query fails.
> my code is as follows. Can anyone help me. It fails at the execute
> statment.
>
> var
> itemNameSQL SQL
> ViewName tableview
> db database
> tc1,tc2,tc3 Tcursor
> cus,sup,prt,so,sod Longint
> ar1 Array[] anytype
> dynalias Dynarray[] anytype
> endVar
>
> tc1.open("Update Integers.db")
> so = tc1.LastSalesOrder
>
> dynalias["USER NAME"] = "XX"
> dynalias["PASSWORD"] = "xxxxxx "
>
> db.open (":Altro Caliach:", dynalias)
>
> ; this will open the connection to the local table or SQL table via
> the alias
>
> itemNameSQL = SQL ; the following stores the SQL statement
> into the variable
>
> SELECT Omnis_sohfile.SOHCADS, Omnis_adrfile.ADRID,
> Omnis_sohfile.SOHSONO
> Omnis_sohfile.SOHCREF, Omnis_sohfile.SOHDATE, Omnis_sohfile.SOHDAQO,
> Omnis_sohfile.SOHCUSC,
> Omnis_adrfile.ADRCNAM, Omnis_adrfile.ADRADDR, Omnis_adrfile.ADRZIP,
> Omnis_adrfile.ADRTEL,
> Omnis_sohfile.SOHQVAD
> FROM OMNIS.ADRFILE Omnis_adrfile, OMNIS.SOHFILE Omnis_sohfile
> WHERE (Omnis_sohfile.SOHCADS = Omnis_adrfile.ADRID)
> and Omnis_sohfile.SOHSONO > '~so'
>
> endsql
>
>
> IF NOT executeSQL(db, itemNameSQL, ":work:SOHCal.DB") then
> MSGINFO("Sorry", "Did not work.")
> endif
> ViewName.open(":work:SOHCal.DB") ;displays the answer table
>
> Endmethod >> Stay informed about: Sql Query |
|
| Back to top |
|
 |  |
| Related Topics: | SQL Query Help - Howdy all. Have a Pdox qbe that has been converted to SQL that sums transactions where transaction date is > than the user selected date (EfftvDate). However, it returns nothing/blank entry for both fields - acutally 0.00 in FutureTrans when using ...
What is the best way to do this query? - Each patient has a table called Clininfo.db 3 key fields and a field Called ClinicalCode (also keyed) Each patient can have anywhere from 0 to max # of choices available (36 I think) to put in each table I want to be able to query the ClinInfo table for...
Delete Query... - I have a database with a field named PULLED? that is either a "Y" or blank. How do I write code to go through and delete all the people with a "Y" in the PULLED? field, and put them into a new database in the same directory called ...
All inclusive query...? - Howdy, I use P9. This is certainly in the category of "I should know how to do this", but... Suppose I have a table that has a field of first names: Joe Sue Steve Joe Ellie If I run a query on those, the ANSWER.DB will be: Joe Sue Steve ...
SQL query - Null issue - Howdy all. Have a problem converting a Pdox QBE to SQL in that the results of the Pdox QBE treats nulls as 0s as I have Treat blanks as zeros in the Database tab of Preferences (tools, settings, preferences). However, the sql query does not treat.. |
|
You can post new topics in this forum You can reply to topics in this forum You can edit your posts in this forum You can delete your posts in this forum You can vote in polls in this forum
|
|
|
|
 |
|
|