tilde variables in ObjectPAL SQL

tilde variables in ObjectPAL SQL

Post by Stuar » Fri, 12 Apr 2002 06:56:35



Hi,

I'm trying to 'SQL' my PDox 7 application as my database is now on Linux /
PostgreSQL.

In ObjectPAL, I'm trying to write INSERT statements (unsuccessfully)

For example I've got:

inserttxnSQL = SQL
   /*
Alias: pg
*/
INSERT INTO ~tablename ("col1","col2") VALUES ('data1', 'data2')
endSQL

But I really want to do something like:

inserttxnSQL = SQL
   /*
Alias: pg
*/
INSERT INTO ~tablename ("col1","col2") VALUES (~var1, ~var2)
endSQL

But I just get a General SQL error. What's wrong with the above?

I've been even  more unsuccessful creating the INSERT as a string and doing
a readfromString, but maybe I need to go that route? My INSERTs are big and
I quickly reach the 255 char limit for strings.

Any ideas/pointers what is the best way of doing this please?

Thanks again

Stuart

 
 
 

tilde variables in ObjectPAL SQL

Post by Tony McGuir » Fri, 12 Apr 2002 07:07:09


Can't help with the actual SQL, but

String 'limit' can be gotten around by concatenating smaller strings
into your final string.
st1="..."
st2="..."
stFinal=st1+st2

Or use a memo variable, then assign the memo var to a string var.
mem="..."
mem=mem+"..."
stFinal=string(mem)

--
--
 For the quickest and best Paradox support see:
 http://www.thedbcommunity.com/support/

 Tony McGuire
 http://www.thedbaddons.com
 http://www.thedbcommunity.com
 http://www.thedbcommunity.com/inet/
 http://www.thedbaddons.com/jsip/ (JSI)
"I woke up and was able to get myself out of bed.
Being that fortunate, what's to complain about?"
_____________


: Hi,
:
: I'm trying to 'SQL' my PDox 7 application as my database is now on
Linux /
: PostgreSQL.
:
: In ObjectPAL, I'm trying to write INSERT statements (unsuccessfully)
:
: For example I've got:
:
: inserttxnSQL = SQL
:    /*
: Alias: pg
: */
: INSERT INTO ~tablename ("col1","col2") VALUES ('data1', 'data2')
: endSQL
:
:
: But I really want to do something like:
:
: inserttxnSQL = SQL
:    /*
: Alias: pg
: */
: INSERT INTO ~tablename ("col1","col2") VALUES (~var1, ~var2)
: endSQL
:
:
: But I just get a General SQL error. What's wrong with the above?
:
: I've been even  more unsuccessful creating the INSERT as a string
and doing
: a readfromString, but maybe I need to go that route? My INSERTs are
big and
: I quickly reach the 255 char limit for strings.
:
: Any ideas/pointers what is the best way of doing this please?
:
: Thanks again
:
: Stuart
:
:

 
 
 

tilde variables in ObjectPAL SQL

Post by Larry DiGiovann » Fri, 12 Apr 2002 08:49:52


Stuart:

Try:

inserttxnSQL = SQL
/*
Alias: pg
*/
INSERT INTO ~tablename (col1,col2) VALUES ('~var1', '~var2')
endSQL

You need the quote marks around the tilde variable names so the literal SQL
expression has the proper quote delimiters.

--
Larry DiGiovanni
Digico, Inc.
IT Consulting and Staffing Solutions
www.digicoinc.com

Quote:> Hi,

> I'm trying to 'SQL' my PDox 7 application as my database is now on Linux /
> PostgreSQL.

> In ObjectPAL, I'm trying to write INSERT statements (unsuccessfully)

> For example I've got:

> inserttxnSQL = SQL
>    /*
> Alias: pg
> */
> INSERT INTO ~tablename ("col1","col2") VALUES ('data1', 'data2')
> endSQL

> But I really want to do something like:

> inserttxnSQL = SQL
>    /*
> Alias: pg
> */
> INSERT INTO ~tablename ("col1","col2") VALUES (~var1, ~var2)
> endSQL

> But I just get a General SQL error. What's wrong with the above?

> I've been even  more unsuccessful creating the INSERT as a string and
doing
> a readfromString, but maybe I need to go that route? My INSERTs are big
and
> I quickly reach the 255 char limit for strings.

> Any ideas/pointers what is the best way of doing this please?

> Thanks again

> Stuart

 
 
 

tilde variables in ObjectPAL SQL

Post by So'n's » Sun, 14 Apr 2002 21:14:11


Yes, this took me quite a while to figure out when I first wrote "native"
passthrough SQL with MS-SQL as the backend.  I cannot reiterate enough that
the SQL-endSQL construct is the way to go with getting performance from the
backend server.  Curiously, the results are returned in a Pdox table, so the
BDE does get involved at the end, but not in issuing repetitive SQL calls
for processing.  With the native SQL, you don't get the Pdox auxiliary
tables (Changed, Inserted, ErrorIns, etc.) so make sure you've got a
checking routine if you're running a big query.  Small queries are OK to go
through the BDE...sometimes you can much more easily code a query using the
QBE than SQL.

NoaH


Quote:> Stuart:

> Try:

> inserttxnSQL = SQL
> /*
> Alias: pg
> */
> INSERT INTO ~tablename (col1,col2) VALUES ('~var1', '~var2')
> endSQL

> You need the quote marks around the tilde variable names so the literal
SQL
> expression has the proper quote delimiters.

 
 
 

1. Paradox 4.5 objectpal wildcards in tilde date variable

I am trying to product a report which tells me which clients
have a birthday this month.  I can produce a query that does it
by putting 5/../.. in the query to bring up all dates in month of May
but when I try to automate this process for any month using tilde
variables it doesn't work.

Why?

2. Error Message: Connection Broken

3. using tilde variables in SQL VARIABLES

4. Renumbering Serialized Fields

5. Tilde variables in SQL and Oracle.

6. NewEra2.12: LINK: error line too long

7. Using tilde variable in SQL

8. NT Service Pack 5 and Oracle 8i

9. Dates and tilde variables in PWin5.0

10. Tilde variable query advice?

11. ~Tilde Variables in Queries

12. Tilde variable in query HELP

13. Using Tilde variable in query HELP