Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Create SQL View (embed variable) best way q
Message
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01301700
Message ID:
01301706
Views:
12
>What is the best way to do something like this...
>
>   Create SQL View (Var1) Remote Connection (var2) As Select Patient.PATIENT_ID,;
>         Patient.SSN, Patient.SEX_C, Patient.DOB,;
>         Patient.ETHNIC_ORIGIN_C, Patient.RACE_C, Pat_admission_status.EPISODE,;
>         Pat_adm_hist.ADM_PADM_DATE, Pat_adm_hist.ADM_TYPE_C,;
>         Pat_adm_hist.FACILITY_ID, Pat_adm_hist.FACILITY_CHART_NUM,;
>         Pat_admission_status.ADMIT_DATE, Pat_admission_status.DISCHARGE_DATE,;
>         Pat_admission_status.PROGRAM_C, Adm_legal_status.LEGAL_UID,;
>         Adm_legal_status.LEGAL_STATUS_C, Adm_legal_status.EFFECTIVE_DATE From ;
>         (var3) Patient,(var4) Pat_admission_status,(var5);
>          Pat_adm_hist,(var6) Adm_legal_status Where Pat_admission_status.PATIENT_ID =;
>         Patient.PATIENT_ID And Pat_admission_status.FACILITY_ID = Patient.FACILITY_ID;
>         And Pat_adm_hist.PATIENT_ID = Pat_admission_status.PATIENT_ID;
>          And Pat_adm_hist.FACILITY_ID = Pat_admission_status.FACILITY_ID;
>          And Adm_legal_status.PAT_ADM_HIST_UID = Pat_adm_hist.PAT_ADM_HIST_UID;
>          And Adm_legal_status.FACILITY_ID = Pat_adm_hist.FACILITY_ID;
>          And Patient.FACILITY_ID = ;
>        Pat_admission_status.FACILITY_ID And Pat_admission_status.EPISODE = Pat_adm_hist.EPISODE;
>         Order By Patient.SSN, Patient.PATIENT_ID, Pat_admission_status.EPISODE,;
>         Adm_legal_status.LEGAL_UID, Pat_adm_hist.FACILITY_ID
>
>Macro substitution sadly does not work and the string length is too long for concat process.
>How would you create my view with my vars?
text to lcSQLCmd textmerge noshow
 ... substitute all variables with <<var>>
endtext

then 

&lcSQLCmd
Or if the length of lcSQLCmd exceeds 8K:

execscript(lcSQLCmd)
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform