Hi,

I have the following statement in a SP :-

    INSERT INTO
  #supplier_proofinfo
(
  job_no,
  [rowid],
  proofingtype
)
SELECT
  job_no, [rowid], GetTCardProofType(note)
FROM
    optimadata.tcard
WHERE
      code =    '42'
  AND note LIKE '%With Supplier%'
order by startdate
;

When I try and save the SP I get an 'expected token: Order' error.

If I remove the 'order by' clause it is fine.

What am I doing wrong?

Regards

Mike

asked 10 Sep '14, 01:53

Mike's gravatar image

Mike
970747794
accept rate: 12%

edited 10 Sep '14, 01:53


I am assuming that ORDER BY is not supported with INSERT INTO so I did a work around using a temporary table and SELECT INTO instead.

link

answered 10 Sep '14, 03:12

Mike's gravatar image

Mike
970747794
accept rate: 12%

@Mike you are correct. An Order By is not valid syntax for an INSERT statement.
You can find the grammar for the INSERT statement here: http://devzone.advantagedatabase.com/dz/WebHelp/Advantage11.1/index.html?master_insert.htm

(10 Sep '14, 07:30) Edgar Sherman
Your answer to the original question.
If responding to a request for additional information, please edit the question or use the comment functionality.
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×325
×172
×40
×1

Asked: 10 Sep '14, 01:53

Seen: 1,744 times

Last updated: 10 Sep '14, 07:30

Advantage Developer Zone Contact Us Privacy Policy Copyright Info


Powered by Advantage Database Server and OSQA
Disclaimer: Opinions expressed here are those of the poster and do not necessarily reflect the views of the company.